Note:
You can specify the event priority after each event syntax using the following syntax [with priority (lowest|low|normal|high|highest|monitor)]
e.g. on spawn with priority lowest
.
Note that not all of the events support event priority feature and they will throw an error.
Patterns: | |
Since: | 1.3.4 |
Examples:
at 7am in "world"
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper |
Note: this does not include anvil damage from falling.
Examples:
cancel the event
Patterns: |
|
Since: | 2.7 |
Examples:
event-item is set # result item
chance of 5%:
set repair cost to repair cost * 50%
send "You're LUCKY! You got 50% discount." to player
Patterns: |
|
Since: | 2.2-dev21 |
Examples:
Patterns: |
|
Since: | 2.5.1 |
Examples:
send "You swung your arm!"
Patterns: |
|
Since: | 2.5 |
Requirements: | Paper |
Examples:
send "You equipped %event-item%!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.9.0 |
Requirements: | Spigot 1.19.4+ |
Examples:
send "<red>Raiders are nearby!" to all players in radius 32 around event-block
Patterns: |
|
Since: | 2.9.0 |
Requirements: | Spigot 1.19.4+ or Paper 1.16.5+ (no event-direction) |
Examples:
send "<gold>Ding-dong!<reset>" to all players in radius 10 of event-block
Patterns: |
|
Since: | 1.0 |
Examples:
if block is log:
send "You can't break the holy log!"
Patterns: |
|
Since: | 2.5 |
Requirements: | Minecraft 1.13 or newer |
Examples:
send "Fertilized %size of fertilized blocks% blocks got fertilized."
Patterns: |
|
Since: | 2.2-Fixes-V10 |
Examples:
Patterns: |
|
Since: | 2.2-dev31 |
Examples:
Patterns: |
|
Since: | 2.2-dev31 |
Examples:
Patterns: |
|
Since: | 1.0 (break), unknown (mine), 2.6 (BlockData support) |
Examples:
on break of stone:
on mine of any ore:
on break of chest[facing=north]:
on break of potatoes[age=7]:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0, 2.6 (BlockData support) |
Examples:
on burn of wood, fences, or chests:
on burn of oak_log[axis=y]:
Patterns: |
|
Since: | 1.0 (basic), 2.0 ([un]cancellable) |
Please note that the data value of the block to be placed is not available in this event, only its ID.
Examples:
cancel event
Patterns: |
|
Since: | 1.4.1 |
Use chat format to change message format.
Use chat recipients to edit chat recipients.
Examples:
if player has permission "owner":
set chat format to "<red>[player]<light gray>: <light red>[message]"
else if player has permission "admin":
set chat format to "<light red>[player]<light gray>: <orange>[message]"
else: #default message format
set chat format to "<orange>[player]<light gray>: <white>[message]"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them.
Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.
Examples:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.0 |
Examples:
on command "/stop":
on command "pm Njol ":
Patterns: |
|
Since: | 2.0 |
Examples:
player doesn't have permission "VIP"
number of players is greater than 15
kick the player due to "The last 5 slots are reserved for VIP players."
Patterns: |
|
Since: | 2.0 |
Examples:
Patterns: |
|
Since: | unknown (before 2.1) |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0, 2.7 (by entity) |
Examples:
on damage of a player:
on damage of player by zombie:
Patterns: |
|
Since: | 1.0 |
Examples:
on death of player:
on death of a wither or ender dragon:
broadcast "A %entity% has been slain in %world%!"
Patterns: |
|
Since: | unknown (before 2.1) |
Examples:
send "that'd be 19.99 please!"
Patterns: |
|
Since: | unknown (before 2.1), 2.7 (entity) |
Examples:
if event-item is compass:
cancel event
on entity drop of an egg:
if event-entity is a chicken:
set item of event-dropped item to a diamond
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.5 |
To get the enchanted item, see the enchant item expression
Examples:
if the clicked button is 1: # offer 1
set the applied enchantments to sharpness 10 and unbreaking 10
Patterns: |
|
Since: | 2.5 |
To get the enchant item, see the enchant item expression
Examples:
set enchant offer 1 to sharpness 1
set the cost of enchant offer 1 to 10 levels
Patterns: |
|
Since: | 2.9.0 |
Requirements: | Paper |
Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
on enderman enrage:
if player has permission "safeFrom.enderman":
cancel event
Patterns: |
|
Since: | unknown, 2.5.2 (falling block), 2.8.0 (any entity support) |
event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
kill event-entity
broadcast "A sheep stole some grass!"
on falling block land:
event-entity is a falling dirt
cancel event
Patterns: |
|
Since: | 2.2-dev13b |
Examples:
kill event-entity
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper 1.15.2+ |
Examples:
if entity is a wither skeleton:
cancel event
Patterns: |
|
Since: | 2.2-dev13b |
Examples:
cancel event
Patterns: |
|
Since: | 2.5.3 |
Examples:
broadcast "A %type of event-entity% has entered a portal!
Patterns: |
|
Since: | 2.8.0 |
Examples when it's called include; when a zombie gets cured and a villager spawns, an entity drowns in water like a zombie that turns to a drown, an entity that gets frozen in powder snow, a mooshroom that when sheared, spawns a new cow.
Examples:
on mooshroom transforming:
on zombie, skeleton or slime transform:
Patterns: |
|
Since: | 2.7 |
Examples:
set {_xp} to event-experience
broadcast "%{_xp}%"
Patterns: |
|
Since: | 2.0 |
Please note that this event will not fire for xp orbs spawned by plugins (including Skript) with Bukkit.
Examples:
world is "minigame_world"
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0, 2.6 (BlockData support) |
Examples:
on fade of snow[layers=2]
Patterns: |
|
Since: | 2.4 |
Examples:
on firework exploding colored red, light green and black
on firework explosion colored light green:
broadcast "A firework colored %colors% was exploded at %location%!"
Patterns: |
|
Since: | 1.3.7 |
Examples:
broadcast "Welcome %player% to the server!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.2-dev36 |
Examples:
if {game::%player%::playing} exists:
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
if event-block is water:
broadcast "Build more dams! It's starting to get wet in here"
Patterns: |
|
Since: | 1.0, 2.6 (BlockData support) |
Examples:
on form of a mushroom:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.2-dev21 |
Examples:
cancel the event # bad idea, but you CAN do it!
Patterns: |
|
Since: | 1.0, 2.2-dev20 (plants), 2.8.0 (from, into, blockdata) |
"of" matches any grow event, "from" matches only the old state, "into" matches only the new state,and "from into" requires matching both the old and new states.
Using "and" lists in this event is equivalent to using "or" lists. The event will trigger if any one of the elements is what grew.
Examples:
on grow of tree:
on grow of wheat[age=7]:
on grow from a sapling:
on grow into tree:
on grow from a sapling into tree:
on grow of wheat, carrots, or potatoes:
on grow into tree, giant mushroom, cactus:
on grow from wheat[age=0] to wheat[age=1] or wheat[age=2]:
Patterns: |
|
Since: | 2.3 |
Works also when one or both of the slots are empty.
The event is called before the items are actually swapped,
so when you use the player's tool or player's offtool expressions,
they will return the values before the swap -
this enables you to cancel the event before anything happens.
Examples:
event-player's tool is a diamond sword
cancel event
Patterns: |
|
Since: | 1.0, 2.9.0 (by reason) |
Examples:
on player healing from a regeneration potion:
on healing of a zombie, cow or a wither:
heal reason is healing potion
cancel event
Patterns: |
|
Since: | 2.5.1 |
Examples:
push event-entity upwards at speed 2
Patterns: |
|
Since: | 1.4.4 |
Examples:
Patterns: |
|
Since: | 1.0 |
The burn event will be called when the block is about do be destroyed by the fire.
Examples:
if event-block is a ladder:
cancel event
Patterns: |
|
Since: | 2.2-Fixes-V10 |
Examples:
if event-item is stone:
give player 1 stone
remove 20$ from player's balance
Patterns: |
|
Since: | 2.2-dev21 |
Examples:
if player's location is {location}:
send "You exited the shop!"
Patterns: |
|
Since: | 2.7 |
Examples:
if player's current inventory is {_gui}:
send "You can't drag your items here!" to player
cancel event
Patterns: |
|
Since: | 2.8.0 |
When this event is called, the initiator may have already removed the item from the source inventory and is ready to move it into the destination inventory.
If this event is cancelled, the items will be returned to the source inventory.
Examples:
broadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
Patterns: |
|
Since: | 2.2-dev21 |
Examples:
close player's inventory
Patterns: |
|
Since: | 2.5.1 |
Examples:
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper 1.19.2+ |
Warning: setting the event-slot to a new item can result in an infinite loop.
Examples:
if event-item is a diamond:
send "You obtained a diamond!" to player
Patterns: |
|
Since: | 2.1.1 |
This event cannot be cancelled.
Examples:
Patterns: |
|
Since: | 2.5 |
Examples:
cancel event
Patterns: | |
Since: | 2.2-dev35 |
Examples:
send "Not my precious!"
cancel event
Patterns: |
|
Since: | 2.5.1 |
Requirements: | Minecraft 1.13 or newer |
Examples:
chance of 50%:
cancel the event
send "Oops! Mending failed!" to player
Patterns: | |
Since: | 2.2-dev35 |
Examples:
cancel event
Patterns: |
|
Since: | unknown (before 2.1) |
Examples:
broadcast "Someone dropped an iron sword!"
Patterns: |
|
Since: | 1.0 |
Examples:
message "Welcome on our awesome server!"
broadcast "%player% just joined the server!"
Patterns: |
|
Since: | 2.3 |
This event requires PaperSpigot.
Examples:
event-player does not have permission "jump"
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.3 |
This event requires Minecraft 1.12+.
Examples:
if player's language starts with "en":
send "Hello!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0, 2.4 (level up/down) |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
spawn a zombie at location of event-entity
Patterns: |
|
Since: | 2.7 |
Requirements: | MC 1.16+ |
For example, when opening a shipwreck chest.
Examples:
chance of 10%
add 64 diamonds to the loot
send "You hit the jackpot at %event-location%!"
Patterns: |
|
Since: | 2.6, 2.8.0 (turn around) |
Requirements: | Paper 1.16.5+ (entity move) |
NOTE: Move event will only be called when the entity/player moves position, keyword 'turn around' is for orientation (ie: looking around), and the combined syntax listens for both.
NOTE: These events can be performance heavy as they are called quite often.
Examples:
if player does not have permission "player.can.move":
cancel event
on skeleton move:
if event-entity is not in world "world":
kill event-entity
on player turning around:
send action bar "You are currently turning your head around!" to player
Patterns: |
|
Since: | 2.0 |
Please note that using this event can cause lag if there are many players online.
Examples:
on stepping on stone:
Patterns: |
|
Since: | 1.4.6 |
Examples:
on block physics:
block is sand
cancel event
Patterns: |
|
Since: | unknown (before 2.1), 2.5 (entity) |
Examples:
on entity pickup of wheat:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
broadcast "A piston is extending!"
Patterns: |
|
Since: | 1.0 |
Examples:
broadcast "A piston is retracting!"
Patterns: |
|
Since: | 1.0, 2.6 (BlockData support) |
Examples:
on place of a furnace, workbench or chest:
on break of chest[type=right] or chest[type=left]
Patterns: |
|
Since: | 2.7 |
Examples:
send "You entered a chunk: %past event-chunk% -> %event-chunk%!" to player
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper 1.16+ |
Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
Examples:
send "Zzzz.." to player
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Minecraft 1.14+ (event-projectile) |
Examples:
cancel the event
teleport event-projectile to block 5 above event-projectile
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper 1.16.5+ |
Examples:
chance of 50%:
cancel event
send "The trade was somehow denied!" to player
Patterns: |
|
Since: | 2.2-dev28 |
Examples:
world is "city"
send "Welcome to the City!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0, 2.5.3 (event-entity support) |
Requirements: | Minecraft 1.14+ (event-entity support) |
In Minecraft 1.14+, you can use the player in this event.
Please note that there may not always be a player (or other entity) in this event.
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.2-Fixes-V10 |
Examples:
Patterns: |
|
Since: | 1.0 (pressure plate), 1.4.4 (tripwire) |
Examples:
Patterns: |
|
Since: | 2.5 |
Requirements: | Paper |
Examples:
teleport shooter of event-projectile to event-entity
Patterns: |
|
Since: | 1.0 |
Use the damage event with a check for a projectile to be able to use the entity that got hit in the case when the projectile hit a living entity.
A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.
Examples:
event-projectile is arrow
delete event-projectile
Patterns: |
|
Since: | 1.0 (simple disconnection) |
Examples:
on disconnect:
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper |
Cancelling this event will skip the current arrow item and fire a new event for the next arrow item.
The arrow and bow in the event can be accessed with the Readied Arrow/Bow expression.
Examples:
selected bow's name is "Spectral Bow"
if selected arrow is not a spectral arrow:
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
send "someone is using redstone" to console
Patterns: |
|
Since: | 2.1 |
Requirements: | Supported regions plugin |
This event requires a supported regions plugin to be installed.
Examples:
message "Leaving %region%."
Patterns: |
|
Since: | 2.4 |
send resource pack effect.
The resource pack condition can be used
to check the resource pack state.
This event will be triggered once when the player accepts or declines the resource pack request,
and once when the resource pack is successfully installed or failed to download.
Examples:
if the resource pack was declined or failed to download:
on resource pack deny:
kick the player due to "You have to install the resource pack to play in this server!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 2.2-dev28 |
Examples:
entity is player
entity has permission "admin.undying"
uncancel the event
Patterns: |
|
Since: | 2.5 |
Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Examples:
send "You are riptiding!"
Patterns: |
|
Since: | 2.0 |
The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
set {running::%script%} to true
on unload:
set {running::%script%} to false
Patterns: |
|
Since: | 2.8.0 |
Modifications will affect what commands show up for the player to tab complete. They will not affect what commands the player can actually run.
Adding new commands to the list is illegal behavior and will be ignored.
Examples:
set command list to command list where [input does not contain ":"]
remove "help" from command list
Patterns: |
|
Since: | 2.3 |
The IP expression can be used to get the IP adress of the pinger.
This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).
Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.
Examples:
set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
set the fake max players count to (online players count + 1)
set the shown icon to a random server icon out of {server-icons::*}
Patterns: |
|
Since: | 2.0 |
Examples:
on server stop:
Patterns: |
|
Since: | 2.2-dev21 |
Examples:
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
if projectile is an arrow:
send "you shot an arrow!" to shooter
Patterns: |
|
Since: | 1.0 |
Examples:
line 2 is empty
set line 1 to "<red>%line 1%"
Patterns: |
|
Since: | 2.2-dev26 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
on sneak toggle:
player is sneaking
push the player upwards at speed 0.5
Patterns: |
|
Since: | 1.0, 2.5.1 (non-living entities) |
Examples:
on spawn of an ender dragon:
broadcast "A dragon has been sighted in %world%!"
Patterns: |
|
Since: | 1.0 |
Examples:
broadcast "someone changed the spawn!"
Patterns: |
|
Since: | 2.7 |
Requirements: | Paper |
Examples:
Patterns: |
|
Since: | 2.5 |
Requirements: | Minecraft 1.13 or newer |
Examples:
loop absorbed blocks:
broadcast "%loop-block% was absorbed by a sponge"!
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
player is not sprinting
send "Run!"
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper 1.16+ |
Examples:
cancel the event
on stonecutting:
broadcast "%player% is using stonecutter to craft %event-item%!"
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper 1.18.2+ |
Note that event-timespan will return the time the item was used for.
Examples:
broadcast "%player% used %event-item% for %event-timespan%."
Patterns: |
|
Since: | 2.3 |
Requirements: | 1.13 or newer |
Examples:
event-entity does not have permission "swim"
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
target is a player
Patterns: |
|
Since: | 1.0, 2.9.0 (entity teleport) |
When teleporting entities, the event may also be called due to a result of natural causes, such as an enderman or shulker teleporting, or wolves teleporting to players.
When teleporting players, the event can be called by teleporting through a nether/end portal, or by other means (e.g. plugins).
Examples:
on player teleport:
on creeper teleport:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
entity is a player
cancel event
Patterns: |
|
Since: | 1.0 |
Examples:
if event-entity is a spider:
kill event-entity
Patterns: |
|
Since: | 1.0 |
Examples:
on weather change to sunny:
Patterns: |
|
Since: | 1.0, 2.8.0 (defining worlds) |
any scripts are loaded, this event is only called for newly created worlds.
World management plugins might change the behaviour of this event though.
Examples:
Patterns: |
|
Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
broadcast "The world %event-world% has been loaded!"
Patterns: |
|
Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
broadcast "The world %event-world% has been saved"
Patterns: |
|
Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
broadcast "the %event-world% has been unloaded!"
Patterns: |
|
Since: | 1.0 |
Examples:
Patterns: |
|
Since: | 1.0 |
Examples:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days: