Description

# π NOW WITH PONDERS!
## Showcase
Spoiler
> Take your Create Aeronautics contraptions to the next level.
Join the [Discord](https://discord.gg/zhvuEMEpZR)!
Realtime live [Issue Tracker](https://riestat.co.uk/issue-tracker.html)!
Realtime [Roadmap](https://riestat.co.uk/roadmap.html) for planned features and what I'm currently working on!
**Create Thrusters and Things** adds propulsion, steering, power, and control systems built for ships, aircraft, and advanced moving machines. Build anything from a simple hover platform to a fully scriptable flight rig.
---
## π§ What you can build now
| | |
|---|---|
| π₯ | Fuel-powered and energy-powered thruster systems |
| π― | Steerable propulsion setups with specialised bearings |
| πΉοΈ | Manual flight controls with joystick input and controller channels |
| βοΈ | Smart mechanical routing with dual-lane gearbox behavior |
| β‘ | Full power loops with generation, transfer, and motor output |
| π€ | Utility systems for docking, grabbing, and automation |
---
## π§± New Blocks
| Block | Block | Block |
|---|---|---|
| Thruster | Thruster Bearing | Analogue Joystick |
| Contraption Controller | Industrial Alternator | Smart Gearbox |
| Advanced Data Link | Andesite Cable | Industrial Motor |
| Variable Transmission | Claw | Physics Gantry |
| Powered Zipline | Fuel Oxidizer | Entity Launcher |
| Shipping Manifest
---
## π New Items
**Upgrades**
- Processing Upgrades β Smoking, Smelting, Haunting *(Tiers 1β4)*
- Propulsion Upgrades *(Tiers 1β4)*
**Tools & Accessories**
- Thruster Lens
- Physics Staff
- Physics Goggles
- Contraption Network Linker
- Configuration Clipboard
---
## β¨ Feature Highlights
- π¨ **Color your thruster plume/beam** with dyes for custom builds.
- π **Run thrusters in quieter Peaceful mode** for cleaner visuals and reduced noise.
- π **Switch between classic fuel and Focused FE beam** operation with the Thruster Lens.
- π **Feed fuel and FE through mounted bearing/gimbal assemblies** for distributed propulsion setups.
- π **Use Smart Gearbox** in passthrough or servo workflows for advanced control layouts.
- π±οΈ **Flip face output direction** on Smart Gearbox with simple right-click interaction.
- π **Slow down rotation with redstone** using the Variable Transmission.
- π¦ **Bulk process faster and more efficiently** by placing depots or belts along the sides of the thruster plume/beam and in front of it to process everything around it!
- πΊοΈ **Add and store up to 15 maps** inside the Navigation table at once, and pick one to set the table's navigation to at any time!
- π₯½ **Use the Physics Goggles** to see real-time physics information and contraption diagrams for any contraption you look at!
- π **Use the Contraption Network Linker** to wirelessly control redstone capable blocks from the Contraption Controller without needing redstone links!
- π§° **Tom's Simple Storage** Wireless terminal compatibility with Aeronautics has been added!
- And so much more!
---
## π» Automation Ready
**CC:Tweaked** peripheral support for major systems, including thrusters, bearings, gearbox, joystick, controller, and more. Control single devices or orchestrate attached thruster groups from code.
> π Bundled **in-game docs browser** at `/rom/thrusters/docs.lua` β browse with keyboard on any computer, or use mouse and search on Advanced Computers
> π Runnable **example scripts** included for joysticks, thrusters, bearings, controllers, navigation, claws, and more
> π ComputerCraft peripheral snippets for all you programmers!
---
*Build bigger. Fly farther. Automate everything.*
Spoiler
# Create Thrusters & Things β ComputerCraft API
This document covers every ComputerCraft peripheral exposed by this addon.
## Getting Started
ComputerCraft peripherals let you control mod blocks from Lua scripts running on a Computer or Pocket Computer. To connect to a block, place the computer next to it (or use a Wired Modem) and use `peripheral.find()` or `peripheral.wrap()`:
```lua
local t = peripheral.find("thruster")
if t then
t.setEnabled(true)
t.setThrottle(0.5)
end
```
Blocks default to `"auto"` mode, which means they'll respond to whatever input is present β redstone, computer, or manual. You can lock a block to a specific control mode through its GUI or via `setControlMode()` if you want to prevent other inputs from interfering.
---
## Peripherals
| Type string | Block |
|---|---|
| `thruster` | Thruster |
| `thruster_bearing` | Thruster Bearing |
| `bidirectional_gearbox` | Smart Gearbox |
| `analogue_contraption_controller` | Contraption Controller |
| `analogue_joystick` | Analogue Joystick |
| `claw` | Claw |
| `rope_winch_cable` | Rope Winch Cable (when a Claw is attached) |
---
## 1. Thruster
**Type:** `"thruster"`
### Methods
| Method | Returns | Description |
|---|---|---|
| `setThrottle(throttle)` | β | Sets throttle. Range `0.0` to `1.0`. Throws if out of range. |
| `getThrottle()` | `number` | Returns current throttle. |
| `clearThrottleOverride()` | β | Removes the computer throttle override, returning control to redstone or auto. |
| `setEnabled(enabled)` | β | Enables or disables the thruster. |
| `isEnabled()` | `boolean` | |
| `isActive()` | `boolean` | Whether the thruster is actively firing. |
| `getFuel()` | `number` (mB) | Current fuel level. |
| `getFuelCapacity()` | `number` (mB) | Maximum fuel capacity. |
| `getFuelType()` | `string` | Fluid ID of current fuel, or empty string. |
| `getBurnTimeSeconds()` | `number` | Estimated burn time remaining. |
| `getThrust()` | `number` | Target thrust value. |
| `getRealThrust()` | `number` | Actual thrust being applied. |
| `getLiftCapacity()` | `number` | Max lift this thruster can provide. |
| `getAirflow()` | `number` | Current airflow value. |
| `getRedstoneSignal()` | `number` (`0`β`15`) | Incoming redstone signal strength. |
| `getControlMode()` | `string` | Current mode: `auto`, `redstone`, or `computer`. |
| `setControlMode(mode)` | β | Set control mode. |
| `getName()` | `string` | Custom display name. |
| `setName(name)` | β | Set a custom display name. |
| `isSoulMode()` | `boolean` | Whether soul mode (peaceful/quiet operation) is enabled. |
| `setSoulMode(enabled)` | β | Toggle soul mode. |
| `getStatus()` | `table` | Full status snapshot (see below). |
### `getStatus()` return shape
```lua
{
enabled = boolean,
throttle = number,
computerThrottle = number,
controlMode = string,
fuel = number,
fuelCapacity = number,
fuelType = string,
burnTimeSeconds = number,
thrust = number,
realThrust = number,
liftCapacity = number,
airflow = number,
active = boolean,
soulMode = boolean,
redstoneSignal = number,
}
```
### Example
```lua
local t = peripheral.find("thruster")
if t then
t.setControlMode("computer")
t.setEnabled(true)
t.setThrottle(0.75)
print("Real thrust:", t.getRealThrust())
end
```
---
## 2. Thruster Bearing
**Type:** `"thruster_bearing"`
Controls the bearing's pivot angle and steering mode, and manages any thrusters attached to it as a group. Most thruster methods accept either a specific thruster ID or `"all"` to target every attached thruster at once.
### Bearing control
| Method | Returns | Description |
|---|---|---|
| `getName()` / `setName(name)` | `string` / β | Custom display name. |
| `getFacing()` / `setFacing(direction)` | `string` / β | Facing direction. |
| `getPivotAngle()` | `number` (degrees) | Current pivot angle. |
| `setPivotAngle(angleDeg)` | β | Set pivot angle directly (servo/computer mode). |
| `clearPivotOverride()` | β | Remove computer pivot override. |
| `getServoInputAngle()` | `number` (degrees) | Target angle from servo input. |
| `getBearingControlMode()` | `string` | Current mode: `auto`, `redstone`, `computer`, or `servo`. |
| `setBearingControlMode(mode)` | β | Set bearing control mode. |
| `getMinAngle()` / `setMinAngle(angleDeg)` | `number` / β | Minimum allowed pivot angle. |
| `getMaxAngle()` / `setMaxAngle(angleDeg)` | `number` / β | Maximum allowed pivot angle. |
| `getForwardSignal()` | `number` | Redstone signal on forward face. |
| `getBackwardSignal()` | `number` | Redstone signal on backward face. |
### Thruster discovery
| Method | Returns | Description |
|---|---|---|
| `listThrusters()` | `table` | All attached thrusters keyed by ID (see below). |
| `getThrusterCount()` | `number` | How many thrusters are attached. |
| `getOwnedThrusters()` | `string[]` | List of thruster IDs. |
| `ids()` | `string[]` | List of thruster aliases. |
| `thrusterAlias(idOrAlias, alias)` | β | Assign an alias to a thruster for easier targeting. |
| `getNetworkInfo()` | `table` | Full network summary. |
`listThrusters()` return shape:
```lua
{
["id"] = {
alias = string,
pos = {x, y, z},
fuelType = string,
controlMode = string,
enabled = boolean,
throttle = number,
}
}
```
### Per-thruster control
All of these accept a thruster ID, an alias, or `"all"`. When `"all"` is used, read methods return a table keyed by thruster ID.
| Method | Returns |
|---|---|
| `setThrottle(id, throttle)` | β (accepts `0.0`β`1.0` or `0`β`100`) |
| `getThrottle(id)` | `number` or map |
| `getThrottleMap(id)` | always a map |
| `setEnabled(id, enabled)` | β |
| `isEnabled(id)` | `boolean` or map |
| `getFuel(id)` | `number` or map |
| `getFuelCapacity(id)` | `number` or map |
| `getFuelType(id)` | `string` or map |
| `getBurnTimeSeconds(id)` | `number` or map |
| `getControlMode(id)` | `string` or map |
| `setControlMode(id, mode)` | β (`auto`, `redstone`, or `computer`) |
| `getThrust(id)` | `number` or map |
| `getRealThrust(id)` | `number` or map |
| `getLiftCapacity(id)` | `number` or map |
| `getAirflow(id)` | `number` or map |
| `isActive(id)` | `boolean` or map |
| `isSoulMode(id)` | `boolean` or map |
| `setSoulMode(id, enabled)` | β |
| `clearThrottleOverride(id)` | β |
| `getRedstoneSignal(id)` | `number` or map |
| `getThrusterStatus(id)` | telemetry table, or map of tables for `"all"` |
### Assembly totals
| Method | Returns |
|---|---|
| `getTotalRealThrust()` | `number` |
| `getTotalLiftCapacity()` | `number` |
| `getStatus()` | Full bearing + thruster snapshot (see below) |
`getStatus()` return shape:
```lua
{
facing = string,
forwardSignal = number,
backwardSignal = number,
controlMode = string,
servoInputAngle = number,
pivotAngle = number,
targetAngle = number,
minAngle = number,
maxAngle = number,
totalRealThrust = number,
totalLiftCapacity = number,
thrusterCount = number,
thrusters = table, -- same shape as listThrusters()
}
```
### Example
```lua
local b = peripheral.find("thruster_bearing")
if b then
b.setBearingControlMode("servo")
b.setPivotAngle(22.5)
b.setThrottle("all", 80)
local net = b.getNetworkInfo()
print("Thrusters:", net.thrusterCount)
end
```
---
## 3. Smart Gearbox
**Type:** `"bidirectional_gearbox"`
The Smart Gearbox has two operating modes. In **passthrough** mode it routes two independent rotation speeds through its lanes. In **servo** mode it drives each output face to a precise angle.
### Methods
| Method | Returns | Description |
|---|---|---|
| `getMode()` / `setMode(mode)` | `string` / β | Current operating mode. |
| `isServoMode()` | `boolean` | |
| `hasGyroSource()` | `boolean` | Whether a Gyroscope Link is providing input. |
| `getLaneMode(axis)` / `setLaneMode(axis, mode)` | `string` / β | Get or set mode for a lane. Axis accepts `x`, `east_west`, `east-west`, `ew`, `z`, `north_south`, `north-south`, or `ns`. |
| `isReverseMode()` | `boolean` | |
| `getSpeed()` | `number` | |
| `getLaneSpeed(axis)` | `number` | Speed of a specific lane. |
| `getSignal(face)` | `number` | Redstone signal on a face. Accepts `north`, `south`, `east`, `west`. |
| `getFaceAngle(face)` / `setFaceAngle(face, angle)` | `number` / β | Get or set the target angle for a face. |
| `getFaceMaxAngle(face)` / `setFaceMaxAngle(face, angle)` | `number` / β | Get or set the maximum angle limit for a face. |
| `clearFaceAngle(face?)` | β | Clear the angle override for a face, or all faces if omitted. |
| `clearFaceMaxAngle(face?)` | β | Clear the max angle limit for a face, or all faces if omitted. |
| `getStatus()` | `table` | Full status snapshot (see below). |
`getStatus()` return shape:
```lua
{
servoMode = boolean,
gyroSource = boolean,
mode = string,
reverseMode = boolean,
speed = { north_south = number, east_west = number },
laneModes = { north_south = string, east_west = string },
signals = { north = number, south = number, east = number, west = number },
angles = { north = number, south = number, east = number, west = number },
maxAngles = { north = number, south = number, east = number, west = number },
}
```
### Example
```lua
local gb = peripheral.find("bidirectional_gearbox")
if gb then
gb.setMode("servo")
gb.setFaceAngle("north", 30)
gb.setFaceMaxAngle("north", 60)
end
```
---
## 4. Contraption Controller
**Type:** `"analogue_contraption_controller"`
The Contraption Controller manages named channels, each of which can be configured with different input behaviors like latching, stepping, or momentary press. Channels output a value from `0.0` to `1.0` that maps to a redstone signal strength.
### Methods
| Method | Returns | Description |
|---|---|---|
| `getName()` / `setName(name)` | `string` / β | Custom display name. |
| `listChannels()` | `string[]` | Names of all configured channels. |
| `getChannel(name)` | `table` | Current state of a channel. |
| `setChannel(name, value)` | β | Set a channel value directly. Range `0.0`β`1.0`. |
| `getChannelMode(name)` / `setChannelMode(name, mode)` | `string` / β | Get or set the channel's behavior mode. |
| `getChannelConfig(name)` | `table` | Full channel configuration. |
| `setChannelConfig(name, configTable)` | β | Update channel configuration (see keys below). |
| `press(name)` | β | Simulate pressing a channel. |
| `release(name)` | β | Simulate releasing a channel. |
| `tap(name)` | β | Simulate a quick press and release. |
| `reset(name)` | β | Reset a channel to its default state. |
| `resetAll()` | β | Reset all channels. |
| `getAxis(name)` | `table` | State of a named axis. |
| `getAllSignals()` | `table` | Current output values for all channels. |
### `setChannelConfig` keys
| Key | Type | Description |
|---|---|---|
| `mode` | `string` | Channel behavior mode. |
| `min`, `max` | `number` | Output range. |
| `riseRate`, `fallRate` | `number` | How fast the value ramps up or down. |
| `stepAmount` | `number` | Step size for step mode. |
| `deadzone`, `smoothing` | `number` | Input filtering. |
| `debounceTicks`, `repeatIntervalTicks` | `number` | Timing values (integer). |
| `resetToZero` | `boolean` | Whether to return to zero on release. |
| `repeatWhileHeld` | `boolean` | Whether to keep firing while held. |
| `value` | `number` | Sets the channel value directly. |
| `frequencyA`, `frequencyB` | `string` | Item IDs for wireless link frequencies (e.g. `"minecraft:iron_nugget"`). Blank string to clear. |
### Example
```lua
local c = peripheral.find("analogue_contraption_controller")
if c then
c.setChannelMode("throttle_up", "latch")
c.setChannel("throttle_up", 1.0)
print(textutils.serialize(c.getAllSignals()))
end
```
---
## 5. Analogue Joystick
**Type:** `"analogue_joystick"`
The joystick outputs tilt values to redstone links and can be wrapped as a peripheral for naming. For reading live tilt values in code, wrap the bound redstone links as peripherals or read their outputs via the Contraption Controller.
### Methods
| Method | Returns |
|---|---|
| `getName()` | `string` |
| `setName(name)` | β |
### Example
```lua
local j = peripheral.find("analogue_joystick")
if j then j.setName("Pilot Stick") end
```
---
## 6. Claw
**Type:** `"claw"`
The Claw grips and releases physics sub-levels. Signal strength controls grip β `15` means the claw will never drop its load, `0` means fully open. The drop chance scales with how low the signal is.
The Claw can also detect and target nearby connector blocks for precise docking.
### Methods
| Method | Returns | Description |
|---|---|---|
| `setSignal(signal)` | β | Set grip strength. Range `0`β`15`. |
| `clearSignalOverride()` | β | Remove computer signal override. |
| `open()` | β | Fully open the claw (signal 0). |
| `close()` | β | Fully close the claw (signal 15). |
| `release()` | β | Release the held sub-level. |
| `getSignal()` | `number` | Current effective signal. |
| `getComputerSignal()` | `number` | Computer override value. `-1` means no override. |
| `isHolding()` | `boolean` | Whether the claw is holding a sub-level. |
| `getHeldConnectorPos()` | `{x,y,z}` or `nil` | Position of the connector being held. |
| `getSelectedConnectorPos()` | `{x,y,z}` or `nil` | Position of the targeted connector. |
| `getNearestConnector()` | `{x,y,z}` or `nil` | Nearest connector within default range. |
| `getNearestConnectorInRange(range)` | `{x,y,z}` or `nil` | Nearest connector within a given range. |
| `getConnectorsInRange(range)` | `[{x,y,z}, ...]` | All connectors within range. |
| `getConnectorsInRangeLimited(range, limit)` | `[{x,y,z}, ...]` | All connectors within range, up to a limit. |
| `isConnectorInRange(x,y,z)` | `boolean` | Whether a connector is within default range (3). |
| `isConnectorInRangeWithRadius(x,y,z,range)` | `boolean` | Whether a connector is within a given range. |
| `selectConnector(x,y,z)` | `boolean` | Target a specific connector for gripping. |
| `clearSelectedConnector()` | β | Clear the targeted connector. |
| `getStatus()` | `table` | Full status snapshot (see below). |
`getStatus()` return shape:
```lua
{
signal = number,
computerSignal = number,
holding = boolean,
heldPos = {x=number, y=number, z=number} | nil,
selectedPos = {x=number, y=number, z=number} | nil,
}
```
### Example
```lua
local claw = peripheral.find("claw")
if claw then
local p = claw.getNearestConnectorInRange(5)
if p then claw.selectConnector(p.x, p.y, p.z) end
claw.close()
end
```
---
## 7. Rope Winch Cable (Claw passthrough)
**Type:** `"rope_winch_cable"`
Only registered when the Rope Winch has a Claw attached. Exposes the same control surface as the Claw peripheral directly, so you can control the claw through the winch cable without needing a direct connection to the claw itself. All claw methods throw `"no claw connected to this rope winch"` if the attachment is missing.
### Methods
| Method | Returns |
|---|---|
| `isConnected()` | `boolean` |
| `getRemoteType()` | `"claw"` or `"none"` |
Plus all Claw methods listed in section 6. Note that position methods return `{}` instead of `nil` when there is no result, unlike the direct Claw peripheral which returns `nil`.
### Example
```lua
local rw = peripheral.find("rope_winch_cable")
if rw and rw.isConnected() then
rw.open()
local s = rw.getStatus()
print("Holding:", s.holding)
end
```
# Create Thrusters & Things β External Compat ComputerCraft API
This document covers native ComputerCraft peripherals that this addon exposes for external Simulated and Aeronautics block entities.
## Getting Started
Wrap or find a peripheral by its type string:
```lua
local burner = peripheral.find("hot_air_burner")
if burner then
print("Signal:", burner.getSignal())
print("Gas output:", burner.getGasOutput())
end
```
Most peripherals below use a shared reflection-backed helper surface. `directional_gearshift` is the exception: it now has its own purpose-built API with gearshift-specific methods instead of the generic signal/range/color set.
## Peripherals
| Type string | External block entity id(s) | Block |
|---|---|---|
| `laser_pointer` | `simulated:laser_pointer` | Simulated Laser Pointer |
| `laser_sensor` | `simulated:laser_sensor`, `simulated:ir_sensor` | Simulated Laser Sensor |
| `analogue_transmission` | `simulated:analogue_transmission`, `simulated:simple` | Simulated Analogue Transmission |
| `redstone_accumulator` | `simulated:redstone_accumulator` | Simulated Redstone Accumulator |
| `redstone_inductor` | `simulated:redstone_inductor` | Simulated Redstone Inductor |
| `redstone_magnet` | `simulated:redstone_magnet` | Simulated Redstone Magnet |
| `optical_sensor` | `simulated:optical_sensor` | Simulated Optical Sensor |
| `docking_connector` | `simulated:docking_connector` | Simulated Docking Connector |
| `altitude_sensor` | `simulated:altitude_sensor` | Simulated Altitude Sensor |
| `hot_air_burner` | `aeronautics:adjustable_burner` | Aeronautics Hot Air Burner |
| `steam_vent` | `aeronautics:steam_vent` | Aeronautics Steam Vent |
| `mounted_potato_cannon` | `aeronautics:mounted_potato_cannon` | Aeronautics Mounted Potato Cannon |
### `directional_gearshift`
```lua
local gearshift = peripheral.find("directional_gearshift")
if gearshift then
gearshift.setOutputs(true, false)
print("Left:", gearshift.isLeftPowered(), "Right:", gearshift.isRightPowered())
end
```
| Method | Returns | Description |
|---|---|---|
| `setLeft(powered)` | β | Set the left-side gearshift input/output state. |
| `setRight(powered)` | β | Set the right-side gearshift input/output state. |
| `setOutputs(left, right)` | β | Set both left and right states together. |
| `clear()` | β | Clears both gearshift states back to off. |
| `isLeftPowered()` | `boolean` | Current left state. |
| `isRightPowered()` | `boolean` | Current right state. |
| `getRotationModifier(face)` | `number` | Returns the rotation modifier for a face name like `north`, `south`, `east`, or `west`. |
| `getStatus()` | `table` | Returns `leftPowered`, `rightPowered`, `sourceFacing`, `blockPos`, and `className`. |
`directional_gearshift` is now the recommended pattern for blocks that have distinct left/right behavior; the controller and CC layers both map to those explicit sides rather than a generic `setSignal()` call.
---
## Common Method Surface
Every non-gearshift type above exposes the methods below.
| Method | Returns | Description |
|---|---|---|
| `getName()` | `string` | Custom name if exposed by target block entity, otherwise empty string. |
| `setName(name)` | β | Sets custom name when supported. |
| `getSignal()` | `number` (`0`-`15`) | Reads signal-like value from the block entity. |
| `setSignal(signal)` | β | Writes signal-like value when writable (`0`-`15`). Throws if unsupported. |
| `isPowered()` | `boolean` | Whether block is currently powered/active. |
| `getRange()` | `number` | Laser/sensor range for compatible blocks. |
| `setRange(range)` | β | Set range for compatible blocks. Throws if unsupported. |
| `hasHit()` | `boolean` | Sensor hit status for compatible sensor blocks. |
| `getDistance()` | `number` | Hit distance / blocked distance when available; `-1` if unavailable. |
| `getColor()` | `number` | Laser color as RGB integer when available. |
| `setColor(color)` | β | Set RGB laser color (`0x000000` to `0xFFFFFF`). Throws if unsupported. |
| `isRainbow()` | `boolean` | Rainbow laser mode for compatible blocks. |
| `setRainbow(enabled)` | β | Toggle rainbow mode. Throws if unsupported. |
| `getAirPressure()` | `number` | Atmospheric pressure for altitude-capable devices; `-1` if unavailable. |
| `getWorldHeight()` | `number` | World height from block sensor API when exposed. |
| `getGasOutput()` | `number` | Gas output for burner/vent blocks; `0` if unavailable. |
| `getState()` | `string` | Machine state enum/string if present, else `"unknown"`. |
| `isBlocked()` | `boolean` | Blocked-state indicator for cannon-style devices. |
| `getBlockedLength()` | `number` | Blocked penetration distance where exposed. |
| `getFacing()` | `string` | Facing direction if available from API or block state. |
| `getPosition()` | `table` | `{ x, y, z }` block position. |
| `getClassName()` | `string` | Runtime Java class name backing this peripheral. |
| `getStatus()` | `table` | Full merged status snapshot (see below). |
| `methods()` | `string[]` | Human-readable list of method signatures. |
| `help(method?)` | `table` or `string` | Documentation map, or single method help string. |
### `getStatus()` return shape
```lua
{
type = string,
name = string,
signal = number,
powered = boolean,
range = number,
hasHit = boolean,
distance = number,
worldHeight = number,
airPressure = number,
gasOutput = number,
state = string,
facing = string,
blocked = boolean,
blockedLength = number,
color = number,
rainbow = boolean,
position = { x = number, y = number, z = number },
className = string,
}
```
---
## Block-Specific Notes
### Laser devices
`laser_pointer`, `laser_sensor`, and `optical_sensor` are the best fit for:
- `getRange()` / `setRange(range)`
- `hasHit()` / `getDistance()`
- `getColor()` / `setColor(color)`
- `isRainbow()` / `setRainbow(enabled)`
### Altitude and atmospheric devices
`altitude_sensor`, `hot_air_burner`, and `steam_vent` provide the most useful results for:
- `getWorldHeight()`
- `getAirPressure()`
- `getGasOutput()`
### Mounted Potato Cannon
`mounted_potato_cannon` is the primary user of:
- `isBlocked()`
- `getBlockedLength()`
- `getState()`
### Redstone machines
`analogue_transmission`, `redstone_accumulator`, `redstone_inductor`, and `redstone_magnet` primarily expose:
- `getSignal()`
- `isPowered()`
- `getState()`
- `getStatus()`
---
## Example Scripts
### 1) Laser Pointer Control
```lua
local p = peripheral.find("laser_pointer")
if p then
p.setSignal(15)
p.setColor(0x00FF66)
p.setRainbow(false)
print(textutils.serialize(p.getStatus()))
end
```
### 2) Altitude Monitoring
```lua
local a = peripheral.find("altitude_sensor")
if a then
while true do
print("Height:", a.getWorldHeight(), "Pressure:", a.getAirPressure())
sleep(0.5)
end
end
```
### 3) Burner + Vent Snapshot
```lua
local burner = peripheral.find("hot_air_burner")
local vent = peripheral.find("steam_vent")
if burner then print("Burner gas:", burner.getGasOutput()) end
if vent then print("Vent gas:", vent.getGasOutput()) end
```
### 4) Cannon Safety Polling
```lua
local c = peripheral.find("mounted_potato_cannon")
if c then
print("Blocked:", c.isBlocked(), "Length:", c.getBlockedLength(), "State:", c.getState())
end
```
---
## Error Behavior
Write operations that are unsupported by a specific block throw a Lua error rather than silently failing.
Examples:
- `setSignal()` on a block without writable signal fields/methods
- `setRange()` on a non-range block
- `setColor()` on a non-laser block
- `setRainbow()` on a non-rainbow block
Use `getClassName()` and `help()` in scripts to dynamically adapt behavior for mixed block fleets.