swivel_bearing

A swivel bearing — Simulated's contraption assembler. Exposes the same surface the player has via right-click empty hand (assemble/disassemble), read-only state visible through goggles or the block itself (assembled flag, target angle), and topology pointers to the bearing's plate and the sub-level it rotates.

The target angle is integrated from kinetic input — neither the player nor scripts can set it directly; spinning the input shaft drives it.

isAssembled()Check whether the bearing has assembled a sub-level.
assemble()Assemble the bearing's contraption into a sub-level.
disassemble()Disassemble the bearing's sub-level back into world blocks.
getTargetAngle()Get the bearing's target angle, in degrees.
getTargetAngleRad()Get the bearing's target angle, in radians.
getPlateId()Get the id of the bearing's paired plate block, or nil if no plate is linked.
getSubLevelId()Get the UUID of the sub-level this bearing's contraption rotates as, or nil when the bearing isn't currently assembled.
isLocked()Check whether the bearing is currently asserting its rotational lock.
getLockingMode()Get the bearing's locking mode — how it reacts to redstone signal.
setLockingMode(mode)Set the bearing's locking mode.
getLastAssemblyException()Get the message from the bearing's most recent failed assembly attempt, or nil if the last assemble call succeeded (or n...
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.
isAssembled()Source

Check whether the bearing has assembled a sub-level.

Returns

  1. boolean True if assembled.
assemble()Source

Assemble the bearing's contraption into a sub-level. Equivalent to a player right-clicking the bearing with an empty hand while it's not yet assembled. No-op if already assembled.

disassemble()Source

Disassemble the bearing's sub-level back into world blocks.

getTargetAngle()Source

Get the bearing's target angle, in degrees. The target is integrated from kinetic input each tick; not directly settable from script (no player setter exists either).

Returns

  1. number The target angle in degrees.
getTargetAngleRad()Source

Get the bearing's target angle, in radians.

Returns

  1. number The target angle in radians.
getPlateId()Source

Get the id of the bearing's paired plate block, or nil if no plate is linked. Same id flavor as getSelfId on a peripheral wrapped around the plate; equality-comparable.

Returns

  1. string The plate's id, or nil.
getSubLevelId()Source

Get the UUID of the sub-level this bearing's contraption rotates as, or nil when the bearing isn't currently assembled.

Returns

  1. string The sub-level UUID string, or nil.
isLocked()Source

Check whether the bearing is currently asserting its rotational lock. True when the block state is powered (the bearing is actively holding its attached sub-level fixed against the parent).

Returns

  1. boolean True if locked.
getLockingMode()Source

Get the bearing's locking mode — how it reacts to redstone signal. One of:

  • "locked_always" — locked regardless of signal
  • "locked_default" — locked at rest; signal unlocks
  • "unlocked_default" — unlocked at rest; signal locks
  • "unlocked_always" — unlocked regardless of signal

Mirrors the in-game scroll option.

Returns

  1. string The current locking mode.
setLockingMode(mode)Source

Set the bearing's locking mode. See getLockingMode for the accepted values.

Parameters

  1. mode string The new locking mode.
getLastAssemblyException()Source

Get the message from the bearing's most recent failed assembly attempt, or nil if the last assemble call succeeded (or none has been made yet).

Returns

  1. string The failure message, or nil.
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.