Events
Events that fire when a game event happens, like a player joining. Use 'on <event>:' to listen for these in your scripts.
Block
on block_placeFires when a player places a block.
playerPlayerNoThe player who placed the blockblockBlockNoThe block that was placeditemItemStackNoThe item that was used to place the blockon block_place:Entity
on entity_deathFires when an entity dies.
entityEntityNoThe entity that diedkillerPlayerYesThe player who killed the entity, or null if not killed by a playeron entity_death:on entity_interactFires when a player right-clicks an entity.
playerPlayerNoThe player who right clicked the entityentityEntityNoThe entity that was right clickeditemItemStackYesThe item in the player's main hand, or null if emptyon entity_interact:on entity_damage_by_entityFires when an entity takes damage from another entity.
entityEntityNoThe entity that took damagedamagerEntityNoThe entity that dealt the damagedamagerPlayerPlayerYesThe player who dealt the damage, or null if the damager is not a playeron entity_damage_by_entity:on projectile_launchFires when a projectile is launched (arrows, snowballs, eggs, etc.).
entityEntityNoThe projectile entity that was launchedshooterPlayerYesThe player who launched the projectile, or null if not launched by a playeron projectile_launch:on entity_spawnFires when a creature spawns in the world.
entityEntityNoThe entity that spawnedlocationLocationNoThe location where the entity spawnedon entity_spawn:on projectile_hitFires when a projectile hits a block or entity.
entityEntityNoThe projectile entityshooterPlayerYesThe player who shot the projectile, or null if not shot by a playerhit_entityEntityYesThe entity that was hit, or null if a block was hiton projectile_hit:Inventory
on inventory_dragFires when a player drags items across slots in an inventory.
playerPlayerYesThe player who dragged items, or null if the dragger is not a player (unlikely)inventoryInventoryNoThe top inventory being viewednameStringYesThe Lumen inventory name, or null if not a Lumen inventoryon inventory_drag:on inventory_openFires when a player opens an inventory.
playerPlayerYesThe player who opened the inventory, or null if the viewer is not a player (unlikely)inventoryInventoryNoThe top inventory that was openednameStringYesThe Lumen inventory name, or null if not a Lumen inventoryon inventory_open:on inventory_closeFires when a player closes an inventory.
playerPlayerYesThe player who closed the inventory, or null if the viewer is not a player (unlikely)inventoryInventoryNoThe top inventory that was closednameStringYesThe Lumen inventory name, or null if not a Lumen inventoryon inventory_close:Player
on respawnFires when a player respawns after dying.
playerPlayerNoThe player who respawnedrespawnLocationLocationNoThe location where the player will respawnon respawn:on moveFires when a player moves.
playerPlayerNoThe player who movedfromLocationNoThe location the player moved fromtoLocationNoThe location the player moved toon move:on teleportFires when a player teleports.
playerPlayerNoThe player who teleportedfromLocationNoThe location the player teleported fromtoLocationNoThe location the player teleported toon teleport:on interactFires when a player interacts with a block or air.
playerPlayerNoThe player who interactedactionStringNoThe action type: LEFT_CLICK_BLOCK, RIGHT_CLICK_BLOCK, LEFT_CLICK_AIR, RIGHT_CLICK_AIR, or PHYSICAL (triggering a block by stepping on or colliding with it, such as pressure plates or farmland).blockBlockYesThe block involved in the interaction, or null if the action targets airon interact:on interact:
if action is "LEFT_CLICK_BLOCK":
message player "You left clicked a block!"on interact:
if action is "RIGHT_CLICK_BLOCK":
message player "You right clicked a block!"
else if action is "LEFT_CLICK_AIR":
message player "You left clicked in the air!"on toggle_flightFires when a player toggles flight mode.
playerPlayerNoThe player who toggled flightflyingbooleanNoWhether the player is now flyingon toggle_flight: