HyperScript
Docs

← All of the Docs Commands and events

Events reference

eventon entity damage:

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
PlaceholderShort formTypeMeaning
%event.attacker%attackertextWho 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%victimtextWho was hurt: a player's name or a mob type
%event.damage%damagenumberDamage actually taken, after armour and effects; 2 is one heart
%event.cause%causetextWhy: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on
%event.entity%entitytextThe victim's entity type, e.g. player or zombie
%event.location%locationWhere the victim is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%player.world%textWorld the player is in
%player.location%locationWhere the player is standing
%event.location%locationWhere the jump started
x of player's locationnumberThe x of %player.location%, as a number
y of player's locationnumberThe y of %player.location%, as a number: how high it is
z of player's locationnumberThe z of %player.location%, as a number
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player sends a chat message.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The sender
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.message%messagetextThe text of the message
%event.recipients%listNames 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:

Triggers when a player breaks a block.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player breaking the block
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.block%blocktextThe block type, e.g. diamond_ore
%event.location%locationWhere the block is
%event.drops%listThe items the block will drop with the tool in the player's hand
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.entity%entitytextThe type of creature, e.g. zombie
%event.reason%reasontextWhy it spawned: NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on
%event.location%locationWhere it spawns
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.slot%slotnumberThe 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%itemtextThe type of item in that slot; unset if it is empty
%event.click_type%textHow 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:

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
PlaceholderShort formTypeMeaning
%event.address%textThe IP address of the client asking
%server.motd%textThe MOTD from server.properties
%server.online_players%numberPlayers online right now
%server.max_players%numberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe type of item in the player's hand; unset if empty
%event.block%blocktextThe 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:

Triggers when a player starts sneaking.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player sneaking
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player starts sprinting.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player sprinting
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player starts swimming.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player swimming
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player starts or stops flying.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

Triggers when a player selects another hotbar slot.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.slot%slotnumberThe hotbar slot now selected, 1 to 9
%event.item%itemtextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe 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:

Triggers when a player writes in or signs a book.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.gamemode%textThe 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:

Triggers when a player's hunger bar changes.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.amount%amountnumberThe 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:

Triggers when a player regains health.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.amount%amountnumberHow much health is regained; 2 is one heart
%event.reason%reasontextSATIATED, 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:

Triggers when a player gains experience points.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.amount%amountnumberHow 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:

Triggers when a player gets a potion effect.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.effect%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.effect%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.reason%reasontextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.advancement%textThe 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:

Triggers when one player kills another.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player who made the kill
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.victim%victimtextThe name of the player who died
%event.location%locationWhere the victim died
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextWhat 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextWhat was shot, e.g. arrow
%event.victim%victimtextWho or what was hit: a player's name or a mob type; unset for a block
%event.location%locationWhere it landed
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when fire destroys a block.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe block being burnt
%event.location%locationWhere the block is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.entity%entitytextWhat exploded, e.g. creeper or primed_tnt
%event.location%locationWhere it exploded
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when leaves disappear because their tree is gone.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe kind of leaves
%event.location%locationWhere they are
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.block%blocktextThe block whose power changed
%event.power%numberThe power it has now, 0 to 15
%event.location%locationWhere the block is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a piston pushes out.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe piston: piston or sticky_piston
%event.location%locationWhere the piston is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a piston pulls back.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe piston: piston or sticky_piston
%event.location%locationWhere the piston is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a dispenser or dropper puts out an item.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe block: dispenser or dropper
%event.item%itemtextWhat it puts out
%event.location%locationWhere the block is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.item%itemtextThe item that is moved
%event.location%locationWhere it is going
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a crop or plant grows a stage.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.block%blocktextThe plant, e.g. wheat
%event.location%locationWhere it is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player scoops something up with a bucket.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe 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:

Triggers when a player pours a bucket out.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe 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:

Triggers when rain starts or stops in a world.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.weather%textWhat 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:

Triggers when a player tames an animal.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player who tamed it
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextThe 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:

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
PlaceholderShort formTypeMeaning
%event.entity%entitytextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextWhat 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

Triggers when a player gets out of a bed.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

Triggers when a player gets off whatever they were riding.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextThe 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:

Triggers when a player gets out of a vehicle.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.inventory%textThe kind of container: chest, furnace, anvil and so on
%event.location%locationWhere the container stands; unset for one that stands nowhere, such as an ender chest or a menu a script opened
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.inventory%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe item being enchanted
%event.level%numberHow 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:

Triggers when a furnace finishes smelting one item.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.item%itemtextWhat comes out, e.g. iron_ingot
%event.location%locationWhere the furnace is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a command is run from the console.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: Nobody
PlaceholderShort formTypeMeaning
%event.command%commandtextThe command without the slash, in lower case
%event.message%messagetextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.attacker%attackertextWho 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextWhat 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%player.world%textWorld the player is in
%player.location%locationWhere the player is standing
x of player's locationnumberThe x of %player.location%, as a number
y of player's locationnumberThe y of %player.location%, as a number: how high it is
z of player's locationnumberThe 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:

Triggers when a player joins the server.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player who joined
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%player.world%textWorld the player is in
%player.location%locationWhere the player is standing
x of player's locationnumberThe x of %player.location%, as a number
y of player's locationnumberThe y of %player.location%, as a number: how high it is
z of player's locationnumberThe 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:

Triggers when a player leaves the server.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player who left
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

Triggers when a player places a block.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player who placed it
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.block%blocktextThe block type placed, e.g. tnt
%event.location%locationWhere the block was placed
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.lines%listThe lines of text, top to bottom
%event.block%blocktextThe kind of sign, e.g. oak_sign
%event.location%locationWhere the sign is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.cause%causetextCOMMAND, PLUGIN, ENDER_PEARL, NETHER_PORTAL and so on
%event.location%locationWhere the player is going
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.entity%entitytextThe type clicked, e.g. villager or player
%event.clicked%textA player's name if a player was clicked, otherwise the type
%event.location%locationWhere the clicked entity is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe item being crafted, e.g. diamond_sword
%event.amount%amountnumberHow 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextWhat 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:

Triggers when a player reels in a catch.

Values, example and try-it box
  • Can be cancelled: Yes
  • player is: The player fishing
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextWhat was caught, e.g. cod
%event.amount%amountnumberHow 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.level%numberThe level just reached
%event.old_level%numberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the bed is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.opponent%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.word%textThe blocked word that was found
%event.message%textWhat 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:

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
PlaceholderShort formTypeMeaning
%event.location%locationWhere the brewing stand is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.streak%numberHow many kills in a row this is: 1 for the first
%event.opponent%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.region%textThe name of the region entered
%event.location%locationWhere the player now is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.region%textThe name of the region left
%event.location%locationWhere the player now is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.name%textThe name of the player logging in
%event.uuid%textTheir account id
%event.address%textThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.message%messagetextThe death message everyone will see
%event.killer%killertextName of the player who made the kill; unset if none
%event.cause%causetextWhat killed the player: FALL, LAVA, ENTITY_ATTACK and so on
%event.location%locationWhere the player died
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.location%locationWhere the player is about to appear
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe type of item, e.g. diamond
%event.amount%amountnumberHow many items are in the stack
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe type of item, e.g. diamond
%event.amount%amountnumberHow many items are in the stack
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%player.world%textWorld the player is in
%event.from%textThe name of the world the player left
%event.location%locationWhere the player is now
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.command%commandtextThe command without the slash, in lower case: home
%event.message%messagetextThe whole line as typed: /home set base
%event.location%locationWhere the player is
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

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
PlaceholderShort formTypeMeaning
%event.entity%entitytextThe type of entity that died
%event.killer%killertextName 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe player the event is about; use it wherever a player is expected
%event.item%itemtextThe type of item in the player's hand; unset if empty
%event.block%blocktextThe block clicked; unset when clicking air
%event.location%locationWhere the clicked block is; unset when clicking air
x of event's locationnumberThe x of %event.location%, as a number
y of event's locationnumberThe y of %event.location%, as a number: how high it is
z of event's locationnumberThe 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:

Triggers when a player agrees to download a resource pack.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

Triggers when a player refuses a resource pack.

Values, example and try-it box
  • Can be cancelled: No
  • player is: The player
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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:

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
PlaceholderShort formTypeMeaning
%player%playerplayerThe 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
Try it: click a value to add a line that uses it
on resource pack failed:
    # click a value above