Skip to content
Redwire Docs
v1.0.0.0
Redwireclient.com
Docs /REFERENCE /Script Block Reference

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

BlockWhat it doesFields
On Script StartFires once, the moment you press Start. The simplest way to begin a script.

Network

BlockWhat it doesFields
OnConnectFires when you finish joining a server
OnDisconnectFires when you leave a server, however you left it
OnDimensionFires when you change dimension — through a portal, or by being teleportedDimension Filter — only fire for this dimension
OnWorldFires when you change worldWorld Filter — only fire for this world
OnChatFires when a chat message arrivesContains 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.

BlockWhat it doesFields
OnPacketSentFires when your client sends a packetPacket — which C2S packet types to watch (multi-select)
OnPacketReceiveFires when your client receives onePacket — which S2C packet types to watch
OnPacketInterceptFires when the Packet Interceptor catches onePacket — which types
OnQueueFlushFires when the packet queue is flushed
OnQueueClearFires when the packet queue is cleared

Player

BlockWhat it doesFields
OnHealthFires when your health changesMode (Increase / Decrease / Any Change), Change Amount — only fire for a change of at least this much
OnHungerFires when your hunger changesMode, Change Amount
OnExperienceFires when your experience changesMode, Change Amount
OnStatusEffectFires when you gain or lose a potion effectMode (Added / Removed), Status Effect — which effects to watch (multi-select)
OnDeathFires when you dieDeath Reason — only fire for deaths whose message contains this
OnRespawnFires when you respawn
OnDamageFires when you take damage
OnAttackFires when you attack an entity

GUI

“GUI” means any container screen — a chest, a shop menu, an anvil.

BlockWhat it doesFields
OnGUIOpenFires when a GUI opensGUI Title — only fire for a GUI with this title
OnGUICloseFires when a GUI closesGUI Title
OnGUIStateFires when anything about a GUI changesGUI Title
OnSlotChangeFires when a slot’s contents changeSlot Number — only watch this slot
OnItemInFires when an item appears in a GUIInventory Only (tick to watch your inventory rather than the container), Item ID — only this item
OnItemOutFires when an item leaves a GUIInventory Only, Item ID

World

BlockWhat it doesFields
OnSoundFires when a sound playsSound ID — only this sound
OnChunkStateFires when a chunk loads or unloadsState (Load / Unload)
OnEntitySpawnFires when an entity appears near youEntity ID — only this entity type
OnWeatherFires when the weather changesWeather (Clear / Rain / Thunder)
OnBlockFires when a block changesBlock ID — only this block type
OnCatchFires when your fishing bobber catches something

Input

BlockWhat it doesFields
OnKeyFires when you press a keyKey (required)
OnMouseFires when you clickMouse Button (Left / Right / Middle / Button 4 / Button 5)
OnScrollFires 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

BlockWhat it doesFields
RotateTurns the player’s headPitch (required) — up/down. Yaw (required) — left/right. Smoothness — 0 snaps instantly, higher eases into it
Look at BlockTurns to face the nearest block of a typeBlock ID (required), Search Radius (default 16), Smoothness
Look at EntityTurns to face an entityEntity ID (required), Entity Name — narrow it to a named entity, Search Radius (default 16), Smoothness
SneakStarts or stops sneakingMode (Enable / Disable), Hold Sneak — keep holding rather than toggling
JumpJumpsMode (Tap / Hold), Duration, Unit
SprintStarts or stops sprintingMode (Enable / Disable)
MoveWalks in a directionDirection (Forward / Backward / Left / Right), Duration (required), Unit
MouseClicks or holds a mouse buttonButton (Left / Right), Mode (Click / Hold), Duration, Unit
KeyPresses or holds a keyKey (required), Mode (Press / Hold), Duration, Unit
Use ItemUses whatever you are holding — right-click
Break BlockBreaks the block you are looking atBlock 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 BlockPlaces a block where you are lookingBlock ID (required)
InteractRight-clicks the block or entity you are looking atType (Entity / Block), Entity or Block ID, Mode (Interact / Shift-Click)

Rotate needs a pitch and a yaw. Pitch is up and down: -90 is straight up, 0 is level, 90 is straight down. Yaw is the compass direction: 0 is south, 90 is west, 180 is north, -90 is east.

Network

BlockWhat it doesFields
Send MessageSays something in chat. Begin it with / and it runs as a commandMessage Contents (required)
DisconnectLeaves the server
Connect to ServerJoins a serverServer 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.

BlockWhat it doesFields
Click SlotClicks a slotSlot Number (required), Method (Left Click / Right Click / Shift-Click / Double Click / Drop / Drop Stack)
Swap SlotSwaps two slots’ contentsSlot 1 (required), Slot 2 (required)
Select Hotbar SlotChanges your held itemHotbar Slot (required) — 1 to 9
Drop ItemDrops an itemItem Name or Item ID (one is needed), Drop Amount, Inventory Only
Equip ItemMoves an item into your handItem Name or Item ID (one is needed)
Move to OffhandMoves an item into your off-handItem Name or Item ID, Slot Number
Store ItemMoves an item from your inventory into the open containerItem Name or Item ID, Amount
Loot ItemMoves an item from the open container into your inventoryItem Name or Item ID, Amount
Craft ItemCrafts somethingItem ID (required), Amount, Where (Crafting Table / Crafting Grid)
Brew PotionBrews a potionPotion (required), Amount (1–3)
Open InventoryOpens your inventory
Close GUICloses the open screenPacket (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.

BlockWhat it doesFields
Toggle InterceptorTurns the Packet Interceptor on or offPackets to Intercept — also set the catch list
Clear QueueEmpties the packet queueClear Specific — clear only these types, rather than everything
Flush QueueSends everything in the queueFlush Specific — flush only these types
Save GUISaves the open GUI’s state
Load GUIRestores the saved GUI state
Desync GUIDe-syncs the open GUI

Script

BlockWhat it doesFields
DelayWaits before continuingDelay Amount (required), Unit
RepeatLoops the blocks wired to its Loop output. Has two outputs: Loop runs each pass, After Loop runs once when the loop is doneAmount — how many passes. Infinite Loop — tick to loop until the script is stopped
End ScriptStops 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

BlockQuestionFields
Is VariableDoes a wired variable match a value?Variable (required), Value (required), Compare (At / Below / Above)
Has Status EffectDoes the player have an effect?Status Effect — leave empty for “any effect”
Is MovingIs the player moving?
Is SprintingIs the player sprinting?
Is SwimmingIs the player swimming?
Is SneakingIs the player sneaking?
Is RidingIs the player riding an entity?
Is BurningIs the player on fire?
Is AliveIs the player alive?
Has CooldownIs the attack cooldown still running?
Is Inventory FullIs the inventory full?
Is Inventory OpenedIs the inventory screen open?
Is GUI OpenedIs any screen open?
Is Container FullIs the open container full?
Inventory Has ItemIs this item in the inventory?Item ID (required)
Slot Has ItemDoes this slot hold an item?Slot Number (required), Item ID — a specific item rather than any
GUI Has ItemIs this item anywhere in the open GUI?Item ID (required)
Hotbar Has ItemIs this item in the hotbar?Item ID (required)

Compare: At / Below / AboveAt means equal to, Below means less than, Above means greater than.

Wait For

BlockWaits untilFields
Wait For VariableA wired variable reaches a valueVariable (required), Value (required), Compare (At / Below / Above)
Wait For PacketA packet of this type arrivesPacket Name (required)
Wait For SoundThis sound playsSound ID
Wait For Game TickThe 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

BlockGives youOutputs
PositionWhere the player isX, Y, Z
RotationWhich way the player is facingPitch, Yaw
HealthCurrent healthHealth
HungerCurrent hungerHunger, Saturation
ExperienceCurrent XPExperience, Level
Status EffectActive effectsStatus Effect, Duration
DimensionThe dimension you are inDimension
WorldThe world you are inWorld
Held ItemWhat you are holdingItem Name, Item ID, Amount
Selected SlotWhat is in a slot. Slot Number (required)Item Name, Item ID, Amount
Targeted BlockThe block you are looking atBlock ID
Targeted EntityThe entity you are looking atEntity Type, Name
GUIThe open screen’s nameGUI Name
Latest Chat MessageThe most recent chat lineContents
Light LevelLight where you are standingSky Light Level, Block Light Level

Set, Increment and Decrement

BlockWhat it doesFieldsOutputs
SetA fixed value — text or a number — to feed into other blocks. No flow wiresInput (required)Value
IncrementA counter that goes up by Step each time the script’s flow reaches itStep (required), default 1Value
DecrementThe same, going downStep (required), default 1Value

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.