Blocks

Header lines ending with a colon that own indented children. Blocks also wrap child statements.

24 patterns

Command

command %name:EXPR%
Command
1.0.0

Declares a custom command with automatic argument parsing.

Examples
command hello: send player "Hello!"
Block Variables
NameTypeNullableDescription
playerplayerYesThe player who executed the command, or null if the console ran it
sendersenderNoThe command sender (player or console)
worldworldYesThe world the player is in, or null if the console ran it

Control Flow

if %cond:EXPR%
Control Flow
1.0.0

Conditionally executes a block of code. When used at the top level, wraps the block in a preload method that runs on script load.

Examples
on join: if player is sneaking: send player "You are sneaking!"
else if %cond:EXPR%
Control Flow
1.0.0

An alternative condition branch that follows an if or else if block.

Examples
on join: if player is sneaking: send player "You are sneaking!" else if player is sprinting: send player "You are sprinting!"
else
Control Flow
1.0.0

The fallback branch that executes when no previous if/else if matched.

Examples
on join: if player is sneaking: send player "You are sneaking!" else: send player "Nothing matched"
repeat %n:INT% [time|times]
Control Flow
1.0.0

Repeats the enclosed block a fixed number of times.

Examples
repeat 5 times: broadcast "Hello!"

Event

on %def:EXPR%
Event
1.0.0

Declares a block that listens for a Bukkit events.

Examples
on join: send player "Welcome!"

Inventory

register inventory [named] %name:STRING%
Inventory
1.0.0

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.

Examples
register inventory "test_menu": set gui to new inventory "test_menu" with size 54 titled "<gold>Test Menu"
Block Variables
NameTypeNullableDescription
playerplayerNoThe target player who the inventory is being opened for
worldworldNoThe world the player is in
slot %slot:INT% click [in|of] %inv:EXPR%
Inventory
1.0.0

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.

Examples
slot 11 click in "main_menu": message player "You clicked the info button!"
Block Variables
NameTypeNullableDescription
playerplayerNoThe player who clicked
worldworldNoThe world the player is in
inventoryinventoryNoThe top inventory being interacted with
click [in|of] %inv:EXPR%
Inventory
1.0.0

Handles any click in a Lumen inventory. The event is automatically cancelled. Provides player, inventory, slot, item, cursor, clickType, action, and title variables.

Examples
click in "main_menu": cancel event
Block Variables
NameTypeNullableDescription
playerplayerNoThe player who clicked
worldworldNoThe world the player is in
inventoryinventoryNoThe top inventory being interacted with
close [of] %inv:EXPR%
Inventory
1.0.0

Handles the close event of a Lumen inventory. Provides player, inventory, and title variables.

Examples
close of "main_menu": message player "Menu closed!"
Block Variables
NameTypeNullableDescription
playerplayerNoThe player who closed the inventory
worldworldNoThe world the player is in
inventoryinventoryNoThe top inventory that was closed
open [of] %inv:EXPR%
Inventory
1.0.0

Handles the open event of a Lumen inventory. Provides player, inventory, and title variables.

Examples
open of "main_menu": message player "Menu opened!"
Block Variables
NameTypeNullableDescription
playerplayerNoThe player who opened the inventory
worldworldNoThe world the player is in
inventoryinventoryNoThe top inventory that was opened

Lifecycle

load
Lifecycle
1.0.0

Declares a block that runs when the script is loaded (plugin enable).

Examples
load: broadcast "Script fully loaded!"
preload
Lifecycle
1.0.0

Declares a block that runs before other load blocks during startup.

Examples
preload: broadcast "Loading..."

List

loop %var:EXPR% in %list:LIST%
List
1.0.0

Iterates over each element in a list.

Examples
loop item in myList: broadcast item
Block Variables
NameTypeNullableDescription
varstringNoThe 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%
List
1.0.0

Iterates over each element of a scoped global list for a specific scope reference.

Examples
loop item in todos for player:
Block Variables
NameTypeNullableDescription
varstringNoThe current element in the list