Please note that this is the old documentation on the last version of Skript I released in 2014.
For up-to-date documentation, please visit the SkriptLang docs, the Skript Hub docs, or the skUnity docs.
For up-to-date documentation, please visit the SkriptLang docs, the Skript Hub docs, or the skUnity docs.
Table of Contents
- At Time
- On Bed Enter
- On Bed Leave
- On Block Damage
- On Break / Mine
- On Bucket Empty
- On Bucket Fill
- On Burn
- On Can Build Check
- On Chat
- On Chunk Generate
- On Chunk Load
- On Chunk Unload
- On Click
- On Combust
- On Command
- On Connect
- On Consume
- On Craft
- On Creeper Power
- On Damage
- On Death
- On Dispense
- On Drop
- On Enderman/Sheep
- On Experience Spawn
- On Explode
- On Explosion Prime
- On Fade
- On First Join
- On Fishing
- On Flow
- On Form
- On Fuel Burn
- On Gamemode Change
- On Grow
- On Heal
- On Hunger Meter Change
- On Ignition
- On Item Break
- On Item Spawn
- On Join
- On Kick
- On Leaves Decay
- On Level Change
- On Lightning Strike
- On Move On
- On Physics
- On Pick Up
- On Pig Zap
- On Piston Extend
- On Piston Retract
- On Place
- On Portal
- On Portal Create
- On Portal Enter
- On Pressure Plate / Trip
- On Projectile Hit
- On Quit
- On Redstone
- On Region Enter/Leave
- On Respawn
- On Script Load/Unload
- On Shoot
- On Sign Change
- On Skript Start/Stop
- On Smelt
- On Sneak Toggle
- On Spawn
- On Spawn Change
- On Spread
- On Sprint Toggle
- On Tame
- On Target
- On Teleport
- On Throwing of an Egg
- On Tool Change
- On Vehicle Create
- On Vehicle Damage
- On Vehicle Destroy
- On Vehicle Enter
- On Vehicle Exit
- On Weather Change
- On World Init
- On World Load
- On World Save
- On World Unload
- On Zombie Break Door
- Periodical
Please also note that the ‘on’ at the start of an event is entirely optional but it just looks better in my opinion, and that most events don't have examples since there is only one way to use them.
At Time
patterns[?]: | at %time% [in %worlds%] |
---|---|
since: | 1.3.4 |
An event that occurs at a given minecraft time in every world or only in specific worlds.
examples:
at 18:00 at 7am in "world"
On Bed Enter
patterns[?]: | [on] bed enter[ing] [on] [player] enter[ing] [a] bed |
---|---|
since: | 1.0 |
Called when a player starts sleeping.
On Bed Leave
patterns[?]: | [on] bed leav(e|ing) [on] [player] leav(e|ing) [a] bed |
---|---|
since: | 1.0 |
Called when a player leaves a bed.
On Block Damage
patterns[?]: | [on] block damage |
---|---|
since: | 1.0 |
Called when a player starts to break a block. You can usually just use the leftclick event for this.
On Break / Mine
patterns[?]: | [on] [block] (min(e|ing)) [[of] %item types%] |
---|---|
since: | 1.0 (break), unknown (mine) |
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.
examples:
on mine on break of stone on mine of any ore
On Bucket Empty
patterns[?]: | [on] bucket empty[ing] [on] [player] empty[ing] [a] bucket |
---|---|
since: | 1.0 |
Called when a player empties a bucket. You can also use the place event with a check for water or lava.
On Bucket Fill
patterns[?]: | [on] bucket fill[ing] [on] [player] fill[ing] [a] bucket |
---|---|
since: | 1.0 |
Called when a player fills a bucket. Like the bucket empty event, you can also use the break event with a check for water or lava.
On Burn
patterns[?]: | [on] [block] burn[ing] [[of] %item types%] |
---|---|
since: | 1.0 |
Called when a block is destroyed by fire.
examples:
on burn on burn of wood, fences, or chests
On Can Build Check
patterns[?]: | [on] [block] can build check |
---|---|
since: | 1.0 (basic), 2.0 ([un]cancellable) |
Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it.
Please note that the data value of the block to be placed is not available in this event, only its ID.
Please note that the data value of the block to be placed is not available in this event, only its ID.
On Chunk Generate
patterns[?]: | [on] chunk (generat|populat)(e|ing) |
---|---|
since: | 1.0 |
Called after a new chunk was generated.
On Chunk Load
patterns[?]: | [on] chunk load[ing] |
---|---|
since: | 1.0 |
Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.
On Chunk Unload
patterns[?]: | [on] chunk unload[ing] |
---|---|
since: | 1.0 |
Called when a chunk is unloaded due to not being near any player. Cancel the event to force the server to keep the chunk loaded and thus keep simulating the chunk (e.g. physics, plant growth, minecarts, etc. will keep working and won't freeze).
On Click
patterns[?]: | [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type% |
---|---|
since: | 1.0 |
Called when a user clicks on a block, an entity or air with or without an item in their hand.
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.
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.
examples:
on click on rightclick holding a fishing rod on leftclick on a stone or obsidian on rightclick on a creeper on click with a sword
On Combust
patterns[?]: | [on] combust[ing] |
---|---|
since: | 1.0 |
Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).
See also: on ignition - called when a block catches fire.
See also: on ignition - called when a block catches fire.
On Command
patterns[?]: | [on] command [%text%] |
---|---|
since: | 2.0 |
Called when a player enters a command (not necessarily a Skript command).
Please define a custom command if possible instead of using this event. Use this event only if you need to perform some action on multiple command, e.g. to prevent commands under certain circumstances, to log commands, or to add Skript checks to commands from other plugins that cannot be solved by changing the permissions of the player(s).
Please define a custom command if possible instead of using this event. Use this event only if you need to perform some action on multiple command, e.g. to prevent commands under certain circumstances, to log commands, or to add Skript checks to commands from other plugins that cannot be solved by changing the permissions of the player(s).
examples:
on command on command "/stop" on command "pm Njol "
On Connect
patterns[?]: | [on] [player] connect[ing] |
---|---|
since: | 2.0 |
Called when a player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over on join.
examples:
on connect: player doesn't have permission "VIP" number of players is larger than 20 kick the player due to "The last 5 slots are reserved for VIP players."
On Consume
patterns[?]: | [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%] |
---|---|
since: | 2.0 |
Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.
On Craft
patterns[?]: | [on] [player] craft[ing] [[of] %item types%] |
---|---|
since: | unknown |
Called when a player crafts an item.
On Creeper Power
patterns[?]: | [on] creeper power |
---|---|
since: | 1.0 |
Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.
See also: on lightning strike
See also: on lightning strike
On Damage
patterns[?]: | [on] damag(e|ing) [of %entity type%] |
---|---|
since: | 1.0 |
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.
examples:
on damage on damage of a player
On Death
patterns[?]: | [on] death [of %entity types%] |
---|---|
since: | 1.0 |
Called when a living entity (including players) dies.
examples:
on death on death of player on death of a wither or ender dragon: broadcast "A %entity% has been slain in %world%!"
On Dispense
patterns[?]: | [on] dispens(e|ing) [[of] %item types%] |
---|---|
since: | unknown |
Called when a dispenser dispenses an item.
On Drop
patterns[?]: | [on] [player] drop[ing] [[of] %item types%] |
---|---|
since: | unknown |
Called when a player drops an item from his inventory.
On Enderman/Sheep
patterns[?]: | [on] enderman place [on] enderman pickup [on] sheep eat |
---|---|
since: | unknown |
Called when an enderman places or picks up a block, or a sheep eats grass respectively.
On Experience Spawn
patterns[?]: | [on] [e]xp[erience] [orb] spawn [on] spawn of [a[n]] [e]xp[erience] [orb] |
---|---|
since: | 2.0 |
Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event.
Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)
Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)
examples:
on xp spawn: world is "minigame_world" cancel event
On Explode
patterns[?]: | [on] explo(d(e|ing)|sion) |
---|---|
since: | 1.0 |
Called when an entity (a primed TNT or a creeper) explodes.
On Explosion Prime
patterns[?]: | [on] explosion prime |
---|---|
since: | 1.0 |
Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.
On Fade
patterns[?]: | [on] [block] fad(e|ing) [[of] %item types%] |
---|---|
since: | 1.0 |
Called when a block 'fades away', e.g. ice or snow melts.
examples:
on fade of snow or ice
On First Join
patterns[?]: | [on] first (join|login) |
---|---|
since: | 1.3.7 |
Called when a player joins the server for the first time.
On Fishing
patterns[?]: | [on] [player] fish[ing] |
---|---|
since: | 1.0 |
Called when a player fishes something. This is not of much use yet.
On Flow
patterns[?]: | [on] [block] flow[ing] [on] block mov(e|ing) |
---|---|
since: | 1.0 |
Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.
On Form
patterns[?]: | [on] [block] form[ing] [[of] %item types%] |
---|---|
since: | 1.0 |
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes, or a block spreads (see spread event).
examples:
on form of snow on form of a mushroom
On Fuel Burn
patterns[?]: | [on] fuel burn[ing] |
---|---|
since: | 1.0 |
Called when a furnace burns an item from its fuel slot.
On Gamemode Change
patterns[?]: | [on] game[ ]mode change [to %gamemode%] |
---|---|
since: | 1.0 |
Called when a player's gamemode changes.
examples:
on gamemode change on gamemode change to adventure
On Grow
patterns[?]: | [on] grow [of %tree type%] |
---|---|
since: | 1.0 |
Called when a tree or giant mushroom grows to full size.
examples:
on grow on grow of a tree on grow of a huge jungle tree
On Heal
patterns[?]: | [on] heal[ing] |
---|---|
since: | 1.0 |
Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).
On Hunger Meter Change
patterns[?]: | [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing) |
---|---|
since: | 1.4.4 |
Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.
On Ignition
patterns[?]: | [on] [block] ignit(e|ion) |
---|---|
since: | 1.0 |
Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable.
The burn event will be called when the block is about do be destroyed by the fire.
See also: on combust - called when an entity is set on fire.
The burn event will be called when the block is about do be destroyed by the fire.
See also: on combust - called when an entity is set on fire.
On Item Break
patterns[?]: | [on] [player] tool break[ing] [on] [player] break[ing] [(a|the)] tool |
---|---|
since: | 2.1.1 |
Called when a player breaks his tool because its damage reached the maximum value.
This event cannot be cancelled.
This event cannot be cancelled.
On Item Spawn
patterns[?]: | [on] item spawn[ing] [[of] %item types%] |
---|---|
since: | unknown |
Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of his inventory, or a dispenser dispensing an item (not shooting it).
On Join
patterns[?]: | [on] [player] (login|logging in|join[ing]) |
---|---|
since: | 1.0 |
Called when a player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer on connect over this event.
examples:
on join: message "Welcome on our awesome server!" broadcast "%player% just joined the server!"
On Kick
patterns[?]: | [on] [player] (kick|being kicked) |
---|---|
since: | 1.0 |
Called when a player is kicked from the server. You can change the kick message or cancel the event entirely.
On Leaves Decay
patterns[?]: | [on] leaves decay[ing] |
---|---|
since: | 1.0 |
Called when a leaf block decays due to not being connected to a tree.
On Level Change
patterns[?]: | [on] [player] level [change] |
---|---|
since: | unknown |
Called when a player's level changes, e.g. by gathering experience or by enchanting something.
On Lightning Strike
patterns[?]: | [on] lightning [strike] |
---|---|
since: | 1.0 |
Called when lightning strikes.
Use on creeper power and on pig zap to find out if one or more creepers and/or pigs were hit.
Use on creeper power and on pig zap to find out if one or more creepers and/or pigs were hit.
On Move On
patterns[?]: | [on] (step|walk)[ing] (on|over) %*item types% |
---|---|
since: | 2.0 |
Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.
examples:
on walking on dirt or grass on stepping on stone
On Physics
patterns[?]: | [on] [block] physics |
---|---|
since: | 1.4.6 |
Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.
Please note that using this event might cause quite some lag since it gets called extremely often.
Please note that using this event might cause quite some lag since it gets called extremely often.
examples:
# prevents sand from falling on block physics: block is sand cancel event
On Pick Up
patterns[?]: | [on] [player] (pick[ ]up|picking up) [[of] %item types%] |
---|---|
since: | unknown |
Called when a player picks up an item. The item is still on the ground when this event is called.
On Pig Zap
patterns[?]: | [on] pig[ ]zap |
---|---|
since: | 1.0 |
Called when a pig is struck by lightning and transforms into a zombie pigman. Cancel the event to prevent the transformation.
See also: on lightning strike
See also: on lightning strike
On Piston Extend
patterns[?]: | [on] piston extend[ing] |
---|---|
since: | 1.0 |
Called when a piston is about to extend.
On Piston Retract
patterns[?]: | [on] piston retract[ing] |
---|---|
since: | 1.0 |
Called when a piston is about to retract.
On Place
patterns[?]: | [on] [block] (plac(e|ing)|build[ing]) [[of] %item types%] |
---|---|
since: | 1.0 |
Called when a player places a block.
examples:
on place on place of a furnace, workbench or chest
On Portal
patterns[?]: | [on] [player] portal |
---|---|
since: | 1.0 |
Called when a player uses a nether or end portal. Cancel the event to prevent the player from teleporting.
On Portal Create
patterns[?]: | [on] portal create |
---|---|
since: | 1.0 |
Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld.
Please note that it's not possible to use the player in this event.
Please note that it's not possible to use the player in this event.
On Portal Enter
patterns[?]: | [on] portal enter [on] entering [a] portal |
---|---|
since: | 1.0 |
Called when a player enters a nether portal and the swirly animation starts to play.
On Pressure Plate / Trip
patterns[?]: | [on] [step[ping] on] [a] [pressure] plate [on] (trip|[step[ping] on] [a] tripwire) |
---|---|
since: | 1.0 (pressure plate), 1.4.4 (tripwire) |
Called when a player steps on a pressure plate or tripwire respectively.
On Projectile Hit
patterns[?]: | [on] projectile hit |
---|---|
since: | 1.0 |
Called when a projectile hits an entity or a block.
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.
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.
On Quit
patterns[?]: | [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out) |
---|---|
since: | 1.0 |
Called when a player leaves the server. Starting with Skript 2.0 this also includes kicked players.
On Redstone
patterns[?]: | [on] redstone [current] [chang(e|ing)] |
---|---|
since: | 1.0 |
Called when the redstone current of a block changes. This event is of not much use yet.
On Region Enter/Leave
patterns[?]: | cannot be used directly |
---|---|
since: | 2.1 |
Called when a player enters or leaves a region.
This event requires a supported regions plugin to be installed.
This event requires a supported regions plugin to be installed.
examples:
on region exit: message "Leaving %region%."
On Respawn
patterns[?]: | [on] [player] respawn[ing] |
---|---|
since: | 1.0 |
Called when a player respawns. You should prefer this event over the death event as the player is technically alive when this event is called.
On Script Load/Unload
patterns[?]: | [on] [script] (load|init|enable) [on] [script] (unload|stop|disable) |
---|---|
since: | 2.0 |
Called directly after the trigger is loaded, or directly before the whole script is unloaded.
examples:
on load: set {running.%script%} to true on unload: set {running.%script%} to false
On Shoot
patterns[?]: | [on] [projectile] shoot |
---|---|
since: | 1.0 |
Called whenever a projectile is shot. Use the shooter expression to get who shot the projectile.
On Sign Change
patterns[?]: | [on] sign (chang[e]|edit)[ing] [on] [player] (chang[e]|edit)[ing] [a] sign |
---|---|
since: | 1.0 |
As signs are placed empty, this event is called when a player is done editing a sign.
examples:
on sign change: line 2 is empty set line 1 to "<red>%line 1%"
On Skript Start/Stop
patterns[?]: | [on] (server|skript) (start|load|enable) [on] (server|skript) (stop|unload|disable) |
---|---|
since: | 2.0 |
Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).
examples:
on Skript start on server stop
On Smelt
patterns[?]: | [on] [ore] smelt[ing] [on] smelt[ing] of ore |
---|---|
since: | 1.0 |
Called when a furnace smelts an item in its ore slot.
On Sneak Toggle
patterns[?]: | [on] [player] toggl(e|ing) sneak [on] [player] sneak toggl(e|ing) |
---|---|
since: | 1.0 |
Called when a player starts or stops sneaking. Use is sneaking to get whether the player was sneaking before the event was called.
examples:
# make players that stop sneaking jump on sneak toggle: player was sneaking push the player upwards at speed 0.5
On Spawn
patterns[?]: | [on] spawn[ing] [of %entity types%] |
---|---|
since: | 1.0 |
Called when an creature spawns.
examples:
on spawn of a zombie on spawn of an ender dragon: broadcast "A dragon has been sighted in %world%!"
On Spawn Change
patterns[?]: | [on] [world] spawn change |
---|---|
since: | 1.0 |
Called when the spawn point of a world changes.
On Spread
patterns[?]: | [on] spread[ing] |
---|---|
since: | 1.0 |
Called when a new block forms as a result of a block that can spread, e.g. water or mushrooms.
On Sprint Toggle
patterns[?]: | [on] [player] toggl(e|ing) sprint [on] [player] sprint toggl(e|ing) |
---|---|
since: | unknown |
Called when a player starts or stops sprinting. Use is sprinting to get whether the player was sprinting before the event was called.
On Tame
patterns[?]: | [on] [entity] tam(e|ing) |
---|---|
since: | 1.0 |
Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.
On Target
patterns[?]: | [on] [entity] target [on] [entity] un[-]target |
---|---|
since: | 1.0 |
Called when a mob starts/stops following/attacking another entity, usually a player.
Please note that even though the target expression also works for a player's target this event is not called for players.
Please note that even though the target expression also works for a player's target this event is not called for players.
On Teleport
patterns[?]: | [on] [player] teleport[ing] |
---|---|
since: | 1.0 |
Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).
On Throwing of an Egg
patterns[?]: | [on] throw[ing] [of] [an] egg [on] [player] egg throw |
---|---|
since: | 1.0 |
Called when a player throws an egg. You can just use the shoot event in most cases, as this event is intended to support changing the hatched mob and its chance to hatch, but Skript does not yet support that.
On Tool Change
patterns[?]: | [on] [player['s]] (tool|item held|held item) chang(e|ing) |
---|---|
since: | 1.0 |
Called whenever a player changes his held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), but not by dropping or replacing the item in the current slot.
On Vehicle Create
patterns[?]: | [on] vehicle create [on] creat(e|ing|ion of) [a] vehicle |
---|---|
since: | 1.0 |
Called when a new vehicle is created, e.g. when a player places a boat or minecart.
On Vehicle Damage
patterns[?]: | [on] vehicle damage [on] damag(e|ing) [a] vehicle |
---|---|
since: | 1.0 |
Called when a vehicle gets damage. Too much damage will destroy the vehicle.
On Vehicle Destroy
patterns[?]: | [on] vehicle destroy [on] destr(oy[ing]|uction of) [a] vehicle |
---|---|
since: | 1.0 |
Called when a vehicle is destroyed. Any passenger will be ejected and the vehicle might drop some item(s).
On Vehicle Enter
patterns[?]: | [on] vehicle enter [on] enter[ing] [a] vehicle |
---|---|
since: | 1.0 |
Called when an entity enters a vehicle, either deliberately (players) or by falling into them (mobs).
On Vehicle Exit
patterns[?]: | [on] vehicle exit [on] exit[ing] [a] vehicle |
---|---|
since: | 1.0 |
Called when an entity exits a vehicle.
On Weather Change
patterns[?]: | [on] weather change [to %weather types%] |
---|---|
since: | 1.0 |
Called when a world's weather changes.
examples:
on weather change on weather change to sunny
On World Init
patterns[?]: | [on] world init |
---|---|
since: | 1.0 |
Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds.
World management plugins might change the behaviour of this event though.
World management plugins might change the behaviour of this event though.
On World Load
patterns[?]: | [on] world load[ing] |
---|---|
since: | 1.0 |
Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).
On World Save
patterns[?]: | [on] world sav(e|ing) |
---|---|
since: | 1.0 |
Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.
On World Unload
patterns[?]: | [on] world unload[ing] |
---|---|
since: | 1.0 |
Called when a world is unloaded. This event might never be called if you don't have a world management plugin.
On Zombie Break Door
patterns[?]: | [on] zombie break[ing] [a] [wood[en]] door |
---|---|
since: | unknown |
Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.
Periodical
patterns[?]: | every %time span% in [world[s]] %worlds% |
---|---|
since: | 1.0 |
An event that is called periodically. The event is used like 'every <timespan>', e.g. 'every second' or 'every 5 minutes'.
examples:
every second every minecraft hour every tick # warning: lag! every minecraft day in "world"