Events
Events are triggers that start your script when something happens in the game.
- on join: Triggers when a player joins the server
- on quit: Triggers when a player leaves the server
- on death: Triggers when a player dies
- on break: Triggers when a block is broken
- on place: Triggers when a block is placed
- on chat: Triggers when a player sends a chat message
- on right click: Triggers when a player right clicks
Conditions
Conditions check if something is true or false before executing code.
- if <condition>: Executes if condition is true
- player has permission: Checks if player has a permission
- player is op: Checks if player is an operator
- block is: Checks block type
Effects
Effects are actions that do something in the game.
- send: Sends a message to a player
- broadcast: Sends a message to all players
- give: Gives an item to a player
- teleport: Teleports a player to a location
- set: Sets a variable or property
- execute command: Runs a command as a player or console
Variables
Variables store values for later use.
- {_variable}: Local variable (only in current trigger)
- {variable}: Global variable (across all scripts)
- set {var} to value: Assign a value to a variable
- add value to {var}: Add to a variable
- delete {var}: Delete a variable
Loops
Loops repeat code multiple times.
- loop all players: Loop through all online players
- loop blocks: Loop through blocks in a region
- loop-player: Current player in a loop
- loop-value: Current value in a loop