Triggers when any entity takes damage from any source. This fires very often on a busy server, so keep the block short and test the cause or victim first.
Values, example and try-it box
Also written:on hit:
Can be cancelled: Yes
player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobody
Placeholder
Short form
Type
Meaning
%event.attacker%
attacker
text
Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling
%event.victim%
victim
text
Who was hurt: a player's name or a mob type
%event.damage%
damage
number
Damage actually taken, after armour and effects; 2 is one heart
%event.cause%
cause
text
Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on
%event.entity%
entity
text
The victim's entity type, e.g. player or zombie
%event.location%
location
Where the victim is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on entity damage:
if event.cause is "FALL":
if player has permission "hyperscript.nofall":
cancel event
send action bar "&aFall damage negated!" to victim
Try it: click a value to add a line that uses it
on entity damage:
# click a value above
eventon player jump:example
Triggers when a player jumps.
Values, example and try-it box
Can be cancelled: Yes. The player is snapped back to where they were, so a small hop may be visible
player is: The jumping player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%player.world%
text
World the player is in
%player.location%
location
Where the player is standing
%event.location%
location
Where the jump started
x of player's location
number
The x of %player.location%, as a number
y of player's location
number
The y of %player.location%, as a number: how high it is
z of player's location
number
The z of %player.location%, as a number
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player jump:
if {%player%.frozen} is true:
cancel event
send action bar "&cYou cannot jump while frozen!" to player
Try it: click a value to add a line that uses it
on player jump:
# click a value above
eventon player chat:example
Triggers when a player sends a chat message.
Values, example and try-it box
Can be cancelled: Yes
player is: The sender
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.message%
message
text
The text of the message
%event.recipients%
list
Names of the players who will see it
on player chat:
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to player
Try it: click a value to add a line that uses it
on player chat:
# click a value above
eventon block break:example
Triggers when a player breaks a block.
Values, example and try-it box
Can be cancelled: Yes
player is: The player breaking the block
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.block%
block
text
The block type, e.g. diamond_ore
%event.location%
location
Where the block is
%event.drops%
list
The items the block will drop with the tool in the player's hand
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on block break:
if block is "diamond_ore":
broadcast "&b%player.name% found diamonds! Drops: %event.drops%"
Try it: click a value to add a line that uses it
on block break:
# click a value above
eventon mob spawn:example
Triggers when a mob or other living creature spawns. This fires very often; test the reason or entity first.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.entity%
entity
text
The type of creature, e.g. zombie
%event.reason%
reason
text
Why it spawned: NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on
%event.location%
location
Where it spawns
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on mob spawn:
if entity is "phantom" and reason is "NATURAL":
cancel event
Try it: click a value to add a line that uses it
on mob spawn:
# click a value above
eventon inventory click:example
Triggers when a player clicks in any inventory window, including chests, their own inventory and GUIs opened by scripts.
Values, example and try-it box
Can be cancelled: Yes. The click then moves nothing
player is: The player who clicked
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.slot%
slot
number
The slot clicked, counting from 1 at the top left of the window, the same numbering open gui uses. Unset for a click outside the window
%event.item%
item
text
The type of item in that slot; unset if it is empty
%event.click_type%
text
How it was clicked: LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, MIDDLE, DROP and so on
on inventory click:
if item is "barrier" and event.click_type is "SHIFT_LEFT":
cancel event
send "&cThat item cannot be moved." to player
Try it: click a value to add a line that uses it
on inventory click:
# click a value above
eventon server ping:example
Triggers when a client refreshes its server list, before anyone has logged in. This is where the MOTD, player counts and icon shown in that list can be changed. It fires very often and off the server thread, so keep the block short.
Values, example and try-it box
Can be cancelled: No
player is: Nobody: the client has not logged in, so only its address is known
Placeholder
Short form
Type
Meaning
%event.address%
text
The IP address of the client asking
%server.motd%
text
The MOTD from server.properties
%server.online_players%
number
Players online right now
%server.max_players%
number
The real player limit
on server ping:
set motd to "&6My Server &7- &a%server.online_players% online\n&eDouble coins weekend!"
set max players to 100
Try it: click a value to add a line that uses it
on server ping:
# click a value above
eventon left click:example
Triggers when a player left-clicks air or a block with their main hand.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who clicked
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The type of item in the player's hand; unset if empty
%event.block%
block
text
The block clicked; unset when clicking air
on left click:
if item is "stick":
send "&7Poke."
Try it: click a value to add a line that uses it
on left click:
# click a value above
eventon player sneak:example
Triggers when a player starts sneaking.
Values, example and try-it box
Can be cancelled: Yes
player is: The player sneaking
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player sneak:
send action bar "&7Sneaking..." to player
Try it: click a value to add a line that uses it
on player sneak:
# click a value above
eventon player sprint:example
Triggers when a player starts sprinting.
Values, example and try-it box
Can be cancelled: Yes
player is: The player sprinting
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player sprint:
add 1 to {%player%.sprints}
Try it: click a value to add a line that uses it
on player sprint:
# click a value above
eventon player swim:example
Triggers when a player starts swimming.
Values, example and try-it box
Can be cancelled: Yes
player is: The player swimming
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player swim:
apply night vision to player for 30 seconds
Try it: click a value to add a line that uses it
on player swim:
# click a value above
eventon flight toggle:example
Triggers when a player starts or stops flying.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on flight toggle:
if player does not have permission "fly.use":
cancel event
Try it: click a value to add a line that uses it
on flight toggle:
# click a value above
eventon hand swap:example
Triggers when a player swaps the items in their two hands.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on hand swap:
cancel event
send "&7Hands are locked here."
Try it: click a value to add a line that uses it
on hand swap:
# click a value above
eventon slot change:example
Triggers when a player selects another hotbar slot.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.slot%
slot
number
The hotbar slot now selected, 1 to 9
%event.item%
item
text
The type of item in that slot; unset if empty
on slot change:
if item is "compass":
send action bar "&bRight-click to open the menu" to player
Try it: click a value to add a line that uses it
on slot change:
# click a value above
eventon item break:example
Triggers when a tool or piece of armour wears out and breaks.
Values, example and try-it box
Can be cancelled: No
player is: The player whose item broke
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The type of item that broke
on item break:
send "&cYour %event.item% broke!"
Try it: click a value to add a line that uses it
on item break:
# click a value above
eventon book edit:example
Triggers when a player writes in or signs a book.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on book edit:
log "%player.name% edited a book"
Try it: click a value to add a line that uses it
on book edit:
# click a value above
eventon gamemode change:example
Triggers when a player's game mode is about to change.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.gamemode%
text
The mode being changed to: survival, creative, adventure or spectator
on gamemode change:
if event.gamemode is "creative" and player does not have permission "build.creative":
cancel event
Try it: click a value to add a line that uses it
on gamemode change:
# click a value above
eventon hunger change:example
Triggers when a player's hunger bar changes.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.amount%
amount
number
The new hunger level, 0 to 20
on hunger change:
if region at player's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on hunger change:
# click a value above
eventon player heal:example
Triggers when a player regains health.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.amount%
amount
number
How much health is regained; 2 is one heart
%event.reason%
reason
text
SATIATED, REGEN, MAGIC, EATING and so on
on player heal:
if {%player%.in_combat}:
cancel event
Try it: click a value to add a line that uses it
on player heal:
# click a value above
eventon experience gain:example
Triggers when a player gains experience points.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.amount%
amount
number
How many points were gained
on experience gain:
add amount to {%player%.total_xp}
Try it: click a value to add a line that uses it
on experience gain:
# click a value above
eventon effect gained:example
Triggers when a player gets a potion effect.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.effect%
text
The effect, e.g. speed or poison
on effect gained:
if event.effect is "poison" and player has permission "vip.immune":
cancel event
Try it: click a value to add a line that uses it
on effect gained:
# click a value above
eventon effect ended:example
Triggers when a potion effect on a player ends or is removed.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.effect%
text
The effect that ended
on effect ended:
send action bar "&7%event.effect% wore off" to player
Try it: click a value to add a line that uses it
on effect ended:
# click a value above
eventon player kick:example
Triggers when a player is about to be kicked.
Values, example and try-it box
Can be cancelled: Yes
player is: The player being kicked
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.reason%
reason
text
The reason given
on player kick:
log "%player.name% was kicked: %event.reason%"
Try it: click a value to add a line that uses it
on player kick:
# click a value above
eventon advancement:example
Triggers when a player completes an advancement. Unlocking a recipe does not count.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.advancement%
text
The advancement's id, e.g. story/mine_diamond
on advancement:
if event.advancement is "story/mine_diamond":
broadcast "&b%player.name% found diamonds!"
Try it: click a value to add a line that uses it
on advancement:
# click a value above
eventon player kill:example
Triggers when one player kills another.
Values, example and try-it box
Can be cancelled: No
player is: The player who made the kill
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.victim%
victim
text
The name of the player who died
%event.location%
location
Where the victim died
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player kill:
add 1 to {%player%.kills}
add 1 to {%victim%.deaths}
send "&aYou defeated &f%event.victim%"
Try it: click a value to add a line that uses it
on player kill:
# click a value above
eventon projectile shoot:example
Triggers when a player shoots or throws something: an arrow, a snowball, a trident.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who shot
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
What was shot, e.g. arrow or snowball
on projectile shoot:
if entity is "ender_pearl" and {%player%.in_combat}:
cancel event
Try it: click a value to add a line that uses it
on projectile shoot:
# click a value above
eventon projectile hit:example
Triggers when something a player shot lands, on a block or on a creature.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who shot it
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
What was shot, e.g. arrow
%event.victim%
victim
text
Who or what was hit: a player's name or a mob type; unset for a block
%event.location%
location
Where it landed
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on projectile hit:
if entity is "snowball" and victim is set:
send "&bSplat! You hit %event.victim%"
Try it: click a value to add a line that uses it
on projectile hit:
# click a value above
eventon totem use:example
Triggers when a totem of undying saves a player.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who was saved
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on totem use:
broadcast "&6%player.name% cheated death!"
Try it: click a value to add a line that uses it
on totem use:
# click a value above
eventon block burn:example
Triggers when fire destroys a block.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The block being burnt
%event.location%
location
Where the block is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on block burn:
if region at event's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on block burn:
# click a value above
eventon explosion:example
Triggers when something explodes: a creeper, TNT, a bed in the Nether.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.entity%
entity
text
What exploded, e.g. creeper or primed_tnt
%event.location%
location
Where it exploded
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on explosion:
if entity is "creeper":
cancel event
Try it: click a value to add a line that uses it
on explosion:
# click a value above
eventon leaves decay:example
Triggers when leaves disappear because their tree is gone.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The kind of leaves
%event.location%
location
Where they are
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on leaves decay:
if region at event's location contains "park":
cancel event
Try it: click a value to add a line that uses it
on leaves decay:
# click a value above
eventon redstone:example
Triggers when the redstone power of a block changes: a lamp, a wire, a repeater, a pressure plate.
Values, example and try-it box
Can be cancelled: No
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The block whose power changed
%event.power%
number
The power it has now, 0 to 15
%event.location%
location
Where the block is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on redstone:
if event.block is "redstone_lamp":
if event.power > 0:
log "A lamp was lit at %event's location%"
Try it: click a value to add a line that uses it
on redstone:
# click a value above
eventon piston extend:example
Triggers when a piston pushes out.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The piston: piston or sticky_piston
%event.location%
location
Where the piston is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on piston extend:
if region at event's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on piston extend:
# click a value above
eventon piston retract:example
Triggers when a piston pulls back.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The piston: piston or sticky_piston
%event.location%
location
Where the piston is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on piston retract:
if region at event's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on piston retract:
# click a value above
eventon dispense:example
Triggers when a dispenser or dropper puts out an item.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The block: dispenser or dropper
%event.item%
item
text
What it puts out
%event.location%
location
Where the block is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on dispense:
if event.item is "tnt":
cancel event
Try it: click a value to add a line that uses it
on dispense:
# click a value above
eventon hopper move:example
Triggers when a hopper, dropper or other block moves an item from one container to another.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.item%
item
text
The item that is moved
%event.location%
location
Where it is going
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on hopper move:
if event.item is "diamond":
cancel event
Try it: click a value to add a line that uses it
on hopper move:
# click a value above
eventon crop grow:example
Triggers when a crop or plant grows a stage.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.block%
block
text
The plant, e.g. wheat
%event.location%
location
Where it is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on crop grow:
if {season} is "winter":
cancel event
Try it: click a value to add a line that uses it
on crop grow:
# click a value above
eventon bucket fill:example
Triggers when a player scoops something up with a bucket.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The bucket being used
on bucket fill:
if region at player's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on bucket fill:
# click a value above
eventon bucket empty:example
Triggers when a player pours a bucket out.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The bucket being emptied, e.g. lava_bucket
on bucket empty:
if item is "lava_bucket" and player does not have permission "build.lava":
cancel event
send "&cLava is not allowed."
Try it: click a value to add a line that uses it
on bucket empty:
# click a value above
eventon weather change:example
Triggers when rain starts or stops in a world.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.weather%
text
What it is changing to: rain or clear
on weather change:
if event.weather is "rain":
cancel event
Try it: click a value to add a line that uses it
on weather change:
# click a value above
eventon entity tame:example
Triggers when a player tames an animal.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who tamed it
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
The animal, e.g. wolf
on entity tame:
send "&aYou tamed a %event.entity%!"
Try it: click a value to add a line that uses it
on entity tame:
# click a value above
eventon entity breed:example
Triggers when two animals have a baby.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who fed them, if a player did
Placeholder
Short form
Type
Meaning
%event.entity%
entity
text
The kind of baby, e.g. cow
on entity breed:
if player is set:
add 1 to {%player%.animals_bred}
Try it: click a value to add a line that uses it
on entity breed:
# click a value above
eventon shear:example
Triggers when a player shears a sheep or another shearable creature.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
What was sheared, e.g. sheep
on shear:
add 1 to {%player%.sheep_sheared}
Try it: click a value to add a line that uses it
on shear:
# click a value above
eventon mob target:example
Triggers when a mob picks a player as its target.
Values, example and try-it box
Can be cancelled: Yes
player is: The player being targeted
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
The mob, e.g. zombie
on mob target:
if player is vanished:
cancel event
Try it: click a value to add a line that uses it
on mob target:
# click a value above
eventon player move:example
Triggers when a player walks, falls or is pushed into another block. Turning the head or shuffling inside one block does not count. It still runs very often, so keep its block short.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on player move:
if block at (location below player's location) is "magma_block":
send action bar "&cHot!" to player
Try it: click a value to add a line that uses it
on player move:
# click a value above
eventon portal use:example
Triggers when a player is about to go through a nether or end portal.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on portal use:
if {%player%.level} < 10:
cancel event
send "&cReach level 10 before leaving the overworld."
Try it: click a value to add a line that uses it
on portal use:
# click a value above
eventon bed leave:example
Triggers when a player gets out of a bed.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on bed leave:
send "&eGood morning, %player.name%!"
Try it: click a value to add a line that uses it
on bed leave:
# click a value above
eventon item damage:example
Triggers when a tool, weapon or piece of armour a player is using loses durability.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on item damage:
if player has permission "tools.unbreaking":
cancel event
Try it: click a value to add a line that uses it
on item damage:
# click a value above
eventon harvest:example
Triggers when a player picks something from a block without breaking it, such as berries from a sweet berry bush.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on harvest:
add 1 to {%player%.harvests}
Try it: click a value to add a line that uses it
on harvest:
# click a value above
eventon glide toggle:example
Triggers when a player starts or stops gliding with an elytra.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on glide toggle:
if region at player's location contains "spawn":
cancel event
Try it: click a value to add a line that uses it
on glide toggle:
# click a value above
eventon entity mount:example
Triggers when a player gets onto a horse, pig, strider or any other creature or vehicle.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on entity mount:
send action bar "&7Sneak to get off" to player
Try it: click a value to add a line that uses it
on entity mount:
# click a value above
eventon entity dismount:example
Triggers when a player gets off whatever they were riding.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on entity dismount:
add 1 to {%player%.rides}
Try it: click a value to add a line that uses it
on entity dismount:
# click a value above
eventon vehicle enter:example
Triggers when a player gets into a boat, minecart or other vehicle.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
The vehicle, e.g. boat or minecart
on vehicle enter:
send action bar "&7Hold on tight" to player
Try it: click a value to add a line that uses it
on vehicle enter:
# click a value above
eventon vehicle exit:example
Triggers when a player gets out of a vehicle.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
The vehicle
on vehicle exit:
log "%player.name% left a %event.entity%"
Try it: click a value to add a line that uses it
on vehicle exit:
# click a value above
eventon inventory open:example
Triggers when a player opens a chest, furnace or any other container.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.inventory%
text
The kind of container: chest, furnace, anvil and so on
%event.location%
location
Where the container stands; unset for one that stands nowhere, such as an ender chest or a menu a script opened
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on inventory open:
if event.inventory is "ender_chest" and {%player%.in_combat}:
cancel event
Try it: click a value to add a line that uses it
on inventory open:
# click a value above
eventon inventory close:example
Triggers when a player closes a container or their own inventory.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.inventory%
text
The kind of container that was open
on inventory close:
delete {%player%.shop_page}
Try it: click a value to add a line that uses it
on inventory close:
# click a value above
eventon enchant item:example
Triggers when a player enchants an item at an enchanting table.
Values, example and try-it box
Can be cancelled: Yes
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The item being enchanted
%event.level%
number
How many levels it costs
on enchant item:
add 1 to {%player%.enchants}
Try it: click a value to add a line that uses it
on enchant item:
# click a value above
eventon furnace smelt:example
Triggers when a furnace finishes smelting one item.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.item%
item
text
What comes out, e.g. iron_ingot
%event.location%
location
Where the furnace is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on furnace smelt:
add 1 to {smelted.%event.item%}
Try it: click a value to add a line that uses it
on furnace smelt:
# click a value above
eventon console command:example
Triggers when a command is run from the console.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.command%
command
text
The command without the slash, in lower case
%event.message%
message
text
The whole line
on console command:
if command is "stop":
broadcast "&cThe server is shutting down."
Try it: click a value to add a line that uses it
on console command:
# click a value above
eventon shield block:example
Triggers when a player's raised shield takes a blow completely.
Values, example and try-it box
Can be cancelled: No
player is: The player holding the shield
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.attacker%
attacker
text
Who struck: a player's name or a mob type
on shield block:
play sound "item.shield.block" with pitch 0.8 and volume 1.0 at player's location
add 1 to {%player%.blocks_made}
Try it: click a value to add a line that uses it
on shield block:
# click a value above
eventon anvil use:example
Triggers when a player takes the finished item out of an anvil.
Values, example and try-it box
Can be cancelled: Yes
player is: The player using the anvil
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The item being taken out
on anvil use:
if item is "name_tag" and player does not have permission "anvil.nametags":
cancel event
send "&cYou cannot rename name tags here."
Try it: click a value to add a line that uses it
on anvil use:
# click a value above
eventon villager trade:example
Triggers when a player takes the goods out of a trade with a villager or wandering trader.
Values, example and try-it box
Can be cancelled: Yes
player is: The player trading
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
What the player is buying
on villager trade:
add 1 to {%player%.trades}
if item is "emerald":
send action bar "&aA fine deal" to player
Try it: click a value to add a line that uses it
on villager trade:
# click a value above
eventon first join:example
Triggers when someone joins who has never played on the server before. 'on player join' runs for them as well.
Values, example and try-it box
Can be cancelled: No
player is: The new player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%player.world%
text
World the player is in
%player.location%
location
Where the player is standing
x of player's location
number
The x of %player.location%, as a number
y of player's location
number
The y of %player.location%, as a number: how high it is
z of player's location
number
The z of %player.location%, as a number
on first join:
give 16 bread to player
broadcast "&6Welcome &e%player.name% &6to the server!"
Try it: click a value to add a line that uses it
on first join:
# click a value above
eventon player join:example
Triggers when a player joins the server.
Values, example and try-it box
Can be cancelled: No
player is: The player who joined
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%player.world%
text
World the player is in
%player.location%
location
Where the player is standing
x of player's location
number
The x of %player.location%, as a number
y of player's location
number
The y of %player.location%, as a number: how high it is
z of player's location
number
The z of %player.location%, as a number
on player join:
send "&aWelcome, %player.name%!" to player
Try it: click a value to add a line that uses it
on player join:
# click a value above
eventon player quit:example
Triggers when a player leaves the server.
Values, example and try-it box
Can be cancelled: No
player is: The player who left
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on player quit:
log "%player.name% left"
Try it: click a value to add a line that uses it
on player quit:
# click a value above
eventon block place:example
Triggers when a player places a block.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who placed it
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.block%
block
text
The block type placed, e.g. tnt
%event.location%
location
Where the block was placed
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on block place:
if block is "tnt" and player does not have permission "build.tnt":
cancel event
send "&cTNT is not allowed here."
Try it: click a value to add a line that uses it
on block place:
# click a value above
eventon sign change:example
Triggers when a player finishes writing on a sign.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who wrote the sign
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.lines%
list
The lines of text, top to bottom
%event.block%
block
text
The kind of sign, e.g. oak_sign
%event.location%
location
Where the sign is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on sign change:
if item 1 of event.lines is "[Shop]":
send "&aShop sign created."
Try it: click a value to add a line that uses it
on sign change:
# click a value above
eventon player teleport:example
Triggers when a player is about to be teleported, by a command, a plugin, an ender pearl or a portal.
Values, example and try-it box
Can be cancelled: Yes
player is: The player being teleported
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.cause%
cause
text
COMMAND, PLUGIN, ENDER_PEARL, NETHER_PORTAL and so on
%event.location%
location
Where the player is going
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player teleport:
if cause is "ENDER_PEARL" and region at event's location contains "spawn":
cancel event
send "&cNo pearling into spawn."
Try it: click a value to add a line that uses it
on player teleport:
# click a value above
eventon entity click:example
Triggers when a player right-clicks a mob, an animal, another player or any other entity.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who clicked
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.entity%
entity
text
The type clicked, e.g. villager or player
%event.clicked%
text
A player's name if a player was clicked, otherwise the type
%event.location%
location
Where the clicked entity is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on entity click:
if entity is "player":
send "&7That is &f%event.clicked%&7."
Try it: click a value to add a line that uses it
on entity click:
# click a value above
eventon craft:example
Triggers when a player takes the result out of a crafting grid.
Values, example and try-it box
Can be cancelled: Yes
player is: The player crafting
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The item being crafted, e.g. diamond_sword
%event.amount%
amount
number
How many one craft makes
on craft:
if item is "diamond_sword" and level of player < 10:
cancel event
send "&cYou need level 10 to craft that."
Try it: click a value to add a line that uses it
on craft:
# click a value above
eventon consume:example
Triggers when a player finishes eating or drinking something.
Values, example and try-it box
Can be cancelled: Yes
player is: The player eating or drinking
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
What was eaten or drunk, e.g. golden_apple
on consume:
if item is "golden_apple":
apply speed 2 to player for 10 seconds
Try it: click a value to add a line that uses it
on consume:
# click a value above
eventon fish:example
Triggers when a player reels in a catch.
Values, example and try-it box
Can be cancelled: Yes
player is: The player fishing
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
What was caught, e.g. cod
%event.amount%
amount
number
How many
on fish:
add 1 to {%player%.fish_caught}
send action bar "&bCatch #%{%player%.fish_caught}%: %event.item%" to player
Try it: click a value to add a line that uses it
on fish:
# click a value above
eventon level up:example
Triggers when a player's experience level goes up.
Values, example and try-it box
Can be cancelled: No
player is: The player who levelled up
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.level%
number
The level just reached
%event.old_level%
number
The level before
on level up:
if event.level % 10 == 0:
broadcast "&6%player.name% reached level %event.level%!"
Try it: click a value to add a line that uses it
on level up:
# click a value above
eventon bed enter:example
Triggers when a player gets into a bed.
Values, example and try-it box
Can be cancelled: Yes
player is: The player going to bed
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the bed is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on bed enter:
set {%player%.bed} to event's location
send "&7Sleep well."
Try it: click a value to add a line that uses it
on bed enter:
# click a value above
eventon combat start:example
Triggers when a player gets into a fight: they hit another player or were hit by one, or a script put them in combat. Not again for every hit while the fight lasts.
Values, example and try-it box
Can be cancelled: No
player is: The player who is now in combat
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.opponent%
text
The name of the other player; unset when a script started it
on combat start:
send action bar "&cIn combat" to player while player is in combat
Try it: click a value to add a line that uses it
on combat start:
# click a value above
eventon combat end:example
Triggers when a player's fight is over: nobody has hit them, and they have hit nobody, for the time 'combat-time' in config.yml gives (15 seconds unless changed).
Values, example and try-it box
Can be cancelled: No
player is: The player who is out of combat again
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on combat end:
send "&aYou are out of combat."
Try it: click a value to add a line that uses it
on combat end:
# click a value above
eventon afk:example
Triggers when a player has done nothing for the time 'afk-time' in config.yml gives (5 minutes unless changed): not moved, looked around, clicked, chatted or run a command.
Values, example and try-it box
Can be cancelled: No
player is: The player who is away
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on afk:
broadcast "&7%player.name% is away."
Try it: click a value to add a line that uses it
on afk:
# click a value above
eventon afk return:example
Triggers when a player who was away does something again.
Values, example and try-it box
Can be cancelled: No
player is: The player who is back
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on afk return:
broadcast "&7%player.name% is back."
Try it: click a value to add a line that uses it
on afk return:
# click a value above
eventon blocked word:example
Triggers when a player writes a word in chat that was blocked with 'block word'. The message has been starred or kept back by then, as 'word-filter' in config.yml says.
Values, example and try-it box
Can be cancelled: No
player is: The player who wrote it
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.word%
text
The blocked word that was found
%event.message%
text
What the player wrote, as they wrote it
on blocked word:
add 1 to {%player%.warnings}
if {%player%.warnings} >= 3:
mute player for 10 minutes because "language"
Try it: click a value to add a line that uses it
on blocked word:
# click a value above
eventon brew:example
Triggers when a brewing stand finishes brewing. There is no player: it is the stand that brews.
Values, example and try-it box
Can be cancelled: Yes
player is: Nobody
Placeholder
Short form
Type
Meaning
%event.location%
location
Where the brewing stand is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on brew:
spawn particle "witch" count 20 at event.location
Try it: click a value to add a line that uses it
on brew:
# click a value above
eventon kill streak:example
Triggers each time a player kills another player, with how many they have killed in a row since they last died.
Values, example and try-it box
Can be cancelled: No
player is: The player who made the kill
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.streak%
number
How many kills in a row this is: 1 for the first
%event.opponent%
text
The name of the player who was killed
on kill streak:
if event.streak is 5:
broadcast "&6%player.name% is on a killing spree!"
Try it: click a value to add a line that uses it
on kill streak:
# click a value above
eventon region enter:example
Triggers when a player walks, falls or teleports into a region made with 'create region'.
Values, example and try-it box
Can be cancelled: No
player is: The player who entered
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.region%
text
The name of the region entered
%event.location%
location
Where the player now is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on region enter:
if event.region is "spawn":
send title "&aSpawn" with subtitle "&7You are safe here" to player
Try it: click a value to add a line that uses it
on region enter:
# click a value above
eventon region leave:example
Triggers when a player leaves a region made with 'create region'.
Values, example and try-it box
Can be cancelled: No
player is: The player who left
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.region%
text
The name of the region left
%event.location%
location
Where the player now is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on region leave:
if event.region is "spawn":
send action bar "&cYou left the safe zone" to player
Try it: click a value to add a line that uses it
on region leave:
# click a value above
eventon player login:example
Triggers while someone is logging in, before they are in the game. 'refuse login because <text>' turns them away with that message.
Values, example and try-it box
Can be cancelled: With 'refuse login'
player is: Nobody yet: 'player' is unset, but {%player%.<name>} is already the variables of whoever is logging in
Placeholder
Short form
Type
Meaning
%event.name%
text
The name of the player logging in
%event.uuid%
text
Their account id
%event.address%
text
The address they are connecting from
on player login:
if {%player%.muted_until} > server.time:
set {_left} to duration({%player%.muted_until} - server.time)
refuse login because "&cYou may join again in %{_left}%."
Try it: click a value to add a line that uses it
on player login:
# click a value above
eventon player death:example
Triggers when a player dies. The death message can be rewritten with 'set death message to' or removed with 'hide death message'.
Values, example and try-it box
Can be cancelled: Paper only
player is: The player who died
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.message%
message
text
The death message everyone will see
%event.killer%
killer
text
Name of the player who made the kill; unset if none
%event.cause%
cause
text
What killed the player: FALL, LAVA, ENTITY_ATTACK and so on
%event.location%
location
Where the player died
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player death:
set {%player%.death_place} to event's location
if killer is set:
set death message to "&c%player.name% &7was defeated by &c%event.killer%"
Try it: click a value to add a line that uses it
on player death:
# click a value above
eventon player respawn:example
Triggers when a player comes back to life after dying.
Values, example and try-it box
Can be cancelled: No
player is: The player who respawned
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.location%
location
Where the player is about to appear
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player respawn:
wait 1 tick
give player 1 bread
send "&7Here is something to eat."
Try it: click a value to add a line that uses it
on player respawn:
# click a value above
eventon item pickup:example
Triggers when a player picks an item up off the ground.
Values, example and try-it box
Can be cancelled: Yes
player is: The player picking the item up
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The type of item, e.g. diamond
%event.amount%
amount
number
How many items are in the stack
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on item pickup:
if item is "diamond":
add amount to {%player%.diamonds_found}
Try it: click a value to add a line that uses it
on item pickup:
# click a value above
eventon item drop:example
Triggers when a player drops an item out of their inventory.
Values, example and try-it box
Can be cancelled: Yes
player is: The player dropping the item
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The type of item, e.g. diamond
%event.amount%
amount
number
How many items are in the stack
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on item drop:
if item is "compass":
cancel event
send "&cYou cannot drop your compass."
Try it: click a value to add a line that uses it
on item drop:
# click a value above
eventon world change:example
Triggers when a player has arrived in another world, through a portal or a teleport.
Values, example and try-it box
Can be cancelled: No
player is: The player who changed world
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%player.world%
text
World the player is in
%event.from%
text
The name of the world the player left
%event.location%
location
Where the player is now
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on world change:
send "&7You left &f%event.from% &7for &f%player.world%"
Try it: click a value to add a line that uses it
on world change:
# click a value above
eventon player command:example
Triggers when a player types any command, before the server runs it. Cancelling it stops the command.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who typed the command
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.command%
command
text
The command without the slash, in lower case: home
%event.message%
message
text
The whole line as typed: /home set base
%event.location%
location
Where the player is
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on player command:
if command is "plugins" and player does not have permission "server.admin":
cancel event
send "&cThat command is not available."
Try it: click a value to add a line that uses it
on player command:
# click a value above
eventon entity death:example
Triggers when any living entity dies.
Values, example and try-it box
Can be cancelled: Paper only
player is: The killer, if a player made the kill; otherwise nobody
Placeholder
Short form
Type
Meaning
%event.entity%
entity
text
The type of entity that died
%event.killer%
killer
text
Name of the player who made the kill; unset if none
on entity death:
if killer is set:
send "&6You slew a %event.entity%" to player
Try it: click a value to add a line that uses it
on entity death:
# click a value above
eventon right click:example
Triggers when a player right-clicks air or a block, with either hand. Not when they are looking at a creature or another player that is in reach: that is 'on entity click'.
Values, example and try-it box
Can be cancelled: Yes
player is: The player who clicked
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
%event.item%
item
text
The type of item in the player's hand; unset if empty
%event.block%
block
text
The block clicked; unset when clicking air
%event.location%
location
Where the clicked block is; unset when clicking air
x of event's location
number
The x of %event.location%, as a number
y of event's location
number
The y of %event.location%, as a number: how high it is
z of event's location
number
The z of %event.location%, as a number
on right click:
if item is "compass":
send "&bYou are in %player.world%" to player
Try it: click a value to add a line that uses it
on right click:
# click a value above
eventon resource pack accept:example
Triggers when a player agrees to download a resource pack.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on resource pack accept:
send action bar "&aDownloading server resource pack..." to player
Try it: click a value to add a line that uses it
on resource pack accept:
# click a value above
eventon resource pack decline:example
Triggers when a player refuses a resource pack.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on resource pack decline:
send "&cSome custom items may look wrong without the pack." to player
Try it: click a value to add a line that uses it
on resource pack decline:
# click a value above
eventon resource pack successfully loaded:example
Triggers when a player's game has finished applying a resource pack.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on resource pack successfully loaded:
send "&aResource pack loaded!" to player
Try it: click a value to add a line that uses it
on resource pack successfully loaded:
# click a value above
eventon resource pack failed:example
Triggers when a resource pack could not be downloaded or applied.
Values, example and try-it box
Can be cancelled: No
player is: The player
Placeholder
Short form
Type
Meaning
%player%
player
player
The player the event is about; use it wherever a player is expected
on resource pack failed:
send "&cThe resource pack failed to load." to player