8. Script Block Reference
Every block you can place in a script. This is a look-up page — read Scripts first for how blocks and wires actually work.
Conventions used below:
- Fields marked required must be filled in or the block does nothing.
- Fields not marked are optional; leaving one empty usually means “any” or “the default”.
- Any text or number field can have a Variable wired into it instead of a typed value.
- Unit fields choose between Ticks (20 per second, in step with the game) and Milliseconds (1000 per second, real time).
Jump to: Events · Actions · Conditionals · Variables
8.1 Events (orange)
Events start a script. They have an outgoing flow wire and no incoming one. Every script needs at least one.
Most events have a filter field. Leave it empty and the event fires every time; fill it in and it only fires when the filter matches.
Script
| Block | What it does | Fields |
|---|---|---|
| On Script Start | Fires once, the moment you press Start. The simplest way to begin a script. | — |
Network
| Block | What it does | Fields |
|---|---|---|
| OnConnect | Fires when you finish joining a server | — |
| OnDisconnect | Fires when you leave a server, however you left it | — |
| OnDimension | Fires when you change dimension — through a portal, or by being teleported | Dimension Filter — only fire for this dimension |
| OnWorld | Fires when you change world | World Filter — only fire for this world |
| OnChat | Fires when a chat message arrives | Contains String — only fire for messages containing this text |
OnDisconnect fires after the connection has already gone, so anything downstream of it runs with no player and no world. That is the point — it is what lets a script tidy up, or wait and reconnect. A new script comes with OnDisconnect → End Script already wired, which is what makes the ordinary script stop when you leave. See Scripts §7.6.
Packet
These tie scripts to the Packet Tools.
| Block | What it does | Fields |
|---|---|---|
| OnPacketSent | Fires when your client sends a packet | Packet — which C2S packet types to watch (multi-select) |
| OnPacketReceive | Fires when your client receives one | Packet — which S2C packet types to watch |
| OnPacketIntercept | Fires when the Packet Interceptor catches one | Packet — which types |
| OnQueueFlush | Fires when the packet queue is flushed | — |
| OnQueueClear | Fires when the packet queue is cleared | — |
Player
| Block | What it does | Fields |
|---|---|---|
| OnHealth | Fires when your health changes | Mode (Increase / Decrease / Any Change), Change Amount — only fire for a change of at least this much |
| OnHunger | Fires when your hunger changes | Mode, Change Amount |
| OnExperience | Fires when your experience changes | Mode, Change Amount |
| OnStatusEffect | Fires when you gain or lose a potion effect | Mode (Added / Removed), Status Effect — which effects to watch (multi-select) |
| OnDeath | Fires when you die | Death Reason — only fire for deaths whose message contains this |
| OnRespawn | Fires when you respawn | — |
| OnDamage | Fires when you take damage | — |
| OnAttack | Fires when you attack an entity | — |
GUI
“GUI” means any container screen — a chest, a shop menu, an anvil.
| Block | What it does | Fields |
|---|---|---|
| OnGUIOpen | Fires when a GUI opens | GUI Title — only fire for a GUI with this title |
| OnGUIClose | Fires when a GUI closes | GUI Title |
| OnGUIState | Fires when anything about a GUI changes | GUI Title |
| OnSlotChange | Fires when a slot’s contents change | Slot Number — only watch this slot |
| OnItemIn | Fires when an item appears in a GUI | Inventory Only (tick to watch your inventory rather than the container), Item ID — only this item |
| OnItemOut | Fires when an item leaves a GUI | Inventory Only, Item ID |
World
| Block | What it does | Fields |
|---|---|---|
| OnSound | Fires when a sound plays | Sound ID — only this sound |
| OnChunkState | Fires when a chunk loads or unloads | State (Load / Unload) |
| OnEntitySpawn | Fires when an entity appears near you | Entity ID — only this entity type |
| OnWeather | Fires when the weather changes | Weather (Clear / Rain / Thunder) |
| OnBlock | Fires when a block changes | Block ID — only this block type |
| OnCatch | Fires when your fishing bobber catches something | — |
Input
| Block | What it does | Fields |
|---|---|---|
| OnKey | Fires when you press a key | Key (required) |
| OnMouse | Fires when you click | Mouse Button (Left / Right / Middle / Button 4 / Button 5) |
| OnScroll | Fires when you scroll the wheel | — |
8.2 Actions (red)
Actions are the things that happen. Each has one incoming flow wire and one outgoing one, except where noted.
Player
| Block | What it does | Fields |
|---|---|---|
| Rotate | Turns the player’s head | Pitch (required) — up/down. Yaw (required) — left/right. Smoothness — 0 snaps instantly, higher eases into it |
| Look at Block | Turns to face the nearest block of a type | Block ID (required), Search Radius (default 16), Smoothness |
| Look at Entity | Turns to face an entity | Entity ID (required), Entity Name — narrow it to a named entity, Search Radius (default 16), Smoothness |
| Sneak | Starts or stops sneaking | Mode (Enable / Disable), Hold Sneak — keep holding rather than toggling |
| Jump | Jumps | Mode (Tap / Hold), Duration, Unit |
| Sprint | Starts or stops sprinting | Mode (Enable / Disable) |
| Move | Walks in a direction | Direction (Forward / Backward / Left / Right), Duration (required), Unit |
| Mouse | Clicks or holds a mouse button | Button (Left / Right), Mode (Click / Hold), Duration, Unit |
| Key | Presses or holds a key | Key (required), Mode (Press / Hold), Duration, Unit |
| Use Item | Uses whatever you are holding — right-click | — |
| Break Block | Breaks the block you are looking at | Block ID — leave empty to break whatever it is. Max Duration (default 260) — give up after this many ticks, so an unbreakable block does not stall the script |
| Place Block | Places a block where you are looking | Block ID (required) |
| Interact | Right-clicks the block or entity you are looking at | Type (Entity / Block), Entity or Block ID, Mode (Interact / Shift-Click) |
Rotate needs a pitch and a yaw. Pitch is up and down:
-90is straight up,0is level,90is straight down. Yaw is the compass direction:0is south,90is west,180is north,-90is east.
Network
| Block | What it does | Fields |
|---|---|---|
| Send Message | Says something in chat. Begin it with / and it runs as a command | Message Contents (required) |
| Disconnect | Leaves the server | — |
| Connect to Server | Joins a server | Server IP (required) |
GUI
Slot numbers are the game’s own numbering for the open screen. The in-game overlay shows the number of whichever slot you hover, which is the easiest way to find the one you want.
| Block | What it does | Fields |
|---|---|---|
| Click Slot | Clicks a slot | Slot Number (required), Method (Left Click / Right Click / Shift-Click / Double Click / Drop / Drop Stack) |
| Swap Slot | Swaps two slots’ contents | Slot 1 (required), Slot 2 (required) |
| Select Hotbar Slot | Changes your held item | Hotbar Slot (required) — 1 to 9 |
| Drop Item | Drops an item | Item Name or Item ID (one is needed), Drop Amount, Inventory Only |
| Equip Item | Moves an item into your hand | Item Name or Item ID (one is needed) |
| Move to Offhand | Moves an item into your off-hand | Item Name or Item ID, Slot Number |
| Store Item | Moves an item from your inventory into the open container | Item Name or Item ID, Amount |
| Loot Item | Moves an item from the open container into your inventory | Item Name or Item ID, Amount |
| Craft Item | Crafts something | Item ID (required), Amount, Where (Crafting Table / Crafting Grid) |
| Brew Potion | Brews a potion | Potion (required), Amount (1–3) |
| Open Inventory | Opens your inventory | — |
| Close GUI | Closes the open screen | Packet (With Packet / Without Packet) |
Close GUI → Without Packet closes the screen on your end while the server still believes it is open. This is the same trick the overlay’s Close w/o Packet button uses. See The In-Game Overlay.
Item Name versus Item ID. Item ID is the game’s internal name (
diamond_sword) picked from a dropdown. Item Name is the display name an item is actually showing, which is how you target a renamed or server-specific item. Blocks that accept both need at least one of them.
Redwire
These drive Redwire’s own Packet Tools from inside a script.
| Block | What it does | Fields |
|---|---|---|
| Toggle Interceptor | Turns the Packet Interceptor on or off | Packets to Intercept — also set the catch list |
| Clear Queue | Empties the packet queue | Clear Specific — clear only these types, rather than everything |
| Flush Queue | Sends everything in the queue | Flush Specific — flush only these types |
| Save GUI | Saves the open GUI’s state | — |
| Load GUI | Restores the saved GUI state | — |
| Desync GUI | De-syncs the open GUI | — |
Script
| Block | What it does | Fields |
|---|---|---|
| Delay | Waits before continuing | Delay Amount (required), Unit |
| Repeat | Loops the blocks wired to its Loop output. Has two outputs: Loop runs each pass, After Loop runs once when the loop is done | Amount — how many passes. Infinite Loop — tick to loop until the script is stopped |
| End Script | Stops the whole script immediately, every branch at once. Has no outgoing wire | — |
8.3 Conditionals (blue)
Conditionals ask a question. There are two shapes:
- If / Else blocks have two outputs — True and False. The script continues down whichever matches, right now, and never waits.
- Wait For blocks have one output and pause until their condition becomes true.
If / Else
| Block | Question | Fields |
|---|---|---|
| Is Variable | Does a wired variable match a value? | Variable (required), Value (required), Compare (At / Below / Above) |
| Has Status Effect | Does the player have an effect? | Status Effect — leave empty for “any effect” |
| Is Moving | Is the player moving? | — |
| Is Sprinting | Is the player sprinting? | — |
| Is Swimming | Is the player swimming? | — |
| Is Sneaking | Is the player sneaking? | — |
| Is Riding | Is the player riding an entity? | — |
| Is Burning | Is the player on fire? | — |
| Is Alive | Is the player alive? | — |
| Has Cooldown | Is the attack cooldown still running? | — |
| Is Inventory Full | Is the inventory full? | — |
| Is Inventory Opened | Is the inventory screen open? | — |
| Is GUI Opened | Is any screen open? | — |
| Is Container Full | Is the open container full? | — |
| Inventory Has Item | Is this item in the inventory? | Item ID (required) |
| Slot Has Item | Does this slot hold an item? | Slot Number (required), Item ID — a specific item rather than any |
| GUI Has Item | Is this item anywhere in the open GUI? | Item ID (required) |
| Hotbar Has Item | Is this item in the hotbar? | Item ID (required) |
Compare: At / Below / Above —
Atmeans equal to,Belowmeans less than,Abovemeans greater than.
Wait For
| Block | Waits until | Fields |
|---|---|---|
| Wait For Variable | A wired variable reaches a value | Variable (required), Value (required), Compare (At / Below / Above) |
| Wait For Packet | A packet of this type arrives | Packet Name (required) |
| Wait For Sound | This sound plays | Sound ID |
| Wait For Game Tick | The next game tick. A one-tick pause | — |
8.4 Variables (purple)
Variables supply values. They have round data outputs on the right, which you wire into another block’s field.
The Get blocks also have flow wires. That is intentional and gives you two ways to use them:
- Wired but not in the flow — the value is read live, at the moment it is needed.
- Placed in the flow — the value is captured at that point in the script and held.
Get
| Block | Gives you | Outputs |
|---|---|---|
| Position | Where the player is | X, Y, Z |
| Rotation | Which way the player is facing | Pitch, Yaw |
| Health | Current health | Health |
| Hunger | Current hunger | Hunger, Saturation |
| Experience | Current XP | Experience, Level |
| Status Effect | Active effects | Status Effect, Duration |
| Dimension | The dimension you are in | Dimension |
| World | The world you are in | World |
| Held Item | What you are holding | Item Name, Item ID, Amount |
| Selected Slot | What is in a slot. Slot Number (required) | Item Name, Item ID, Amount |
| Targeted Block | The block you are looking at | Block ID |
| Targeted Entity | The entity you are looking at | Entity Type, Name |
| GUI | The open screen’s name | GUI Name |
| Latest Chat Message | The most recent chat line | Contents |
| Light Level | Light where you are standing | Sky Light Level, Block Light Level |
Set, Increment and Decrement
| Block | What it does | Fields | Outputs |
|---|---|---|---|
| Set | A fixed value — text or a number — to feed into other blocks. No flow wires | Input (required) | Value |
| Increment | A counter that goes up by Step each time the script’s flow reaches it | Step (required), default 1 | Value |
| Decrement | The same, going down | Step (required), default 1 | Value |
Increment and Decrement are counters, not calculations. Place one in the flow and its value changes each time the script passes through it. Wire its Value output into a field and into an Is Variable conditional, and you have a loop that does something a set number of times with a number that grows.