mounted_potato_cannon

A mounted potato cannon. Reports aim, drive speed, obstruction state, and loaded ammo.

getAimingVector()Get the cannon's aim direction.
getBarrelPos()Get the cannon's muzzle position.
getCogwheelSpeed()Get the speed of the driving cogwheel.
isBlocked()Check whether the barrel is currently obstructed.
getBlockedLength()Get the distance to a barrel obstruction, if any.
hasAmmo()Check whether the cannon has ammo loaded.
getAmmoCount()Get the count of loaded ammo.
getAmmoType()Get the registry id of the loaded ammo item.
getSelfId()Get this block's id.
getSourceId()Get the id of the block immediately driving this one, or nil if this block has no source.
getSubnetworkAnchorId()Get the id of this block's speed-zone anchor — the gearshift / clutch / speed controller / generator that defines the start of this speed zone.
getNetworkId()Get the id of this block's kinetic network.
getKind()Get this block's role on the kinetic graph: one of "generator", "split_shaft", "consumer", or "passthrough".
getSpeed()Get the local rotational speed at this block.
hasSource()Check whether this block is connected to a kinetic source.
isOverstressed()Check whether the block's network is overstressed.
getStressImpact()Get the stress impact of this block on its network — how much stress it draws while running.
getStressContribution()Get this block's contribution to its network's stress capacity.
getAimingVector()Source

Get the cannon's aim direction.

Returns

  1. { number... } Unit vector along the barrel in world frame, as a 3-element list.
getBarrelPos()Source

Get the cannon's muzzle position.

Returns

  1. { number... } World-frame position of the muzzle, as a 3-element list.
getCogwheelSpeed()Source

Get the speed of the driving cogwheel.

Returns

  1. number The cogwheel speed.
isBlocked()Source

Check whether the barrel is currently obstructed.

Returns

  1. boolean True if blocked.
getBlockedLength()Source

Get the distance to a barrel obstruction, if any.

Returns

  1. number Distance along the barrel to the obstruction. Returns nil if clear.
hasAmmo()Source

Check whether the cannon has ammo loaded.

Returns

  1. boolean True if ammo is loaded.
getAmmoCount()Source

Get the count of loaded ammo.

Returns

  1. number The ammo stack size.
getAmmoType()Source

Get the registry id of the loaded ammo item.

Returns

  1. string Registry id of the loaded ammo item (e.g. "minecraft:potato"), or nil if the cannon is empty.
getSelfId()Source

Get this block's id. Other peripherals' getSourceId or getSubnetworkAnchorId return this same id when they refer to this block.

Returns

  1. string The block's id.
getSourceId()Source

Get the id of the block immediately driving this one, or nil if this block has no source.

Returns

  1. string The parent's id, or nil.
getSubnetworkAnchorId()Source

Get the id of this block's speed-zone anchor — the gearshift / clutch / speed controller / generator that defines the start of this speed zone. Two blocks share an anchor iff they're in the same speed zone. A generator or split-shaft returns its own getSelfId.

Returns

  1. string The anchor block's id, or nil.
getNetworkId()Source

Get the id of this block's kinetic network. Same value for every block on the same network regardless of how many speed zones lie between them. Nil if this block isn't on a network.

Returns

  1. string The network id, or nil.
getKind()Source

Get this block's role on the kinetic graph: one of "generator", "split_shaft", "consumer", or "passthrough".

Returns

  1. string The role string.
getSpeed()Source

Get the local rotational speed at this block. Signed; same value across a speed zone, changes across a split-shaft.

Returns

  1. number The local speed.
hasSource()Source

Check whether this block is connected to a kinetic source.

Returns

  1. boolean True if a source is connected.
isOverstressed()Source

Check whether the block's network is overstressed.

Returns

  1. boolean True if overstressed.
getStressImpact()Source

Get the stress impact of this block on its network — how much stress it draws while running. Speed-dependent; zero for sources and pure conduit blocks. Matches the "Stress Impact" value shown by goggles.

Returns

  1. number The stress impact.
getStressContribution()Source

Get this block's contribution to its network's stress capacity. Non-zero for sources only. Parallel to getStressImpact (per-block draw) and distinct from Create_Stressometer#getStressCapacity, which reports the network total.

Returns

  1. number The per-block stress contribution.