Player Events
PLAYER JOIN
Event called when a player joins the server.
This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.
PLAYER LEAVE
Event called when a player leaves the server.
This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.
PLAYER PRE JOIN
Event called when a player tries to join the server.
Variables:
%name% (Name of the player trying to join the server)
%ip% (IP of the player)
%uuid% (UUID of the player)
This is not a player event, which means you can't use player variables or player actions. Don't be confused, it is called a "player pre join", but it is a special event which doesn't contain player data.
You can't use cancel_event
action on this event. If you want to block the player from joining, use the prevent_join
action instead.
PLAYER RESPAWN
Event called when a player respawns.
This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.
PLAYER DEATH
Event called when a player dies.
Variables:
%cause% (Cause of death. All causes here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html)
%killer_type% (If the player dies because of an entity, which type of entity. All types on this link: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html)
%killer_name% (If the player dies because of an entity, the name of this entity without color codes)
%killer_color_format_name% (The name of the killer including color codes)
PLAYER COMMAND
Event called when a player executes a command.
Variables:
%command% (The full command the player used)
%main_command% (The main command without arguments)
%arg_X% (The argument in the X position of the command. If the command is
/announce hello world
the %arg_1% variable would be "hello" and the %arg_2% would be "world")%args_length% (The amount of arguments of the command)
%args_substring_<arg1>-<arg2>% (This variable will create a text using a first argument and a last argument. For example, if the command is
/announce I am currently doing a Youtube livestreaming
, you could use the %args_substring_1-6% variable to take arg1, arg2,...,arg6 and get the text that the player is announcing. If you don't care about the arguments length, instead of 6 use a large number like 100)
PLAYER CHAT
Event called when a player writes something in chat.
Variables:
%message% (The chat message)
PLAYER LEVELUP
Event called when a player changes its level.
Variables:
%old_level% (The previous level of the player)
%new_level% (The new level of the player)
PLAYER WORLD CHANGE
Event called when a player is moving to another world.
Variables:
%world_from% (The previous world)
%world_to% (The world where the player is moving to)
%online_players_from% (Amount of online players in the previous world)
%online_players_to% (Amount of online players in the world where the player is moving to)
PLAYER ATTACK
Event called when a player damages an entity.
Variables:
%damage% (Damage made by the player)
%original_damage% (Original damage made by the player)
%attack_type% (Type of the damage. For projectiles it could be: ARROW, TRIDENT, SNOWBALL. If the damage is not made by a projectile, it will result in PLAYER)
ConditionalEvents item variables (for item in hand)
ConditionalEvents victim variables
On this event you can use target player variables and to_target actions.
PLAYER KILL
Event called when a player kills an entity.
Variables:
ConditionalEvents item variables (for item in hand)
ConditionalEvents victim variables
On this event you can use target player variables and to_target actions.
PLAYER DAMAGE
Event called when a player is taking damage.
Variables:
%cause% (Cause of the event. How did the player got damaged. All causes here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html)
%damage% (Damage taken by the player)
%original_damage% (Original damage taken by the player)
%damager_type% (If the player takes damage from an entity, which type of entity. All types on this link: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html)
%damager_name% (If the player takes damage from an entity, the name of this entity without color codes)
%damager_color_format_name% (The name of the damager including color codes)
PLAYER ARMOR
Event called when a player equips or unequips armor.
Variables:
%armor_type% (Type of the armor. Could be: HELMET, CHESTPLATE, LEGGINGS or BOOTS)
%equip_type% (Could be: EQUIP or UNEQUIP)
ConditionalEvents item variables
If you are using EssentialsX: EssentialsX changes the way interactions behave in player armor, so if you want to use the player_armor event, set allow-direct-hat: false
on EssentialsX config.
PLAYER TELEPORT
Event called when a player teleports somehow.
Variables:
%cause% (Cause of the event. Why is the player teleporting. All causes here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerTeleportEvent.TeleportCause.html)
%from_x% (Coordinate X of the previous location)
%from_y% (Coordinate Y of the previous location)
%from_z% (Coordinate Z of the previous location)
%from_world% (World of the previous location)
%from_yaw% (Yaw of the previous location)
%from_pitch% (Pitch of the previous location)
%to_x% (Coordinate Z of the new location)
%to_y% (Coordinate Y of the new location)
%to_x% (Coordinate X of the new location)
%to_world% (World of the new location)
%to_yaw% (Yaw of the new location)
%to_pitch% (Pitch of the new location)
PLAYER BED ENTER
Event called when a player enters a bed.
Variables:
%result% (Result of the event. Can the player really use the bed? All results here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBedEnterEvent.BedEnterResult.html)
Only works on 1.13+!
PLAYER SWAP HAND
Event called when a player swap items between main hand and off hand using the hotkey.
Variables:
ConditionalEvents item variables (for items in main hand and off hand)
PLAYER FISH
Event called when a player is fishing.
Variables:
%state% (Current state of fishing. All states here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerFishEvent.State.html)
%caught_type% (Entity caught. All entity types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html)
ConditionalEvents item variables (For caught item if present. %state% must be CAUGHT_FISH and %caught_type% must be DROPPED_ITEM)
PLAYER OPEN INVENTORY
Event called when a player opens an inventory.
Variables:
%inventory_type% (Type of the opened inventory. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html)
%inventory_title% (Title of the opened inventory without color codes)
PLAYER CLOSE INVENTORY
Event called when a players closes an inventory.
Variables:
%inventory_type% (Type of the closed inventory. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html)
%inventory_title% (Title of the closed inventory without color codes)
PLAYER CLICK INVENTORY
Event called when a player clicks on an inventory.
Variables:
%inventory_type% (Type of the clicked inventory. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html)
%inventory_title% (Title of the clicked inventory without color codes)
%inventory_title_color_format% (Title of the clicked inventory with color codes)
%click_type% (Click type. How is the player clicking on the inventory. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html)
%action_type% (Action type. What is the player doing in the inventory. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryAction.html)
%slot_type% (Type of the clicked slot. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.SlotType.html)
%slot% (Position of the inventory clicked)
ConditionalEvents item variables (for clicked item)
PLAYER STATISTIC
Event called when a player statistic is incremented, like certain blocks breaked, jumps, items pickup...
Variables:
%statistic_name% (Name of the incremented statistic. All names here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html)
%new_value% (New value of this statistic)
%previous_value% (Previous value of this statistic)
%entity% (Associated entity type for this statistic, if present. All types here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html)
%block% (Associated block type for this statistic, if present. All types here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html)
PLAYER SNEAK
Event called when a player toggles their sneaking state.
Variables:
%is_sneaking% (Whether the player is sneaking or not. Will return "true" or "false")
PLAYER RUN
Event called when a player toggles their running state (starts or stops running).
Variables:
%is_running% (Whether the player is running or not. Will return "true" or "false")
PLAYER REGAIN HEALTH
Event called when a player regains/regenerates health.
Variables:
%reason% (Reason of the event. Why is the player regenerating health. All reasons here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityRegainHealthEvent.RegainReason.html)
%amount% (Amount of health regained)
PLAYER CHANGE FOOD
Event called when the food level of a player changes.
Variables:
%old_food_level% (The previous food level of the player)
%new_food_level% (The new food level of the player)
Only works on 1.16+!
Last updated