Blocks
Header lines ending with a colon that own indented children. Blocks also wrap child statements.
Command
command %name:EXPR%Declares a custom command with automatic argument parsing.
command hello:
send player "Hello!"playerplayerYesThe player who executed the command, or null if the console ran itsendersenderNoThe command sender (player or console)worldworldYesThe world the player is in, or null if the console ran itControl Flow
if %cond:EXPR%Conditionally executes a block of code. When used at the top level, wraps the block in a preload method that runs on script load.
on join:
if player is sneaking:
send player "You are sneaking!"else if %cond:EXPR%An alternative condition branch that follows an if or else if block.
on join:
if player is sneaking:
send player "You are sneaking!"
else if player is sprinting:
send player "You are sprinting!"elseThe fallback branch that executes when no previous if/else if matched.
on join:
if player is sneaking:
send player "You are sneaking!"
else:
send player "Nothing matched"repeat %n:INT% [time|times]Repeats the enclosed block a fixed number of times.
repeat 5 times:
broadcast "Hello!"Event
on %def:EXPR%Declares a block that listens for a Bukkit events.
on join:
send player "Welcome!"Inventory
register inventory [named] %name:STRING%Declares a named inventory builder that can be opened from any script using 'open inventory named "..." for player'. The 'player' variable is available inside the block and represents the target player.
register inventory "test_menu":
set gui to new inventory "test_menu" with size 54 titled "<gold>Test Menu"playerplayerNoThe target player who the inventory is being opened forworldworldNoThe world the player is inslot %slot:INT% click [in|of] %inv:EXPR%Handles a click on a specific slot in a Lumen inventory. The event is automatically cancelled. Provides player, inventory, slot, item, cursor, clickType, action, and title variables.
slot 11 click in "main_menu":
message player "You clicked the info button!"playerplayerNoThe player who clickedworldworldNoThe world the player is ininventoryinventoryNoThe top inventory being interacted withclick [in|of] %inv:EXPR%Handles any click in a Lumen inventory. The event is automatically cancelled. Provides player, inventory, slot, item, cursor, clickType, action, and title variables.
click in "main_menu":
cancel eventplayerplayerNoThe player who clickedworldworldNoThe world the player is ininventoryinventoryNoThe top inventory being interacted withclose [of] %inv:EXPR%Handles the close event of a Lumen inventory. Provides player, inventory, and title variables.
close of "main_menu":
message player "Menu closed!"playerplayerNoThe player who closed the inventoryworldworldNoThe world the player is ininventoryinventoryNoThe top inventory that was closedopen [of] %inv:EXPR%Handles the open event of a Lumen inventory. Provides player, inventory, and title variables.
open of "main_menu":
message player "Menu opened!"playerplayerNoThe player who opened the inventoryworldworldNoThe world the player is ininventoryinventoryNoThe top inventory that was openedLifecycle
loadDeclares a block that runs when the script is loaded (plugin enable).
load:
broadcast "Script fully loaded!"preloadDeclares a block that runs before other load blocks during startup.
preload:
broadcast "Loading..."List
loop %var:EXPR% in %list:LIST%Iterates over each element in a list.
loop item in myList:
broadcast itemvarstringNoThe current element in the list, named by the user (e.g. 'item' in 'loop item in myList'). The type depends on the list being looped over and is accurate at runtime.loop %var:EXPR% in %list:LIST% for %scope:EXPR%Iterates over each element of a scoped global list for a specific scope reference.
loop item in todos for player:varstringNoThe current element in the list