armor, armor toughness, attack damage, attack knockback, attack speed, block break speed, block interaction range, burning time, entity interaction range, explosion knockback resistance, fall damage multiplier, flying speed, follow range, generic armor, generic armor toughness, generic attack damage, generic attack knockback, generic attack speed, generic burning time, generic explosion knockback resistance, generic fall damage multiplier, generic flying speed, generic follow range, generic gravity, generic jump strength, generic knockback resistance, generic luck, generic max absorption, generic max health, generic movement efficiency, generic movement speed, generic oxygen bonus, generic safe fall distance, generic scale, generic step height, generic tempt range, generic water movement efficiency, gravity, horse jump strength, jump strength, knockback resistance, luck, max absorption, max health, mining efficiency, movement efficiency, movement speed, oxygen bonus, player block break speed, player block interaction range, player entity interaction range, player mining efficiency, player sneaking speed, player submerged mining speed, player sweeping damage ratio, safe fall distance, scale, sneaking speed, spawn reinforcements, step height, submerged mining speed, sweeping damage ratio, tempt range, water movement efficiency, zombie spawn reinforcements
Since:
2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info. NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.
Examples:
set block at player to campfire[lit=false] set target block of player to oak stairs[facing=north;waterlogged=true] set block at player to grass_block[snowy=true] set loop-block to minecraft:chest[facing=north] set block above player to oak_log[axis=y] set target block of player to minecraft:oak_leaves[distance=2;persistent=false]
lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since:
2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.
color of the sheep is red or black set the color of the block to green message "You're holding a <%color of tool%>%color of tool%<reset> wool block"
command /push [<player>]: trigger: if arg-1 is not set: if command sender is console: send "You can't push yourself as a console :\" to sender stop push sender upwards with force 2 send "Yay!" else: push arg-1 upwards with force 2 send "Yay!" to sender and arg-1
sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, campfire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, world border, flying into a wall, cramming, poison, sonic boom, suffocate, custom, kill, killed, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since:
2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.
Examples:
set the block below the victim to a chest loop blocks from the block infront of the player to the block 10 below the player: set the block behind the loop-block to water
aqua affinity, bane of arthropods, binding curse, blast protection, breach, channeling, channelling, curse of binding, curse of vanishing, density, depth strider, efficiency, feather falling, fire aspect, fire protection, flame, fortune, frost walker, impaling, infinity, knockback, looting, loyalty, luck of the sea, lure, mending, multi-shot, multishot, piercing, power, projectile protection, protection, punch, quick charge, respiration, riptide, sharpness, silk touch, smite, soul speed, sweeping edge, swift sneak, thorns, unbreaking, vanishing curse, wind burst
Since:
1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway. NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'. As of Minecraft 1.21 this will also support custom enchantments using namespaces, ex: 'myenchants:explosive'.
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.
Examples:
entity is a zombie or creeper player is an op projectile is an arrow shoot a fireball from the player
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).
drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since:
2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.
barrel inventory, a loom inventory, a blast furnace inventory, workbench inventory, ender chest inventory, loom inventory, a workbench inventory, hopper inventory, a merchant inventory, a hopper inventory, chiseled bookshelf, an ender chest inventory, new smithing table, bookshelf, a jukebox, beacon inventory, shulker box inventory, a barrel inventory, a shulker box inventory, lectern inventory, chest inventory, a villager inventory, a smoker inventory, a brewing stand inventory, a smithing inventory, grindstone inventory, a crafter inventory, a crafting table inventory, a player inventory, decorated pot, furnace inventory, a creative inventory, blast furnace inventory, upgrade gear, a composter inventory, an enchanting table inventory, jukebox, a dropper inventory, a cartography table inventory, a upgrade gear, smoker inventory, composter inventory, a chest inventory, upgrade gear table, a upgrade gear table, dispenser inventory, player inventory, stonecutter inventory, a stonecutter inventory, a decorated pot, a lectern inventory, merchant inventory, cartography table inventory, a chiseled bookshelf, a new smithing table, a furnace inventory, anvil inventory, a dispenser inventory, a grindstone inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, a beacon inventory, a bookshelf, crafter inventory, creative inventory, crafting table inventory, an anvil inventory
Since:
2.2-dev32
Minecraft has several different inventory types with their own use cases.
[<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since:
1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.
Examples:
set {_item} to type of the targeted block {_item} is a torch
first person left handed, left handed in first person, right handed in third person, first person left hand, no transform, the ground, third person right hand, third person right handed, right handed in first person, menu, head, third person left hand, first person right handed, first person right hand, fixed position, left handed in third person, gui, ground, fixed, third person left handed
Since:
INSERT VERSION
Represents the transform setting of an item display.
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.
Examples:
give 4 torches to the player add all slabs to the inventory of the block player's tool is a diamond sword of sharpness remove a pickaxes of fortune 4 from {stored items::*} set {_item} to 10 of every upside-down stair block is dirt or farmland
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.
<number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since:
2.0
Requirements:
Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.
Examples:
add 10£ to the player's account remove Fr. 9.95 from the player's money set the victim's money to 0 increase the attacker's balance by the level of the victim * 100
[-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since:
1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.
Examples:
set the player's health to 5.5 set {_temp} to 2*{_temp} - 2.5
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
2.0 beta 8
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.
Examples:
set {_p} to "Notch" parsed as an offlineplayer # returns Notch even if they're offline
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.
Examples:
set {_p} to "Notch" parsed as a player # returns &amp;amp;amp;amp;amp;amp;lt;none&amp;amp;amp;amp;amp;amp;gt; unless Notch is actually online or starts with Notch like Notchan set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.
Examples:
set tool of player to dirt delete helmet of the victim set the color of the player's tool to green enchant the player's chestplate with projectile protection 5
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.
Examples:
broadcast "Hello World!" message "Hello %player%" message "The id of ""%type of tool%"" is %id of tool%."
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.
Examples:
every 5 minecraft days: wait a minecraft second and 5 ticks every 10 mc days and 12 hours: halt for 12.7 irl minutes, 12 hours and 120.5 seconds
See the type name patterns of all types - including this one
Since:
2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.
Examples:
{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5 {variable} is a type # check whether the variable contains a type, e.g. number or player {variable} is an object # will always succeed if the variable is set as everything is an object, even types. disable PvP in the event-world kill the loop-entity
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.
armor, armor toughness, attack damage, attack knockback, attack speed, block break speed, block interaction range, burning time, entity interaction range, explosion knockback resistance, fall damage multiplier, flying speed, follow range, generic armor, generic armor toughness, generic attack damage, generic attack knockback, generic attack speed, generic burning time, generic explosion knockback resistance, generic fall damage multiplier, generic flying speed, generic follow range, generic gravity, generic jump strength, generic knockback resistance, generic luck, generic max absorption, generic max health, generic movement efficiency, generic movement speed, generic oxygen bonus, generic safe fall distance, generic scale, generic step height, generic tempt range, generic water movement efficiency, gravity, horse jump strength, jump strength, knockback resistance, luck, max absorption, max health, mining efficiency, movement efficiency, movement speed, oxygen bonus, player block break speed, player block interaction range, player entity interaction range, player mining efficiency, player sneaking speed, player submerged mining speed, player sweeping damage ratio, safe fall distance, scale, sneaking speed, spawn reinforcements, step height, submerged mining speed, sweeping damage ratio, tempt range, water movement efficiency, zombie spawn reinforcements
Since:
2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info. NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.
Examples:
set block at player to campfire[lit=false] set target block of player to oak stairs[facing=north;waterlogged=true] set block at player to grass_block[snowy=true] set loop-block to minecraft:chest[facing=north] set block above player to oak_log[axis=y] set target block of player to minecraft:oak_leaves[distance=2;persistent=false]
lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since:
2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.
color of the sheep is red or black set the color of the block to green message "You're holding a &amp;amp;amp;amp;amp;amp;lt;%color of tool%&amp;amp;amp;amp;amp;amp;gt;%color of tool%&amp;amp;amp;amp;amp;amp;lt;reset&amp;amp;amp;amp;amp;amp;gt; wool block"
command /push [&amp;amp;amp;amp;amp;amp;amp;lt;player&amp;amp;amp;amp;amp;amp;amp;gt;]: trigger: if arg-1 is not set: if command sender is console: send "You can't push yourself as a console :\" to sender stop push sender upwards with force 2 send "Yay!" else: push arg-1 upwards with force 2 send "Yay!" to sender and arg-1
sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, campfire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, world border, flying into a wall, cramming, poison, sonic boom, suffocate, custom, kill, killed, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since:
2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.
Examples:
set the block below the victim to a chest loop blocks from the block infront of the player to the block 10 below the player: set the block behind the loop-block to water
aqua affinity, bane of arthropods, binding curse, blast protection, breach, channeling, channelling, curse of binding, curse of vanishing, density, depth strider, efficiency, feather falling, fire aspect, fire protection, flame, fortune, frost walker, impaling, infinity, knockback, looting, loyalty, luck of the sea, lure, mending, multi-shot, multishot, piercing, power, projectile protection, protection, punch, quick charge, respiration, riptide, sharpness, silk touch, smite, soul speed, sweeping edge, swift sneak, thorns, unbreaking, vanishing curse, wind burst
Since:
1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway. NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'. As of Minecraft 1.21 this will also support custom enchantments using namespaces, ex: 'myenchants:explosive'.
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.
Examples:
entity is a zombie or creeper player is an op projectile is an arrow shoot a fireball from the player
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
left movement key, forward movement key, right movement key, backward key, left key, sprint key, forward key, right key, jumping key, sneaking key, jump key, sneak key, sprinting key, backward movement key
Since:
INSERT VERSION
Requirements:
Minecraft 1.21.3+
Represents a movement input key that is pressed by a player.
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).
drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since:
2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.
barrel inventory, a loom inventory, a blast furnace inventory, workbench inventory, ender chest inventory, loom inventory, a workbench inventory, hopper inventory, a merchant inventory, a hopper inventory, chiseled bookshelf, an ender chest inventory, new smithing table, bookshelf, a jukebox, beacon inventory, shulker box inventory, a barrel inventory, a shulker box inventory, lectern inventory, chest inventory, a villager inventory, a smoker inventory, a brewing stand inventory, a smithing inventory, grindstone inventory, a crafter inventory, a crafting table inventory, a player inventory, decorated pot, furnace inventory, a creative inventory, blast furnace inventory, upgrade gear, a composter inventory, an enchanting table inventory, jukebox, a dropper inventory, a cartography table inventory, a upgrade gear, smoker inventory, composter inventory, a chest inventory, upgrade gear table, a upgrade gear table, dispenser inventory, player inventory, stonecutter inventory, a stonecutter inventory, a decorated pot, a lectern inventory, merchant inventory, cartography table inventory, a chiseled bookshelf, a new smithing table, a furnace inventory, anvil inventory, a dispenser inventory, a grindstone inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, a beacon inventory, a bookshelf, crafter inventory, creative inventory, crafting table inventory, an anvil inventory
Since:
2.2-dev32
Minecraft has several different inventory types with their own use cases.
[<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since:
1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.
Examples:
set {_item} to type of the targeted block {_item} is a torch
first person left handed, left handed in first person, right handed in third person, first person left hand, no transform, the ground, third person right hand, third person right handed, right handed in first person, menu, head, third person left hand, first person right handed, first person right hand, fixed position, left handed in third person, gui, ground, fixed, third person left handed
Since:
INSERT VERSION
Represents the transform setting of an item display.
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.
Examples:
give 4 torches to the player add all slabs to the inventory of the block player's tool is a diamond sword of sharpness remove a pickaxes of fortune 4 from {stored items::*} set {_item} to 10 of every upside-down stair block is dirt or farmland
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.
<number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since:
2.0
Requirements:
Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.
Examples:
add 10£ to the player's account remove Fr. 9.95 from the player's money set the victim's money to 0 increase the attacker's balance by the level of the victim * 100
[-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since:
1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.
Examples:
set the player's health to 5.5 set {_temp} to 2*{_temp} - 2.5
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
2.0 beta 8
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.
Examples:
set {_p} to "Notch" parsed as an offlineplayer # returns Notch even if they're offline
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.
Examples:
set {_p} to "Notch" parsed as a player # returns &amp;amp;amp;amp;amp;amp;lt;none&amp;amp;amp;amp;amp;amp;gt; unless Notch is actually online or starts with Notch like Notchan set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.
Examples:
set tool of player to dirt delete helmet of the victim set the color of the player's tool to green enchant the player's chestplate with projectile protection 5
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.
Examples:
broadcast "Hello World!" message "Hello %player%" message "The id of ""%type of tool%"" is %id of tool%."
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.
Examples:
every 5 minecraft days: wait a minecraft second and 5 ticks every 10 mc days and 12 hours: halt for 12.7 irl minutes, 12 hours and 120.5 seconds
See the type name patterns of all types - including this one
Since:
2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.
Examples:
{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5 {variable} is a type # check whether the variable contains a type, e.g. number or player {variable} is an object # will always succeed if the variable is set as everything is an object, even types. disable PvP in the event-world kill the loop-entity
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.
Checks to see if a bell is currently resonating. A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.
Examples:
command /setblock <material>: description: set the block at your crosshair to a different type trigger: player cannot build at the targeted block: message "You do not have permission to change blocks there!" stop set the targeted block to argument
%player% can only see (commands|system messages) [in chat]
%player% can('t|[ ]not) see any (command[s]|message[s]) [in chat]
%player% can('t|[ ]not) see all messages [in chat]
%player% can('t|[ ]not) only see (commands|system messages) [in chat]
Since:
INSERT VERSION
Requirements:
Paper
Checks whether a player can see specific message types in chat.
Examples:
if player can see all messages: send "You can see all messages." if player can only see commands: send "This game doesn't work with commands-only chat." if player can't see any messages: send action bar "Server shutting down in 5 minutes!"
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.
Examples:
the clicked block is a stone slab or a double stone slab time in the player's world is greater than 8:00 the creature is not an enderman or an ender dragon
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.
Examples:
block contains 20 cobblestone player has 4 flint and 2 iron ingots {list::*} contains 5
[the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since:
2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.
Examples:
# make players use their potions of fire resistance whenever they take any kind of fire damage on damage: damage was caused by lava, fire or burning victim is a player victim has a potion of fire resistance cancel event apply fire resistance to the victim for 30 seconds remove 1 potion of fire resistance from the victim # prevent mobs from dropping items under certain circumstances on death: entity is not a player damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison clear drops
Whether the entire or additional tooltip of an item is shown or hidden. The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.). The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners).
Examples:
send true if entire tooltip of player's tool is shown if additional tooltip of {_item} is hidden:
Checks whether living entities have an unobstructed line of sight to other entities or locations.
Examples:
player has direct line of sight to location 5 blocks to the right of player victim has line of sight to attacker player has no line of sight to location 100 blocks in front of player
%players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since:
2.4
Requirements:
Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.
Checks whether a date is in the past or future. Note that using the 'now' expression will not be in the past or future when used directly in the condition.
Examples:
set {_date} to now wait 5 seconds if {_date} is in the past: # this will be true
if now is in the future: # this will be false
set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now if {_dates::*} are in the future: # this will be true if {_dates::*} have passed: # this will be false
Checks if a block is indirectly or directly powered by redstone
Examples:
if clicked block is redstone powered: send "This block is well-powered by redstone!" if clicked block is indirectly redstone powered: send "This block is indirectly redstone powered."
off[ |-]hand[s] of %living entities% (isn't|is not|aren't|are not) raised
Since:
2.8.0
Requirements:
Paper
Checks whether an entity has one or both of their hands raised. Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating).
Examples:
on damage of player: if victim's main hand is raised: drop player's tool at player set player's tool to air
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.
Examples:
on region enter: player is the owner of the region message "Welcome back to %region%!" send "%player% just entered %region%!" to all members of the region
Checks whether a player is online. The 'connected' pattern will return false once this player leaves the server, even if they rejoin. Be aware that using the 'connected' pattern with a variable will not have this special behavior. Use the direct event-player or other non-variable expression for best results.
Examples:
player is online player-argument is offline while player is connected: wait 60 seconds send "hello!" to player
# The following will act like `{_player} is online`. # Using variables with `is connected` will not behave the same as with non-variables. while {_player} is connected: broadcast "online!" wait 1 tick
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.
Checks whether living entities are pathfinding. Can only be a living entity that is a Mob.
Examples:
make {_entity} pathfind to {_location} at speed 2 while {_entity} is pathfinding wait a second launch flickering trailing burst firework colored red at location of {_entity} subtract 10 from {defence::tower::health} clear entity within {_entity}
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.
Examples:
if plugin "Vault" is enabled: if plugin "WorldGuard" is not enabled: if plugins "Essentials" and "Vault" are enabled: if plugin "MyBrokenPlugin" is disabled:
Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore.
Examples:
on left click: event-block is set if player's tool is the preferred tool for event-block: break event-block naturally using player's tool else: cancel event
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.
Examples:
command /slimey: trigger: if chunk at player is a slime chunk: send "Yeah, it is!" else: send "Nope, it isn't"
# prevent mobs from seeing sneaking players if they are at least 4 meters apart on target: target is sneaking distance of target and the entity is bigger than 4 cancel the event
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.
Whether a location is within something else. The "something" can be a block, an entity, a chunk, a world, or a cuboid formed by two other locations. Note that using the is between condition will refer to a straight line between locations, while this condition will refer to the cuboid between locations.
Examples:
if player's location is within {_loc1} and {_loc2}: send "You are in a PvP zone!" to player
if player is in world("world"): send "You are in the overworld!" to player
if attacker's location is inside of victim: cancel event send "Back up!" to attacker and victim
Checks whether an item or an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').
Examples:
tool is of type {selected type} victim is of type {villager type}
Checks if living entities or players are left or right-handed. Armor stands are neither right nor left-handed. Paper 1.17.1+ is required for non-player entities.
Examples:
on damage of player: if victim is left handed: cancel event
Checks whether the defined strings match the input regexes (Regular expressions).
Examples:
on chat: if message partially matches "\d": send "Message contains a digit!" if message doesn't match "[A-Za-z]+": send "Message doesn't only contain letters!"
on resource pack response: if the resource pack wasn't accepted: kick the player due to "You have to install the resource pack to play in this server!"
%date% (was|were)( more|(n't| not) less) than %time span% [ago]
%date% (was|were)((n't| not) more| less) than %time span% [ago]
Since:
2.0
Tests whether a given real time was more or less than some time span ago.
Examples:
command /command-with-cooldown: trigger: {command::%player's uuid%::last-usage} was less than a minute ago: message "Please wait a minute between uses of this command." stop set {command::%player's uuid%::last-usage} to now # ... actual command trigger here ...
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
Checks to see if a bell is currently resonating. A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.
Examples:
command /setblock <material>: description: set the block at your crosshair to a different type trigger: player cannot build at the targeted block: message "You do not have permission to change blocks there!" stop set the targeted block to argument
%player% can only see (commands|system messages) [in chat]
%player% can('t|[ ]not) see any (command[s]|message[s]) [in chat]
%player% can('t|[ ]not) see all messages [in chat]
%player% can('t|[ ]not) only see (commands|system messages) [in chat]
Since:
INSERT VERSION
Requirements:
Paper
Checks whether a player can see specific message types in chat.
Examples:
if player can see all messages: send "You can see all messages." if player can only see commands: send "This game doesn't work with commands-only chat." if player can't see any messages: send action bar "Server shutting down in 5 minutes!"
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.
Examples:
the clicked block is a stone slab or a double stone slab time in the player's world is greater than 8:00 the creature is not an enderman or an ender dragon
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.
Examples:
block contains 20 cobblestone player has 4 flint and 2 iron ingots {list::*} contains 5
[the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since:
2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.
Examples:
# make players use their potions of fire resistance whenever they take any kind of fire damage on damage: damage was caused by lava, fire or burning victim is a player victim has a potion of fire resistance cancel event apply fire resistance to the victim for 30 seconds remove 1 potion of fire resistance from the victim # prevent mobs from dropping items under certain circumstances on death: entity is not a player damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison clear drops
Whether the entire or additional tooltip of an item is shown or hidden. The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.). The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners).
Examples:
send true if entire tooltip of player's tool is shown if additional tooltip of {_item} is hidden:
Checks whether living entities have an unobstructed line of sight to other entities or locations.
Examples:
player has direct line of sight to location 5 blocks to the right of player victim has line of sight to attacker player has no line of sight to location 100 blocks in front of player
%players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since:
2.4
Requirements:
Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.
Checks whether a date is in the past or future. Note that using the 'now' expression will not be in the past or future when used directly in the condition.
Examples:
set {_date} to now wait 5 seconds if {_date} is in the past: # this will be true
if now is in the future: # this will be false
set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now if {_dates::*} are in the future: # this will be true if {_dates::*} have passed: # this will be false
Checks if a block is indirectly or directly powered by redstone
Examples:
if clicked block is redstone powered: send "This block is well-powered by redstone!" if clicked block is indirectly redstone powered: send "This block is indirectly redstone powered."
off[ |-]hand[s] of %living entities% (isn't|is not|aren't|are not) raised
Since:
2.8.0
Requirements:
Paper
Checks whether an entity has one or both of their hands raised. Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating).
Examples:
on damage of player: if victim's main hand is raised: drop player's tool at player set player's tool to air
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.
Examples:
on region enter: player is the owner of the region message "Welcome back to %region%!" send "%player% just entered %region%!" to all members of the region
Checks whether a player is online. The 'connected' pattern will return false once this player leaves the server, even if they rejoin. Be aware that using the 'connected' pattern with a variable will not have this special behavior. Use the direct event-player or other non-variable expression for best results.
Examples:
player is online player-argument is offline while player is connected: wait 60 seconds send "hello!" to player
# The following will act like `{_player} is online`. # Using variables with `is connected` will not behave the same as with non-variables. while {_player} is connected: broadcast "online!" wait 1 tick
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.
Checks whether living entities are pathfinding. Can only be a living entity that is a Mob.
Examples:
make {_entity} pathfind to {_location} at speed 2 while {_entity} is pathfinding wait a second launch flickering trailing burst firework colored red at location of {_entity} subtract 10 from {defence::tower::health} clear entity within {_entity}
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.
Examples:
if plugin "Vault" is enabled: if plugin "WorldGuard" is not enabled: if plugins "Essentials" and "Vault" are enabled: if plugin "MyBrokenPlugin" is disabled:
Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore.
Examples:
on left click: event-block is set if player's tool is the preferred tool for event-block: break event-block naturally using player's tool else: cancel event
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.
Examples:
command /slimey: trigger: if chunk at player is a slime chunk: send "Yeah, it is!" else: send "Nope, it isn't"
# prevent mobs from seeing sneaking players if they are at least 4 meters apart on target: target is sneaking distance of target and the entity is bigger than 4 cancel the event
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.
Whether a location is within something else. The "something" can be a block, an entity, a chunk, a world, or a cuboid formed by two other locations. Note that using the is between condition will refer to a straight line between locations, while this condition will refer to the cuboid between locations.
Examples:
if player's location is within {_loc1} and {_loc2}: send "You are in a PvP zone!" to player
if player is in world("world"): send "You are in the overworld!" to player
if attacker's location is inside of victim: cancel event send "Back up!" to attacker and victim
Checks whether an item or an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').
Examples:
tool is of type {selected type} victim is of type {villager type}
Checks if living entities or players are left or right-handed. Armor stands are neither right nor left-handed. Paper 1.17.1+ is required for non-player entities.
Examples:
on damage of player: if victim is left handed: cancel event
Checks whether the defined strings match the input regexes (Regular expressions).
Examples:
on chat: if message partially matches "\d": send "Message contains a digit!" if message doesn't match "[A-Za-z]+": send "Message doesn't only contain letters!"
on resource pack response: if the resource pack wasn't accepted: kick the player due to "You have to install the resource pack to play in this server!"
%date% (was|were)( more|(n't| not) less) than %time span% [ago]
%date% (was|were)((n't| not) more| less) than %time span% [ago]
Since:
2.0
Tests whether a given real time was more or less than some time span ago.
Examples:
command /command-with-cooldown: trigger: {command::%player's uuid%::last-usage} was less than a minute ago: message "Please wait a minute between uses of this command." stop set {command::%player's uuid%::last-usage} to now # ... actual command trigger here ...
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/docs.html b/docs/nightly/dev/feature/docs.html
index af94f0c3a0..5b9f061259 100644
--- a/docs/nightly/dev/feature/docs.html
+++ b/docs/nightly/dev/feature/docs.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
command /broadcast <string>: usage: A command for broadcasting a message to all players. permission: skript.command.broadcast permission message: You don't have permission to broadcast messages aliases: /bc executable by: players and console cooldown: 15 seconds cooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%. cooldown bypass: skript.command.broadcast.admin cooldown storage: {cooldown::%player%} trigger: broadcast the argument
Functions are structures that can be executed with arguments/parameters to run code. They can also return a value to the trigger that is executing the function. Note that local functions come before global functions execution
Examples:
function sayMessage(message: text): broadcast {_message} # our message argument is available in '{_message}'
local function giveApple(amount: number) :: item: return {_amount} of apple
function getPoints(p: player) returns number: return {points::%{_p}%}
Options are used for replacing parts of a script with something else. For example, an option may represent a message that appears in multiple locations. Take a look at the example below that showcases this.
Examples:
options: no_permission: You're missing the required permission to execute this command!
Used for defining variables present within a script. This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Examples:
variables: {joins} = 0 {balance::%player%} = 0
on join: add 1 to {joins} message "Your balance is %{balance::%player%}%"
Returns the item the entities are currently using (ie: the food they're eating, the bow they're drawing back, etc.). This cannot be changed. If an entity is not using any item, this will return null.
Examples:
on damage of player: if victim's active tool is a bow: interrupt player's active item use
Returns the time that the entities have either spent using an item, or the time left for them to finish using an item. If an entity is not using any item, this will return 0 seconds.
Examples:
on right click: broadcast player's remaining item use time wait 1 second broadcast player's item use time
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.
Examples:
# Set targeted crop to fully grown crop set age of targeted block to maximum age of targeted block
# Spawn a baby cow that will only need 1 minute to become an adult spawn a baby cow at player set age of last spawned entity to -1200 # in ticks = 60 seconds
Returns all of the scripts, or just the enabled or disabled ones.
Examples:
command /scripts: trigger: send "All Scripts: %scripts%" to player send "Loaded Scripts: %enabled scripts%" to player send "Unloaded Scripts: %disabled scripts%" to player
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.
Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples:
message "There are %number of all players% players online!"
Returns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair. The default value of max cost set by vanilla Minecraft is 40.
Examples:
on inventory click: if {AnvilRepairSaleActive} = true: wait a tick # recommended, to avoid client bugs set anvil repair cost to anvil repair cost * 50% send "Anvil repair sale is ON!" to player
on inventory click: player have permission "anvil.repair.max.bypass" set max repair cost of event-inventory to 99999
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.
Examples:
give the item-argument to the player-argument damage the player-argument by the number-argument give a diamond pickaxe to the argument add argument 1 to argument 2 heal the last argument
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.
Examples:
set the player's health to 10 - the player's health loop (argument + 2) / 5 times: message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%" message "You have %health of player * 2% half hearts of HP!"
Equipment of living entities, i.e. the boots, leggings, chestplate or helmet.
Examples:
set chestplate of the player to a diamond chestplate helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.
Examples:
on damage: if attack cooldown of attacker < 1: set damage to 0 send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.
Examples:
on damage: victim is a creeper damage the attacked by 1 heart
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.
Examples:
on damage: attacker is a player health of attacker is less than or equal to 2 damage victim by 1 heart
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.
NOTE: Offline players can not have their bed location changed, only online players.
Examples:
if bed of player exists: teleport player the the player's bed else: teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location set the safe bed location of player to spawn location of world("world") # safe/valid bed location
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).
Examples:
# damage player in deserts constantly every real minute: loop all players: biome at loop-player is desert damage the loop-player by 1
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
Gets the speed at which the given player would break this block, taking into account tools, potion effects, whether or not the player is in water, enchantments, etc. The returned value is the amount of progress made in breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the player jumps/enters water.
Examples:
on left click using diamond pickaxe: event-block is set send "Break Speed: %break speed for player%" to player
Gets the sound that a given block, blockdata, or itemtype will use in a specific scenario. This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
Examples:
play sound (break sound of dirt) at all players set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.
Examples:
loop blocks above the player: loop blocks between the block below the player and the targeted block: set the blocks below the player, the victim and the targeted block to air set all blocks within {loc1} and {loc2} to stone set all blocks within chunk at player to air
The pages of a book (Supports Skript's chat format) Note: In order to modify the pages of a new written book, you must have the title and author of the book set. Skript will do this for you, but if you want your own, please set those values.
Examples:
on book sign: message "Book Pages: %pages of event-item%" message "Book Page 1: %page 1 of event-item%"
set page 1 of player's held item to "Book writing"
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case
Examples:
"Oops!" in lowercase # oops! "oops!" in uppercase # OOPS! "hellO i'm steve!" in proper case # HellO I'm Steve! "hellO i'm steve!" in strict proper case # Hello I'm Steve! "spAwn neW boSs ()" in camel case # spAwnNeWBoSs() "spAwn neW boSs ()" in strict camel case # spawnNewBoss() "geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer() "geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber() "Hello Player!" in snake case # Hello_Player! "Hello Player!" in lower snake case # hello_player! "Hello Player!" in upper snake case # HELLO_PLAYER! "What is your name?" in kebab case # What-is-your-name? "What is your name?" in lower kebab case # what-is-your-name? "What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?
function is_in_order(letters: strings) :: boolean: loop {_letters::*}: set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if: {_previous-codepoint} is set # if the codepoint of the current character is not # 1 more than the codepoint of the previous character # then the letters are not in order {_codepoint} - {_previous-codepoint} is not 1 then: return false
set {_previous-codepoint} to {_codepoint} return true
All characters between two given characters, useful for generating random strings. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. The ASCII table linked here shows this ordering for the first 256 characters. If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression. If strings of more than one character are given, only the first character of each is used.
Examples:
loop characters from "a" to "f": broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz send alphanumeric characters between "0" and "z"
The color of an item, entity, block, firework effect, or text display. This can also be used to color chat messages with "<%color of ...%>this text is colored!". Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
Examples:
on click on wool: message "This wool block is <%color of block%>%color of block%<reset>!" set the color of the block to black
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.
Examples:
on chat: set message to colored message # Safe; only colors get parsed command /fade <player>: trigger: set display name of the player-argument to uncolored display name of the player-argument command /format <text>: trigger: message formatted text-argument # Safe, because we're sending to whoever used this command
The command that caused an 'on command' event (excluding the leading slash and all arguments)
Examples:
# prevent any commands except for the /exit command during some game on command: if {game::%player%::playing} is true: if the command is not "exit": message "You're not allowed to use commands during the game" cancel the event
main command label of command "skript" description of command "help" label of command "pl" usage of command "help" aliases of command "bukkit:help" permission of command "/op" command "op"'s permission message command "sk"'s plugin owner
command /greet <player>: usage: /greet <target> trigger: if arg-1 is sender: send "&cYou can't greet yourself! Usage: %the usage%" stop send "%sender% greets you!" to arg-1 send "You greeted %arg-1%!"
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%
Examples:
make the command sender execute "/say hi!"
on command: log "%executor% used command /%command% %arguments%" to "commands.log"
# make all player's compasses target a player stored in {compass::target::%player%} every 5 seconds: loop all players: set the loop-player's compass target to location of {compass::target::%%loop-player%}
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.
Examples:
command /home: cooldown: 10 seconds cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%. trigger: teleport player to {home::%player%}
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.
Examples:
give a diamond sword of sharpness 3 to the player kill the creeper kill all powered creepers in the wolf's world projectile is an arrow
How much damage is done in a entity/vehicle/item damage events. For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart). For items, it's the amount of durability damage the item will be taking.
Examples:
on item damage: event-item is any tool clear damage # unbreakable tools as the damage will be 0 on damage: increase the damage by 2
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks
Examples:
give player diamond sword with damage value 100 set player's tool to diamond hoe damaged by 250 give player diamond sword with damage 700 named "BROKEN SWORD" set {_item} to diamond hoe with damage value 50 named "SAD HOE" set target block of player to wool with data value 1 set target block of player to potato plant with data value 7
The difference between two values Supported types include numbers, dates and times.
Examples:
if difference between {command::%player%::lastuse} and now is smaller than a minute: message "You have to wait a minute before using this command again!"
thrust the player upwards set the block behind the player to water loop blocks above the player: set {_rand} to a random integer between 1 and 10 set the block {_rand} meters south east of the loop-block to stone block in horizontal facing of the clicked entity from the player is air spawn a creeper 1.5 meters horizontally behind the player spawn a TNT 5 meters above and 2 meters horizontally behind the player thrust the last spawned TNT in the horizontal direction of the player with speed 0.2 push the player upwards and horizontally forward at speed 0.5 push the clicked entity in in the direction of the player at speed -0.5 open the inventory of the block 2 blocks below the player to the player teleport the clicked entity behind the player grow a regular tree 2 meters horizontally behind the player
Returns or changes the billboard setting of displays. This describes the axes/points around which the display can pivot. Displays spawn with the 'fixed' billboard by default. Resetting this expression will also set it to 'fixed'.
Examples:
set billboard of the last spawned text display to center
Returns or changes the brightness override of displays. Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override. Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option. NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
Examples:
set sky light override of the last spawned text display to 7 subtract 3 from the block light level override of the last spawned text display if sky light level override of {_display} is 5: clear brightness override of {_display}
Returns or changes the height or width of displays. The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it). If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
Examples:
set display height of the last spawned text display to 2.5
Returns or changes the interpolation delay/duration of displays. Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state. Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate. Resetting either value will return that value to 0.
Examples:
set interpolation delay of the last spawned text display to 2 ticks
The teleport duration of displays is the amount of time it takes to get between locations. 0 means that updates are applied immediately. 1 means that the display entity will move from current position to the updated one over one tick. Higher values spread the movement over multiple ticks. Max of 59 ticks.
Examples:
set teleport delay of the last spawned text display to 2 ticks teleport last spawned text display to {_location} wait 2 ticks message "display entity has arrived at %{_location}%"
Returns or changes the transformation rotation of displays. The left rotation is applied first, with the right rotation then being applied based on the rotated axis.
Examples:
set left transformation rotation of last spawned block display to quaternion(1, 0, 0, 0) # reset block display
Returns or changes the view range of displays. Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range. For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
Examples:
set view range of the last spawned text display to 2.9
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.
The first, last, range or a random element of a set, e.g. a list variable. See also: random expression
Examples:
broadcast the first 3 elements of {top players::*} set {_last} to last element of {top players::*} set {_random player} to random element out of all players send 2nd last element of {top players::*} to player set {page2::*} to elements from 11 to 20 of {top players::*}
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.
All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. e.g. all players, all creepers in the player's world, or players in radius 100 of the player.
Examples:
kill all creepers in the player's world send "Psst!" to all players within 100 meters of the player give a diamond to all ops heal all tamed wolves in radius 2000 around {town center} delete all monsters in chunk at player size of all players within {_corner::1} and {_corner::2}}
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.
Examples:
on damage of player: send "You are wounded!" to victim set victim's attack speed attribute to 2
on player experience cooldown change: if xp cooldown change reason is plugin: #Changed by a plugin else if xp cooldown change reason is orb pickup: #Changed by picking up xp orb
The experience cooldown of a player. Experience cooldown is how long until a player can pick up another orb of experience. The cooldown of a player must be 0 to pick up another orb of experience.
Examples:
send experience cooldown of player set the xp pickup cooldown of player to 1 hour if exp collection cooldown of player >= 10 minutes: clear the experience pickup cooldown of player
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.
Examples:
on explode: set the explosion's block yield to 10%
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information
Examples:
on explosion prime: set the yield of the explosion to 10
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information
Examples:
on spawn of a creeper: set the explosive yield of the event-entity to 10
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')
Examples:
# makes a bridge loop blocks from the block below the player in the horizontal facing of the player: set loop-block to cobblestone
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.
Examples:
send "congrats on being staff!" to all players where [player input has permission "staff"]
Represents a 'firework effect' which can be used in the launch firework effect.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.
Examples:
command /date: trigger: send "Full date: %now formatted human-readable%" to sender send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.
Examples:
on teleport: former world was "world_nether" # or 'world was' world will be "world" # or 'world after the event is' on tool change: past tool is an axe the tool after the event will be air on weather change: set {weather::%world%::old} to past weather set {weather::%world%::current} to the new weather
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not furnace, as furnace is not an existing expression. Note that the result and the result slot refer to separate things. the result is the product in a smelt event and the result slot is the output slot of a furnace (where the result will end up). Note that if the result in a smelt event is changed to an item that differs in type from the items currently in the result slot, the smelting will fail to complete (the item will attempt to smelt itself again). Note that if values other than the result are changed, event values may not accurately reflect the actual items in a furnace. Thus you may wish to use the event block in this case (e.g. the fuel slot of the event-block) to get accurate values if needed.
Examples:
set the fuel slot of the clicked block to a lava bucket set the block's ore slot to 64 iron ore give the result of the block to the player clear the result slot of the block
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed. If you have LuckPerms, ensure you have vault integration enabled in the luck perms configurations.
Examples:
on join: broadcast "%group of player%" # this is the player's primary group broadcast "%groups of player%" # this is all of the player's groups
Returns the hanging entity or remover in hanging break and place events.
Examples:
on break of item frame: if item of hanging entity is diamond pickaxe: cancel event if hanging remover is a player: send "You can't break that item frame!" to hanging remover
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.
MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!
Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.
Examples:
command /setpass <text>: trigger: set {password::%uuid of player%} to text-argument hashed with SHA-256 command /login <text>: trigger: if text-argument hashed with SHA-256 is {password::%uuid of player%}: message "Login successful." else: message "Wrong password!"
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.
Examples:
set the block at the player's head to air set the block in front of the player's eyes to glass loop blocks in front of the player's head:
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).
Gets and/or sets the (max) domestication of a horse. The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse). The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
Examples:
function domesticateAndTame(horse: entity, p: offline player, i: int = 10): add {_i} to domestication level of {_horse} if domestication level of {_horse} >= max domestication level of {_horse}: tame {_horse} set tamer of {_horse} to {_p}
The currently selected hotbar slot. To retrieve its number use Slot Index expression. Use future and past tense to grab the previous slot in an item change event, see example.
Examples:
message "%player's current hotbar slot%" set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left
on item held change: if the selected hotbar slot was a diamond: set the currently selected hotbar slot to slot 5 of player
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.
Examples:
on server list ping: clear the hover list add "&aWelcome to the &6Minecraft &aserver!" to the hover list add "" to the hover list # A blank line add "&cThere are &6%online players count% &conline players!" to the hover list
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.
Examples:
set {_first} to the first index of "@" in the text argument if {_s} contains "abc": set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.
Examples:
set {l::*} to "some", "cool" and "values" broadcast "%indices of {l::*}%" # result is 1, 2 and 3
set {_leader-board::first} to 17 set {_leader-board::third} to 30 set {_leader-board::second} to 25 set {_leader-board::fourth} to 42 set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first
on inventory item move: holder of event-initiator-inventory is a chest broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
Represents the input in a filter expression or sort effect. For example, if you ran 'broadcast "something" and "something else" where [input is "something"] the condition would be checked twice, using "something" and "something else" as the inputs. The 'input index' pattern can be used when acting on a variable to access the index of the input.
Examples:
send "congrats on being staff!" to all players where [input has permission "staff"] sort {_list::*} based on length of input index
Gets the amount of rows/slots, viewers and holder of an inventory.
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
Examples:
event-inventory's amount of rows holder of player's top inventory {_inventory}'s viewers
Represents a slot in an inventory. It can be used to change the item in an inventory too.
Examples:
if slot 0 of player is air: set slot 0 of player to 2 stones remove 1 stone from slot 0 of player add 2 stones to slot 0 of player clear slot 1 of player
Change the cooldown of a specific material to a certain amount of Timespan.
Examples:
on right click using stick: set item cooldown of player's tool for player to 1 minute set item cooldown of stone and grass for all players to 20 seconds reset item cooldown of cobblestone and dirt for all players
set the item transform of the last spawned item display to first person left handed set the item transform of the last spawned item display to no transform # Reset to default
An item associated with an entity. For dropped item entities, it gets the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item. Other entities do not have items associated with them.
Examples:
item of event-entity
set the item inside of event-entity to a diamond sword named "Example"
Items or blocks of a specific type, useful for looping.
Examples:
loop items of type ore and log: block contains loop-item message "Theres at least one %loop-item% in this block" drop all blocks at the player # drops one of every block at the player
All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.
Examples:
loop all items in the player's inventory: loop-item is enchanted remove loop-item from the player set {inventory::%uuid of player%::*} to items in the player's inventory
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.
Examples:
message "Online players: %join all players' names with "" | ""%" # %all players% would use the default "x, y, and z" set {_s::*} to the string argument split at ","
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.
Examples:
spawn a priest set {healer::%spawned priest%} to true shoot an arrow from the last spawned entity ignite the shot projectile drop a diamond sword push last dropped item upwards teleport player to last struck lightning delete last launched firework
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.
Examples:
command /onlinefor: trigger: send "You have been online for %difference between player's last login and now%." send "You first joined the server %difference between player's first login and now% ago."
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
Examples:
# use the exp bar as mana on rightclick with a blaze rod: player's level progress is larger than 0.2 shoot a fireball from the player reduce the player's level progress by 0.2 every 2 seconds: loop all players: level progress of loop-player is smaller than 0.9: increase level progress of the loop-player by 0.1 else: set level progress of the loop-player to 0.99 on xp spawn: cancel event
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.
Examples:
# set vampire players standing in bright sunlight on fire every 5 seconds: loop all players: {vampire::%uuid of loop-player%} is true sunlight level at the loop-player is greater than 10 ignite the loop-player for 5 seconds
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.
Examples:
set {home::%uuid of player%} to the location of the player message "You home was set to %player's location% in %player's world%."
# Countdown loop 10 times: message "%11 - loop-number%" wait a second
# Generate a 10x10 floor made of randomly colored wool below the player loop blocks from the block below the player to the block 10 east of the block below the player: loop blocks from the loop-block to the block 10 north of the loop-block: set loop-block-2 to any wool
loop {top-balances::*}: loop-iteration <= 10 send "#%loop-iteration% %loop-index% has $%loop-value%"
The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them. Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
Examples:
on right click: send "%event-entity% has been in love for %love time of event-entity% more than you!" to player
An expression to obtain the lowest or highest solid (impassable) block at a location. Note that the y-coordinate of the location is not taken into account for this expression.
Examples:
teleport the player to the block above the highest block at the player set the highest solid block at the player's location to the lowest solid block at the player's location
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.
The maximum durability of an item. Changing requires Minecraft 1.20.5+ Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
Examples:
maximum durability of diamond sword if max durability of player's tool is not 0: # Item is damageable set max durability of player's tool to 5000 add 5 to max durability of player's tool reset max durability of player's tool delete max durability of player's tool
Returns the max duration an item can be used for before the action completes. E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow. Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
Examples:
on right click: broadcast max usage duration of player's tool
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
Examples:
on server list ping: set the max players count to (online players count + 1)
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.
Examples:
on item mend: set the mending repair amount to 100
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, the death message of a death event or the broadcasted message in a broadcast event. This expression is mostly useful for being changed.
Examples:
on chat: player has permission "admin" set message to "&c%message%"
on first join: set join message to "Welcome %player% to our awesome server!"
on join: player has played before set join message to "Welcome back, %player%!"
on quit: if {vanish::%player's uuid%} is set: clear quit message else: set quit message to "%player% left this awesome server!"
on death: set the death message to "%player% died!"
on broadcast: set broadcast message to "&a[BROADCAST] %broadcast message%"
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.
Examples:
command /stuck: executable by: players trigger: teleport player to the center of player's location send "You're no longer stuck."
How much virtual money a player has (can be changed).
Examples:
message "You have %player's money%" # the currency name will be added automatically remove 20$ from the player's balance # replace '$' by whatever currency you use add 200 to the player's account # or omit the currency altogether
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.
Examples:
give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player set tool of player to the player's tool named "<gold>Wand" set the name of the player's tool to "<gold>Wand" open hopper inventory named "Magic Hopper" to player
Gets the entity nearest to a location or another entity.
Examples:
kill the nearest pig and cow relative to player teleport player to the nearest cow relative to player teleport player to the nearest entity relative to player
The number of uppercase, lowercase, or digit characters in a string.
Examples:
#Simple Chat Filter on chat: if number of uppercase chars in message / length of message > 0.5 cancel event send "<red>Your message has to many caps!" to player
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'
Examples:
loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5 loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5 loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. real online player count always return the real count of online players and can't be changed.
Examples:
on server list ping: # This will make the max players count 5 if there are 4 players online. set the fake max players count to (online player count + 1)
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
Examples:
set {var} to line 1 parsed as number on chat: set {var::*} to message parsed as "buying %items% for %money%" if parse error is set: message "%parse error%" else if {var::*} is set: cancel event remove {var::2} from the player's balance give {var::1::*} to the player
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.
Examples:
set {var} to line 1 parsed as integer if {var} is not set: parse error is set: message "<red>Line 1 is invalid: %last parse error%" else: message "<red>Please put an integer on line 1!"
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle
Examples:
#for 1.11 and lower passenger of the minecart is a creeper or a cow the saddled pig's passenger is a player #for 1.11.2+ passengers of the minecart contains a creeper or a cow the boat's passenger contains a pig add a cow and a zombie to passengers of last spawned boat set passengers of player's vehicle to a pig and a horse remove all pigs from player's vehicle clear passengers of boat
set damage to 10% of victim's health set damage to 125 percent of damage set {_result} to {_percent} percent of 999 set {_result::*} to 10% of {_numbers::*} set experience to 50% of player's total experience
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).
Examples:
command /ping <player=%player%>: trigger: send "%arg-1%'s ping is %arg-1's ping%"
The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective. This expression will not return anything due to Bukkit limitations.
Examples:
add "Skript" and "Njol" to chat completions of all players remove "text" from {_p}'s chat completions clear player's chat completions
The amount of time before an entity can use a portal. By default, it is 15 seconds after exiting a nether portal or end gateway. Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown. Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players.
Examples:
on portal: wait 1 tick set portal cooldown of event-entity to 5 seconds
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.
Examples:
set {_p} to potion effect of speed of tier 1 without particles for 10 minutes add {_p} to potion effects of player's tool add {_p} to potion effects of target entity add potion effect of speed 1 to potion effects of player
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.
Examples:
set {_p::*} to active potion effects of player clear all the potion effects of player clear all the potion effects of player's tool add potion effects of player to potion effects of player's tool add speed to potion effects of target entity remove speed and night vision from potion effects of player
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.
This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).
Examples:
on server list ping: set the version string to "<light green>Version: <orange>%minecraft version%" set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always
One or more random characters between two given characters. Use 'alphanumeric' if you want only alphanumeric characters. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. If strings of more than one character are given, only the first character of each is used.
Examples:
set {_captcha} to join (5 random characters between "a" and "z") with "" send 3 random alphanumeric characters between "0" and "z"
A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.
Examples:
set the player's health to a random number between 5 and 10 send "You rolled a %random integer from 1 to 6%!" to the player set {_chances::*} to 5 random integers between 5 and 96 set {_decimals::*} to 3 random numbers between 2.7 and -1.5
All regions at a particular location. This expression requires a supported regions plugin to be installed.
Examples:
On click on a sign: line 1 of the clicked block is "[region info]" set {_regions::*} to regions at the clicked block if {_regions::*} is empty: message "No regions exist at this sign." else: message "Regions containing this sign: <gold>%{_regions::*}%<r>."
broadcast nl and nl repeated 200 times broadcast "Hello World " repeated 5 times if "aa" repeated 2 times is "aaaa": broadcast "Ahhhh" repeated 100 times
Rotates a quaternion or vector around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
set {_new} to {_quaternion} rotated around x axis by 10 degrees set {_new} to {_vector} rotated around vector(1, 1, 1) by 45 set {_new} to {_quaternion} rotated by x 45, y 90, z 135
Returns the axis or angle that a quaternion will rotate by/around. All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
Examples:
set {_quaternion} to axisAngle(45, vector(1, 2, 3)) send rotation axis of {_quaternion} # 1, 2, 3 send rotation angle of {_quaternion} # 45 set rotation angle of {_quaternion} to 135 set rotation axis of {_quaternion} to vector(0, 1, 0)
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
Examples:
on spawn of a monster: if the spawn reason is mob spawner: add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster: if the attacker is a player: if the victim doesn't have the scoreboard tag "spawned by a spawner": add 1$ to attacker's balance
An expression to obtain or modify data relating to the pickles of a sea pickle block.
Examples:
on block break: type of block is sea pickle send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!" send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!" send "It had to have contained at least %event-block's minimum sea pickle count% pickles!" cancel event set event-block's sea pickle count to event-block's maximum sea pickle count send "This bad boy is going to hold so many pickles now!!"
The commands that will be sent to the player in a send commands to player event. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.
Examples:
on script load: set {server-icons::default} to the default server icon
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
if index of event-slot is 10: send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory if raw index of event-slot > 27: # outside custom inventory cancel event
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.
Examples:
set the player's walk speed to 1 increase the argument's fly speed by 0.1
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).
Examples:
set {_s} to the first 5 characters of the text argument message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console set {_characters::*} to characters at 1, 2 and 7 in player's display name send the last character of all players' names
For players this is the entity at the crosshair. For mobs and experience orbs this is the entity they are attacking/following (if any). Display entities have a hit box of 0, so you should use 'target display' to collect Display entities May grab entities in unloaded chunks.
Examples:
on entity target: if entity's target is a player: send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-less delete targeted entity of player # for players it will delete the target delete target of last spawned zombie # for entities it will make them target-less
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression. The actual target block will regard the actual hit box of the block.
Examples:
set target block of player to stone set target block of player to oak_stairs[waterlogged=true] break target block of player using player's tool give player 1 of type of target block teleport player to location above target block kill all entities in radius 3 around target block of player set {_block} to actual target block of player break actual target block of player
The time of a world. Use the "minecraft timespan" syntax to change the time according to Minecraft's time intervals. Since Minecraft uses discrete intervals for time (ticks), changing the time by real-world minutes or real-world seconds only changes it approximately. Removing an amount of time from a world's time will move the clock forward a day.
Examples:
set time of world "world" to 2:00 add 2 minecraft hours to time of world "world" add 54 real seconds to time of world "world" # approximately 1 minecraft hour
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.
Examples:
set {_t} to time played of player if player's time played is greater than 10 minutes: give player a diamond sword
The time since a date has passed or the time until a date will pass. This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
Examples:
send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player send "%time until {countdown::end}% until the game begins!" to player
The total experience, in points, of players or experience orbs. Adding to a player's experience will trigger Mending, but setting their experience will not.
Examples:
set total experience of player to 100
add 100 to player's experience
if player's total experience is greater than 100: set player's total experience to 0 give player 1 diamond
Type of a block, item, entity, inventory or potion effect. Types of items, blocks and block datas are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.
Examples:
on rightclick on an entity: message "This is a %type of clicked entity%!"
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!
Examples:
# prevents people from joining the server if they use the name of a player # who has played on this server at least once since this script has been added on login: if {uuid::%name of player%} exists: {uuid::%name of player%} is not uuid of player kick player due to "Someone with your name has played on this server before" else: set {uuid::%name of player%} to uuid of player
Gets the value within objects. Usually used with variables to get the value they store rather than the variable itself, or with lists to get the values of a type.
Examples:
set {_entity} to a random entity out of all entities delete entity within {_entity} # This deletes the entity itself and not the value stored in the variable
set {_list::*} to "something", 10, "test" and a zombie broadcast the strings within {_list::*} # "something", "test"
Gets or changes the W, X, Y or Z component of vectors/quaternions. You cannot use the W component with vectors; it is for quaternions only.
Examples:
set {_v} to vector 1, 2, 3 send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
set {_loc} to {_v} to location in world "world" set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90 set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90
Creates vectors from given directions. Relative directions are relative to the origin, (0, 0, 0). Therefore, the vector from the direction 'forwards' is (0, 0, 1).
Examples:
set {_v} to vector from direction upwards set {_v} to vector in direction of player set {_v} to vector in horizontal direction of player set {_v} to vector from facing of player set {_v::*} to vectors from north, south, east, and west
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.
Examples:
on server list ping: set the protocol version to 0 # 13w41a (1.7), so it will show the version string always set the version string to "<light green>Version: <orange>%minecraft version%"
The view distance of a player as set by the server. Can be changed. NOTE: This is the view distance sent by the server to the player. This has nothing to do with client side view distance settings NOTE: This may not work on some versions (such as MC 1.14.x). The return value in this case will be the view distance set in system.properties.
Examples:
set view distance of player to 10 set {_view} to view distance of player reset view distance of all players add 2 to view distance of player
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.
Examples:
set {_clientView} to the client view distance of player set view distance of player to client view distance of player
An expression for obtaining and modifying the server's whitelist. Players may be added and removed from the whitelist. The whitelist can be enabled or disabled by setting the whitelist to true or false respectively.
Examples:
set the whitelist to false add all players to whitelist reset the whitelist
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.
The yaw or pitch of a location or vector. A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise. A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards. Only Paper 1.19+ users may directly change the yaw/pitch of players.
Examples:
log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log" set {_yaw} to yaw of player set {_p} to pitch of target entity set pitch of player to -90 # Makes the player look upwards, Paper 1.19+ only add 180 to yaw of target of player # Makes the target look behind themselves
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.
Note that banning people does not kick them from the server. You can optionally use 'and kick' or consider using the kick effect after applying a ban.
Examples:
unban player ban "127.0.0.1" IP-ban the player because "he is an idiot" ban player due to "inappropriate language" for 2 days ban and kick player due to "inappropriate language" for 2 days
Breaks the block and spawns items as if a player had mined it
You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)
Examples:
on right click: break clicked block naturally loop blocks in radius 10 around player: break loop-block using player's tool loop blocks in radius 10 around player: break loop-block naturally using diamond pickaxe
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.
Examples:
command /nick <text>: executable by: players cooldown: 10 seconds trigger: if length of arg-1 is more than 16: # Makes it so that invalid arguments don't make you wait for the cooldown again cancel the cooldown send "Your nickname may be at most 16 characters." stop set the player's display name to arg-1
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.
Examples:
on death of a zombie: if name of the entity is "&cSpecial": cancel drops of items
on break of a coal ore: cancel the experience drops
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.
Examples:
# set: Set the player's display name to "<red>%name of player%" set the block above the victim to lava # add: add 2 to the player's health # preferably use '<a href='#EffHealth'>heal</a>' for this add argument to {blacklist::*} give a diamond pickaxe of efficiency 5 to the player increase the data value of the clicked block by 1 # remove: remove 2 pickaxes from the victim subtract 2.5 from {points::%uuid of player%} # remove all: remove every iron tool from the player remove all minecarts from {entitylist::*} # delete: delete the block below the player clear drops delete {variable} # reset: reset walk speed of player reset chunk at the targeted block
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.
Examples:
dye player's helmet blue color the player's tool red
Executes a command. This can be useful to use other plugins in triggers. If the command is a bungeecord side command, you can use the [bungeecord] option to execute command on the proxy.
Examples:
make player execute command "/home" execute console command "/say Hello everyone!" execute player bungeecord command "/alert &6Testing Announcement!"
Connect a player to a server running on your proxy, or any server supporting transfers. Read below for more information. If the server is running Minecraft 1.20.5 or above, you may specify an IP and Port to transfer a player over to that server. When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified. If the port is not provided, it will default to `25565`.
Examples:
connect all players to proxy server "hub" transfer player to server "my.server.com" transfer player to server "localhost" on port 25566
Moves the loop to the next iteration. You may also continue an outer loop from an inner one. The loops are labelled from 1 until the current loop, starting with the outermost one.
Examples:
# Broadcast online moderators loop all players: if loop-value does not have permission "moderator": continue # filter out non moderators broadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter set {_counter} to 11 while {_counter} > 0: remove 1 from {_counter} wait a second if {_counter} != 1, 2, 3, 5 or 10: continue # only print when counter is 1, 2, 3, 5 or 10 broadcast "Game starting in %{_counter}% second(s)"
Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over. Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::bar} to 1 set {_foo::sublist::foobar} to "hey" copy {_foo::*} to {_copy::*} broadcast indices of {_copy::*} # bar, sublist broadcast {_copy::bar} # 1 broadcast {_copy::sublist::foobar} # "hey!"
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!
Examples:
wait 2 minutes halt for 5 minecraft hours wait a tick
Change visibility of the given entities for the given players. If no players are given, will hide the entities from all online players.
When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.
Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.
Examples:
on spawn: if event-entity is a chicken: hide event-entity
Equips or unequips an entity with some given armor. This will replace any armor that the entity is wearing.
Examples:
equip player with diamond helmet equip player with all diamond armor unequip diamond chestplate from player unequip all armor from player unequip player's armor
Exits a given amount of loops and conditionals, or the entire trigger.
Examples:
if player has any ore: stop message "%player% has no ores!" loop blocks above the player: loop-block is not air: exit 2 sections set loop-block to water
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.
Examples:
create an explosion of force 10 at the player create an explosion of force 0 at the victim
(show|reveal|hide) [the] [entire|additional] tool[ ]tip of %item types%
Since:
2.9.0
Requirements:
Spigot 1.20.5+
Show or hide the tooltip of an item. If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it. If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
hide the entire tooltip of player's tool hide {_item}'s additional tool tip
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.
Examples:
kill the player kill all creepers in the player's world kill all endermen, witches and bats
Leash living entities to other entities. When trying to leash an Ender Dragon, Wither, Player, or a Bat, this effect will not work. See Spigot's Javadocs for more info.
Examples:
on right click: leash event-entity to player send "&aYou leashed &2%event-entity%!" to player
load [the] server icon (from|of) [the] [image] [file] %text%
Since:
2.3
Requirements:
Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.
Examples:
on load: clear {server-icons::*} loop 5 times: load server icon from file "icons/%loop-number%.png" add the last loaded server icon to {server-icons::*}
on server list ping: set the icon to a random server icon out of {server-icons::*}
Load your worlds or unload your worlds The load effect will create a new world if world doesn't already exist. When attempting to load a normal vanilla world you must define it's environment i.e "world_nether" must be loaded with nether environment
Examples:
load world "world_nether" with environment nether load the world "myCustomWorld" unload "world_nether" unload "world_the_end" without saving unload all worlds
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.
Examples:
on join: log "%player% has just joined the server!" on world change: log "Someone just went to %event-world%!" to file "worldlog/worlds.log" on command: log "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning
Paper 1.17+, Paper 1.19.1+ (Players & Look Anchors)
Forces the mob(s) or player(s) to look at an entity, vector or location. Vanilla max head pitches range from 10 to 50.
Examples:
force the player to look towards event-entity's feet
on entity explosion: set {_player} to the nearest player {_player} is set distance between {_player} and the event-location is less than 15 make {_player} look towards vector from the {_player} to location of the event-entity
force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40
Makes a living entity visible/invisible. This is not a potion and therefore does not have features such as a time limit or particles. When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility.
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.
Examples:
message "A wild %player% appeared!" message "This message is a distraction. Mwahaha!" send "Your kill streak is %{kill streak::%uuid of player%}%." to player if the targeted entity exists: message "You're currently looking at a %type of the targeted entity%!" on chat: cancel event send "[%player%] >> %message%" to all players from player
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.
Examples:
show the victim's inventory to the player open the player's inventory for the player
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.
Examples:
make all creepers pathfind towards player make all cows stop pathfinding make event-entity pathfind towards player at speed 1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.
Examples:
play wolf hearts on the clicked wolf show mob spawner flames at the targeted block to the player
Minecraft 1.18.1+ (entity emitters), Paper 1.19.4+ or Adventure API 4.12.0+ (sound seed)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.
When running 1.19+, playing a sound from an entity directly will result in the sound coming from said entity, even while moving. If the sound is custom, a location emitter will follow the entity. Do note that pitch and volume are reflected based on the entity, and Minecraft may not use the values from this syntax.
If using Paper 1.19.4+ or Adventure API 4.12.0+ you can utilize sound seeds. Minecraft sometimes have a set of sounds under one sound ID that will randomly play, to counter this, you can directly state which seed to use.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
play sound "block.note_block.pling" play sound "entity.experience_orb.pickup" with volume 0.5 to the player play sound "custom.music.1" in jukebox category at {speakerBlock} play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 on target entity for the player #1.20.1+
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.
Examples:
hide player info hide player related information in the server list reveal all player related info
2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects), 2.7 (icon and infinite)
Apply or remove potion effects to/from entities.
Examples:
apply ambient swiftness 2 to the player remove haste from the victim
on join: apply infinite potion of strength of tier {strength::%uuid of player%} to the player apply potion of strength of tier {strength::%uuid of player%} to the player for 999 days # Before 1.19.4
apply potion effects of player's tool to player apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions
2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.
Examples:
replace "<item>" in {textvar} with "%item%" replace every "&" with "§" in line 1 # The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well: on chat: replace all "kys", "idiot" and "noob" with "****" in the message
replace all stone and dirt in player's inventory and player's top inventory with diamond
Causes a bell to ring. Optionally, the entity that rang the bell and the direction the bell should ring can be specified. A bell can only ring in two directions, and the direction is determined by which way the bell is facing. By default, the bell will ring in the direction it is facing.
Rotates displays, quaternions, or vectors around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Rotating a display is a shortcut for rotating its left rotation. If the right rotation needs to be modified, it should be acquired, rotated, and re-set.
Note that rotating a quaternion/display around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating quaternions/displays around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
rotate {_quaternion} around x axis by 10 degrees rotate last spawned block display around y axis by 10 degrees rotate {_vector} around vector(1, 1, 1) by 45 rotate {_quaternion} by x 45, y 90, z 135
send [the] resource pack [from [[the] URL]] %text% to %players%
send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since:
2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.
The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.
Shears or un-shears a shearable entity with drops by shearing and a 'sheared' sound. Using with 'force' will force this effect despite the entity's 'shear state'.
Please note that..:
- If your server is not running with Paper 1.19.4 or higher, this effect will only change its 'shear state', and the 'force' effect is unavailable
- Force-shearing or un-shearing on a sheared mushroom cow is not possible
Examples:
on rightclick on a sheep holding a sword: shear the clicked sheep chance of 10% force shear the clicked sheep
Sorts a list variable using either the natural ordering of the contents or the results of the given expression. Be warned, this will overwrite the indices of the list variable.
When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)
Examples:
set {_words::*} to "pineapple", "banana", "yoghurt", and "apple" sort {_words::*} # alphabetical sort sort {_words::*} by length of input # shortest to longest sort {_words::*} in descending order by length of input # longest to shortest sort {_words::*} based on {tastiness::%input%} # sort based on custom value
Stops specific or all sounds from playing to a group of players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
stop sound "block.chest.open" for the player stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player stop all sounds for all players stop sound in the record category
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.
Examples:
teleport the player to {homes::%player%} teleport the attacker to the victim
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.
If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.
Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.
Examples:
send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds send title "Hi %player%" to player send title "Loot Drop" with subtitle "starts in 3 minutes" to all players send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second send subtitle "Party!" to all players
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
Checks to see if a bell is currently resonating. A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.
Examples:
command /setblock <material>: description: set the block at your crosshair to a different type trigger: player cannot build at the targeted block: message "You do not have permission to change blocks there!" stop set the targeted block to argument
%player% can only see (commands|system messages) [in chat]
%player% can('t|[ ]not) see any (command[s]|message[s]) [in chat]
%player% can('t|[ ]not) see all messages [in chat]
%player% can('t|[ ]not) only see (commands|system messages) [in chat]
Since:
INSERT VERSION
Requirements:
Paper
Checks whether a player can see specific message types in chat.
Examples:
if player can see all messages: send "You can see all messages." if player can only see commands: send "This game doesn't work with commands-only chat." if player can't see any messages: send action bar "Server shutting down in 5 minutes!"
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.
Examples:
the clicked block is a stone slab or a double stone slab time in the player's world is greater than 8:00 the creature is not an enderman or an ender dragon
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.
Examples:
block contains 20 cobblestone player has 4 flint and 2 iron ingots {list::*} contains 5
[the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since:
2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.
Examples:
# make players use their potions of fire resistance whenever they take any kind of fire damage on damage: damage was caused by lava, fire or burning victim is a player victim has a potion of fire resistance cancel event apply fire resistance to the victim for 30 seconds remove 1 potion of fire resistance from the victim # prevent mobs from dropping items under certain circumstances on death: entity is not a player damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison clear drops
Whether the entire or additional tooltip of an item is shown or hidden. The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.). The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners).
Examples:
send true if entire tooltip of player's tool is shown if additional tooltip of {_item} is hidden:
Checks whether living entities have an unobstructed line of sight to other entities or locations.
Examples:
player has direct line of sight to location 5 blocks to the right of player victim has line of sight to attacker player has no line of sight to location 100 blocks in front of player
%players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since:
2.4
Requirements:
Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.
Checks whether a date is in the past or future. Note that using the 'now' expression will not be in the past or future when used directly in the condition.
Examples:
set {_date} to now wait 5 seconds if {_date} is in the past: # this will be true
if now is in the future: # this will be false
set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now if {_dates::*} are in the future: # this will be true if {_dates::*} have passed: # this will be false
Checks if a block is indirectly or directly powered by redstone
Examples:
if clicked block is redstone powered: send "This block is well-powered by redstone!" if clicked block is indirectly redstone powered: send "This block is indirectly redstone powered."
off[ |-]hand[s] of %living entities% (isn't|is not|aren't|are not) raised
Since:
2.8.0
Requirements:
Paper
Checks whether an entity has one or both of their hands raised. Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating).
Examples:
on damage of player: if victim's main hand is raised: drop player's tool at player set player's tool to air
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.
Examples:
on region enter: player is the owner of the region message "Welcome back to %region%!" send "%player% just entered %region%!" to all members of the region
Checks whether a player is online. The 'connected' pattern will return false once this player leaves the server, even if they rejoin. Be aware that using the 'connected' pattern with a variable will not have this special behavior. Use the direct event-player or other non-variable expression for best results.
Examples:
player is online player-argument is offline while player is connected: wait 60 seconds send "hello!" to player
# The following will act like `{_player} is online`. # Using variables with `is connected` will not behave the same as with non-variables. while {_player} is connected: broadcast "online!" wait 1 tick
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.
Checks whether living entities are pathfinding. Can only be a living entity that is a Mob.
Examples:
make {_entity} pathfind to {_location} at speed 2 while {_entity} is pathfinding wait a second launch flickering trailing burst firework colored red at location of {_entity} subtract 10 from {defence::tower::health} clear entity within {_entity}
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.
Examples:
if plugin "Vault" is enabled: if plugin "WorldGuard" is not enabled: if plugins "Essentials" and "Vault" are enabled: if plugin "MyBrokenPlugin" is disabled:
Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore.
Examples:
on left click: event-block is set if player's tool is the preferred tool for event-block: break event-block naturally using player's tool else: cancel event
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.
Examples:
command /slimey: trigger: if chunk at player is a slime chunk: send "Yeah, it is!" else: send "Nope, it isn't"
# prevent mobs from seeing sneaking players if they are at least 4 meters apart on target: target is sneaking distance of target and the entity is bigger than 4 cancel the event
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.
Whether a location is within something else. The "something" can be a block, an entity, a chunk, a world, or a cuboid formed by two other locations. Note that using the is between condition will refer to a straight line between locations, while this condition will refer to the cuboid between locations.
Examples:
if player's location is within {_loc1} and {_loc2}: send "You are in a PvP zone!" to player
if player is in world("world"): send "You are in the overworld!" to player
if attacker's location is inside of victim: cancel event send "Back up!" to attacker and victim
Checks whether an item or an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').
Examples:
tool is of type {selected type} victim is of type {villager type}
Checks if living entities or players are left or right-handed. Armor stands are neither right nor left-handed. Paper 1.17.1+ is required for non-player entities.
Examples:
on damage of player: if victim is left handed: cancel event
Checks whether the defined strings match the input regexes (Regular expressions).
Examples:
on chat: if message partially matches "\d": send "Message contains a digit!" if message doesn't match "[A-Za-z]+": send "Message doesn't only contain letters!"
on resource pack response: if the resource pack wasn't accepted: kick the player due to "You have to install the resource pack to play in this server!"
%date% (was|were)( more|(n't| not) less) than %time span% [ago]
%date% (was|were)((n't| not) more| less) than %time span% [ago]
Since:
2.0
Tests whether a given real time was more or less than some time span ago.
Examples:
command /command-with-cooldown: trigger: {command::%player's uuid%::last-usage} was less than a minute ago: message "Please wait a minute between uses of this command." stop set {command::%player's uuid%::last-usage} to now # ... actual command trigger here ...
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed
parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true
Examples:
if player's health is greater than or equal to 4: send "Your health is okay so far but be careful!"
else if player's health is greater than 2: send "You need to heal ASAP, your health is very low!"
else: # Less than 2 hearts send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"
parse if plugin "SomePluginName" is enabled: # parse if %condition% # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section
Filters a variable list based on the supplied conditions. Unlike the filter expression, this effect maintains the indices of the filtered list. It also supports filtering based on meeting any of the given criteria, rather than all, like multi-line if statements.
Examples:
set {_a::*} to integers between -10 and 10
filter {_a::*} to match: input is a number mod(input, 2) = 0 input > 0
Loop sections repeat their code with multiple values.
A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.
Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.
List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).
Examples:
loop all players: send "Hello %loop-player%!" to loop-player
loop items in player's inventory: if loop-item is dirt: set loop-item to air
loop 10 times: send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc. wait 1 second
loop {Coins::*}: set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200
While Loop sections are loops that will just keep repeating as long as a condition is met.
Examples:
while size of all players < 5: send "More players are needed to begin the adventure" to all players wait 5 seconds
set {_counter} to 1 do while {_counter} > 1: # false but will increase {_counter} by 1 then get out add 1 to {_counter}
# Be careful when using while loops with conditions that are almost # always true for a long time without using 'wait %timespan%' inside it, # otherwise it will probably hang and crash your server. while player is online: give player 1 dirt wait 1 second # without using a delay effect the server will crash
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.
Examples:
on anvil prepare: 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
Called when a block broken by a player drops something.
event-player: The player that broke the block
past event-block: The block that was broken
event-block: The block after being broken
event-items (or drops): The drops of the block
event-entities: The entities of the dropped items
If the breaking of the block leads to others being broken, such as torches, they will appearin "event-items" and "event-entities".
Examples:
on block drop: broadcast event-player broadcast past event-block broadcast event-block broadcast event-items broadcast event-entities on block drop of oak log:
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.
Called whenever a player chats. Use chat format to change message format. Use chat recipients to edit chat recipients.
Examples:
on chat: if player has permission "owner": set chat format to "&amp;amp;amp;lt;red&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;light red&amp;amp;amp;gt;[message]" else if player has permission "admin": set chat format to "&amp;amp;amp;lt;light red&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;orange&amp;amp;amp;gt;[message]" else: #default message format set chat format to "&amp;amp;amp;lt;orange&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;white&amp;amp;amp;gt;[message]"
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. 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 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 click on chest[facing=north]: on click on campfire[lit=true]:
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.
Examples:
on command: on command "/stop": on command "pm Njol ":
Called when the 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 greater than 15 kick the player due to "The last 5 slots are reserved for VIP players."
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression
Examples:
on enchant prepare: set enchant offer 1 to sharpness 1 set the cost of enchant offer 1 to 10 levels
Called when an enderman gets mad because a player looked at them. Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
# Stops endermen from getting angry players with the permission "safeFrom.enderman" on enderman enrage: if player has permission "safeFrom.enderman": cancel event
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively. event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
on sheep eat: kill event-entity broadcast "A sheep stole some grass!"
on falling block land: event-entity is a falling dirt cancel event
[on] (entit(y|ies)|%*-entitydatas%) transform[ing] [due to %transform reasons%]
Since:
2.8.0
Called when an entity is about to be replaced by another entity. 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 a zombie transforming due to curing: on mooshroom transforming: on zombie, skeleton or slime transform:
Called when a player's experience cooldown changes. Experience cooldown is how long until a player can pick up another orb of experience.
Examples:
on player experience cooldown change: broadcast event-player broadcast event-timespan broadcast past event-timespan broadcast xp cooldown change reason
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 firework explode on firework exploding colored red, light green and black on firework explosion colored light green: broadcast "A firework colored %colors% was exploded at %location%!"
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).
Called when a tree, giant mushroom or plant grows to next stage. "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: 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]:
Called whenever a player swaps the items in their main- and offhand slots. 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:
on swap hand items: event-player's tool is a diamond sword cancel event
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).
Examples:
on heal: on player healing from a regeneration potion: on healing of a zombie, cow or a wither: heal reason is healing potion cancel event
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.
Examples:
on block ignite: if event-block is a ladder: cancel event
Called when an entity or block (e.g. hopper) tries to move items directly from one inventory to another. 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:
on inventory item move: broadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.
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 their inventory, or a dispenser dispensing an item (not shooting it).
Examples:
on item spawn of iron sword: broadcast "Someone dropped an iron sword!"
Called when the 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!"
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.
Examples:
on language change: if player's language starts with "en": send "Hello!"
[on] %entity type% (move|walk|step) or (turn[ing] around|rotate)
[on] %entity type% (turn[ing] around|rotate) or (move|walk|step)
Since:
2.6, 2.8.0 (turn around)
Requirements:
Paper 1.16.5+ (entity move)
Called when a player or entity moves or rotates their head. 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:
on player move: 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
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.
Examples:
# prevents sand from falling on block physics: block is sand cancel event
Called when a piglin finishes bartering. A piglin may start bartering after picking up an item on its bartering list. Cancelling will prevent piglins from dropping items, but will still make them pick up the input.
Examples:
on piglin barter: if barter drops contain diamond: send "Diamonds belong in the money pit!" to player cancel event
Called when a player has slept long enough to count as passing the night/storm. Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
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. 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.
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.
Examples:
on projectile hit: event-projectile is arrow delete event-projectile
Called when a player is firing a bow and the server is choosing an arrow to use. 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:
on player ready arrow: selected bow's name is "Spectral Bow" if selected arrow is not a spectral arrow: cancel event
Called when a player takes action on a resource pack request sent via the 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:
on resource pack request response: 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!"
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
on load: set {running::%script%} to true on unload: set {running::%script%} to false
[on] send[ing] [of [the]] [server] command[s] list
[on] [server] command list send
Since:
2.8.0
Called when the server sends a list of commands to the player. This usually happens on join. The sent commands can be modified via the sent commands expression. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. 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).
on server list ping: 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::*}
Called when a player stops using an item. For example, when the player releases the interact button when holding a bow, an edible item, or a spyglass. Note that event-timespan will return the time the item was used for.
Examples:
on player stop using item: broadcast "%player% used %event-item% for %event-timespan%."
This event can be used to listen to teleports from non-players or player entities respectively. 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 teleport: on player teleport: on creeper teleport:
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.
Called when a world is initialized. As all default worlds are initialized 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.
every 2 seconds in "world": every minecraft hour in "flatworld": every tick in "world": # can cause lag depending on the code inside the event every minecraft days in "plots":
armor, armor toughness, attack damage, attack knockback, attack speed, block break speed, block interaction range, burning time, entity interaction range, explosion knockback resistance, fall damage multiplier, flying speed, follow range, generic armor, generic armor toughness, generic attack damage, generic attack knockback, generic attack speed, generic burning time, generic explosion knockback resistance, generic fall damage multiplier, generic flying speed, generic follow range, generic gravity, generic jump strength, generic knockback resistance, generic luck, generic max absorption, generic max health, generic movement efficiency, generic movement speed, generic oxygen bonus, generic safe fall distance, generic scale, generic step height, generic tempt range, generic water movement efficiency, gravity, horse jump strength, jump strength, knockback resistance, luck, max absorption, max health, mining efficiency, movement efficiency, movement speed, oxygen bonus, player block break speed, player block interaction range, player entity interaction range, player mining efficiency, player sneaking speed, player submerged mining speed, player sweeping damage ratio, safe fall distance, scale, sneaking speed, spawn reinforcements, step height, submerged mining speed, sweeping damage ratio, tempt range, water movement efficiency, zombie spawn reinforcements
Since:
2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info. NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.
Examples:
set block at player to campfire[lit=false] set target block of player to oak stairs[facing=north;waterlogged=true] set block at player to grass_block[snowy=true] set loop-block to minecraft:chest[facing=north] set block above player to oak_log[axis=y] set target block of player to minecraft:oak_leaves[distance=2;persistent=false]
lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since:
2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.
color of the sheep is red or black set the color of the block to green message "You're holding a &amp;amp;lt;%color of tool%&amp;amp;gt;%color of tool%&amp;amp;lt;reset&amp;amp;gt; wool block"
command /push [&amp;amp;amp;lt;player&amp;amp;amp;gt;]: trigger: if arg-1 is not set: if command sender is console: send "You can't push yourself as a console :\" to sender stop push sender upwards with force 2 send "Yay!" else: push arg-1 upwards with force 2 send "Yay!" to sender and arg-1
sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, campfire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, world border, flying into a wall, cramming, poison, sonic boom, suffocate, custom, kill, killed, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since:
2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.
Examples:
set the block below the victim to a chest loop blocks from the block infront of the player to the block 10 below the player: set the block behind the loop-block to water
aqua affinity, bane of arthropods, binding curse, blast protection, breach, channeling, channelling, curse of binding, curse of vanishing, density, depth strider, efficiency, feather falling, fire aspect, fire protection, flame, fortune, frost walker, impaling, infinity, knockback, looting, loyalty, luck of the sea, lure, mending, multi-shot, multishot, piercing, power, projectile protection, protection, punch, quick charge, respiration, riptide, sharpness, silk touch, smite, soul speed, sweeping edge, swift sneak, thorns, unbreaking, vanishing curse, wind burst
Since:
1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway. NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'. As of Minecraft 1.21 this will also support custom enchantments using namespaces, ex: 'myenchants:explosive'.
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.
Examples:
entity is a zombie or creeper player is an op projectile is an arrow shoot a fireball from the player
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).
drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since:
2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.
barrel inventory, a loom inventory, a blast furnace inventory, workbench inventory, ender chest inventory, loom inventory, a workbench inventory, hopper inventory, a merchant inventory, a hopper inventory, chiseled bookshelf, an ender chest inventory, new smithing table, bookshelf, a jukebox, beacon inventory, shulker box inventory, a barrel inventory, a shulker box inventory, lectern inventory, chest inventory, a villager inventory, a smoker inventory, a brewing stand inventory, a smithing inventory, grindstone inventory, a crafter inventory, a crafting table inventory, a player inventory, decorated pot, furnace inventory, a creative inventory, blast furnace inventory, upgrade gear, a composter inventory, an enchanting table inventory, jukebox, a dropper inventory, a cartography table inventory, a upgrade gear, smoker inventory, composter inventory, a chest inventory, upgrade gear table, a upgrade gear table, dispenser inventory, player inventory, stonecutter inventory, a stonecutter inventory, a decorated pot, a lectern inventory, merchant inventory, cartography table inventory, a chiseled bookshelf, a new smithing table, a furnace inventory, anvil inventory, a dispenser inventory, a grindstone inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, a beacon inventory, a bookshelf, crafter inventory, creative inventory, crafting table inventory, an anvil inventory
Since:
2.2-dev32
Minecraft has several different inventory types with their own use cases.
[<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since:
1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.
Examples:
set {_item} to type of the targeted block {_item} is a torch
first person left handed, left handed in first person, right handed in third person, first person left hand, no transform, the ground, third person right hand, third person right handed, right handed in first person, menu, head, third person left hand, first person right handed, first person right hand, fixed position, left handed in third person, gui, ground, fixed, third person left handed
Since:
INSERT VERSION
Represents the transform setting of an item display.
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.
Examples:
give 4 torches to the player add all slabs to the inventory of the block player's tool is a diamond sword of sharpness remove a pickaxes of fortune 4 from {stored items::*} set {_item} to 10 of every upside-down stair block is dirt or farmland
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.
<number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since:
2.0
Requirements:
Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.
Examples:
add 10£ to the player's account remove Fr. 9.95 from the player's money set the victim's money to 0 increase the attacker's balance by the level of the victim * 100
[-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since:
1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.
Examples:
set the player's health to 5.5 set {_temp} to 2*{_temp} - 2.5
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
2.0 beta 8
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.
Examples:
set {_p} to "Notch" parsed as an offlineplayer # returns Notch even if they're offline
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.
Examples:
set {_p} to "Notch" parsed as a player # returns &amp;amp;lt;none&amp;amp;gt; unless Notch is actually online or starts with Notch like Notchan set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.
Examples:
set tool of player to dirt delete helmet of the victim set the color of the player's tool to green enchant the player's chestplate with projectile protection 5
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.
Examples:
broadcast "Hello World!" message "Hello %player%" message "The id of ""%type of tool%"" is %id of tool%."
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.
Examples:
every 5 minecraft days: wait a minecraft second and 5 ticks every 10 mc days and 12 hours: halt for 12.7 irl minutes, 12 hours and 120.5 seconds
See the type name patterns of all types - including this one
Since:
2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.
Examples:
{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5 {variable} is a type # check whether the variable contains a type, e.g. number or player {variable} is an object # will always succeed if the variable is set as everything is an object, even types. disable PvP in the event-world kill the loop-entity
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).
date(year: number, month: number, day: number, hour: number = 0, minute: number = 0, second: number = 0, millisecond: number = 0, zone_offset: number = NaN, dst_offset: number = NaN)
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).
Examples:
date(2014, 10, 1) # 0:00, 1st October 2014 date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990 date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)
Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this article.
Examples:
command /balance: aliases: bal executable by: players trigger: set {_money} to formatNumber({money::%sender's uuid%}) send "Your balance: %{_money}%" to sender
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.
Examples:
# TELEPORTING teleport player to location(1,1,1, world "world") teleport player to location(1,1,1, world "world", 100, 0) teleport player to location(1,1,1, world "world", yaw of player, pitch of player) teleport player to location(1,1,1, world of player) teleport player to location(1,1,1, world("world")) teleport player to location({_x}, {_y}, {_z}, {_w}, {_yaw}, {_pitch}) # SETTING BLOCKS set block at location(1,1,1, world "world") to stone set block at location(1,1,1, world "world", 100, 0) to stone set block at location(1,1,1, world of player) to stone set block at location(1,1,1, world("world")) to stone set block at location({_x}, {_y}, {_z}, {_w}) to stone # USING VARIABLES set {_l1} to location(1,1,1) set {_l2} to location(10,10,10) set blocks within {_l1} and {_l2} to stone if player is within {_l1} and {_l2}: # OTHER kill all entities in radius 50 around location(1,65,1, world "world") delete all entities in radius 25 around location(50,50,50, world "world_nether") ignite all entities in radius 25 around location(1,1,1, world of player)
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.
Returns a offline player from their name or UUID. This function will still return the player if they're online. If Paper 1.16.5+ is used, the 'allowLookup' parameter can be set to false to prevent this function from doing a web lookup for players who have not joined before. Lookups can cause lag spikes of up to multiple seconds, so use offline players with caution.
Examples:
set {_p} to offlineplayer("Notch") set {_p} to offlineplayer("069a79f4-44e9-4726-a5be-fca90e38aaf5") set {_p} to offlineplayer("Notch", false)
Returns an online player from their name or UUID, if player is offline function will return nothing. Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
Examples:
set {_p} to player("Notch") # will return an online player whose name is or starts with 'Notch' set {_p} to player("Notch", true) # will return the only online player whose name is 'Notch' set {_p} to player("069a79f4-44e9-4726-a5be-fca90e38aaf5") # &lt;none&gt; if player is offline
Returns a RGB color from the given red, green and blue parameters. Alpha values can be added optionally, but these only take affect in certain situations, like text display backgrounds.
Examples:
dye player's leggings rgb(120, 30, 45) set the colour of a text display to rgb(10, 50, 100, 50)
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.
command /broadcast <string>: usage: A command for broadcasting a message to all players. permission: skript.command.broadcast permission message: You don't have permission to broadcast messages aliases: /bc executable by: players and console cooldown: 15 seconds cooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%. cooldown bypass: skript.command.broadcast.admin cooldown storage: {cooldown::%player%} trigger: broadcast the argument
Functions are structures that can be executed with arguments/parameters to run code. They can also return a value to the trigger that is executing the function. Note that local functions come before global functions execution
Examples:
function sayMessage(message: text): broadcast {_message} # our message argument is available in '{_message}'
local function giveApple(amount: number) :: item: return {_amount} of apple
function getPoints(p: player) returns number: return {points::%{_p}%}
Options are used for replacing parts of a script with something else. For example, an option may represent a message that appears in multiple locations. Take a look at the example below that showcases this.
Examples:
options: no_permission: You're missing the required permission to execute this command!
Used for defining variables present within a script. This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Examples:
variables: {joins} = 0 {balance::%player%} = 0
on join: add 1 to {joins} message "Your balance is %{balance::%player%}%"
Returns the item the entities are currently using (ie: the food they're eating, the bow they're drawing back, etc.). This cannot be changed. If an entity is not using any item, this will return null.
Examples:
on damage of player: if victim's active tool is a bow: interrupt player's active item use
Returns the time that the entities have either spent using an item, or the time left for them to finish using an item. If an entity is not using any item, this will return 0 seconds.
Examples:
on right click: broadcast player's remaining item use time wait 1 second broadcast player's item use time
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.
Examples:
# Set targeted crop to fully grown crop set age of targeted block to maximum age of targeted block
# Spawn a baby cow that will only need 1 minute to become an adult spawn a baby cow at player set age of last spawned entity to -1200 # in ticks = 60 seconds
Returns all of the scripts, or just the enabled or disabled ones.
Examples:
command /scripts: trigger: send "All Scripts: %scripts%" to player send "Loaded Scripts: %enabled scripts%" to player send "Unloaded Scripts: %disabled scripts%" to player
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.
Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples:
message "There are %number of all players% players online!"
Returns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair. The default value of max cost set by vanilla Minecraft is 40.
Examples:
on inventory click: if {AnvilRepairSaleActive} = true: wait a tick # recommended, to avoid client bugs set anvil repair cost to anvil repair cost * 50% send "Anvil repair sale is ON!" to player
on inventory click: player have permission "anvil.repair.max.bypass" set max repair cost of event-inventory to 99999
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.
Examples:
give the item-argument to the player-argument damage the player-argument by the number-argument give a diamond pickaxe to the argument add argument 1 to argument 2 heal the last argument
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.
Examples:
set the player's health to 10 - the player's health loop (argument + 2) / 5 times: message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%" message "You have %health of player * 2% half hearts of HP!"
Equipment of living entities, i.e. the boots, leggings, chestplate or helmet.
Examples:
set chestplate of the player to a diamond chestplate helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.
Examples:
on damage: if attack cooldown of attacker < 1: set damage to 0 send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.
Examples:
on damage: victim is a creeper damage the attacked by 1 heart
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.
Examples:
on damage: attacker is a player health of attacker is less than or equal to 2 damage victim by 1 heart
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.
NOTE: Offline players can not have their bed location changed, only online players.
Examples:
if bed of player exists: teleport player the the player's bed else: teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location set the safe bed location of player to spawn location of world("world") # safe/valid bed location
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).
Examples:
# damage player in deserts constantly every real minute: loop all players: biome at loop-player is desert damage the loop-player by 1
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
Gets the speed at which the given player would break this block, taking into account tools, potion effects, whether or not the player is in water, enchantments, etc. The returned value is the amount of progress made in breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the player jumps/enters water.
Examples:
on left click using diamond pickaxe: event-block is set send "Break Speed: %break speed for player%" to player
Gets the sound that a given block, blockdata, or itemtype will use in a specific scenario. This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
Examples:
play sound (break sound of dirt) at all players set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.
Examples:
loop blocks above the player: loop blocks between the block below the player and the targeted block: set the blocks below the player, the victim and the targeted block to air set all blocks within {loc1} and {loc2} to stone set all blocks within chunk at player to air
The pages of a book (Supports Skript's chat format) Note: In order to modify the pages of a new written book, you must have the title and author of the book set. Skript will do this for you, but if you want your own, please set those values.
Examples:
on book sign: message "Book Pages: %pages of event-item%" message "Book Page 1: %page 1 of event-item%"
set page 1 of player's held item to "Book writing"
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case
Examples:
"Oops!" in lowercase # oops! "oops!" in uppercase # OOPS! "hellO i'm steve!" in proper case # HellO I'm Steve! "hellO i'm steve!" in strict proper case # Hello I'm Steve! "spAwn neW boSs ()" in camel case # spAwnNeWBoSs() "spAwn neW boSs ()" in strict camel case # spawnNewBoss() "geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer() "geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber() "Hello Player!" in snake case # Hello_Player! "Hello Player!" in lower snake case # hello_player! "Hello Player!" in upper snake case # HELLO_PLAYER! "What is your name?" in kebab case # What-is-your-name? "What is your name?" in lower kebab case # what-is-your-name? "What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?
function is_in_order(letters: strings) :: boolean: loop {_letters::*}: set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if: {_previous-codepoint} is set # if the codepoint of the current character is not # 1 more than the codepoint of the previous character # then the letters are not in order {_codepoint} - {_previous-codepoint} is not 1 then: return false
set {_previous-codepoint} to {_codepoint} return true
All characters between two given characters, useful for generating random strings. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. The ASCII table linked here shows this ordering for the first 256 characters. If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression. If strings of more than one character are given, only the first character of each is used.
Examples:
loop characters from "a" to "f": broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz send alphanumeric characters between "0" and "z"
The color of an item, entity, block, firework effect, or text display. This can also be used to color chat messages with "<%color of ...%>this text is colored!". Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
Examples:
on click on wool: message "This wool block is <%color of block%>%color of block%<reset>!" set the color of the block to black
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.
Examples:
on chat: set message to colored message # Safe; only colors get parsed command /fade <player>: trigger: set display name of the player-argument to uncolored display name of the player-argument command /format <text>: trigger: message formatted text-argument # Safe, because we're sending to whoever used this command
The command that caused an 'on command' event (excluding the leading slash and all arguments)
Examples:
# prevent any commands except for the /exit command during some game on command: if {game::%player%::playing} is true: if the command is not "exit": message "You're not allowed to use commands during the game" cancel the event
main command label of command "skript" description of command "help" label of command "pl" usage of command "help" aliases of command "bukkit:help" permission of command "/op" command "op"'s permission message command "sk"'s plugin owner
command /greet <player>: usage: /greet <target> trigger: if arg-1 is sender: send "&cYou can't greet yourself! Usage: %the usage%" stop send "%sender% greets you!" to arg-1 send "You greeted %arg-1%!"
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%
Examples:
make the command sender execute "/say hi!"
on command: log "%executor% used command /%command% %arguments%" to "commands.log"
# make all player's compasses target a player stored in {compass::target::%player%} every 5 seconds: loop all players: set the loop-player's compass target to location of {compass::target::%%loop-player%}
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.
Examples:
command /home: cooldown: 10 seconds cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%. trigger: teleport player to {home::%player%}
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.
Examples:
give a diamond sword of sharpness 3 to the player kill the creeper kill all powered creepers in the wolf's world projectile is an arrow
How much damage is done in a entity/vehicle/item damage events. For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart). For items, it's the amount of durability damage the item will be taking.
Examples:
on item damage: event-item is any tool clear damage # unbreakable tools as the damage will be 0 on damage: increase the damage by 2
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks
Examples:
give player diamond sword with damage value 100 set player's tool to diamond hoe damaged by 250 give player diamond sword with damage 700 named "BROKEN SWORD" set {_item} to diamond hoe with damage value 50 named "SAD HOE" set target block of player to wool with data value 1 set target block of player to potato plant with data value 7
The difference between two values Supported types include numbers, dates and times.
Examples:
if difference between {command::%player%::lastuse} and now is smaller than a minute: message "You have to wait a minute before using this command again!"
thrust the player upwards set the block behind the player to water loop blocks above the player: set {_rand} to a random integer between 1 and 10 set the block {_rand} meters south east of the loop-block to stone block in horizontal facing of the clicked entity from the player is air spawn a creeper 1.5 meters horizontally behind the player spawn a TNT 5 meters above and 2 meters horizontally behind the player thrust the last spawned TNT in the horizontal direction of the player with speed 0.2 push the player upwards and horizontally forward at speed 0.5 push the clicked entity in in the direction of the player at speed -0.5 open the inventory of the block 2 blocks below the player to the player teleport the clicked entity behind the player grow a regular tree 2 meters horizontally behind the player
Returns or changes the billboard setting of displays. This describes the axes/points around which the display can pivot. Displays spawn with the 'fixed' billboard by default. Resetting this expression will also set it to 'fixed'.
Examples:
set billboard of the last spawned text display to center
Returns or changes the brightness override of displays. Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override. Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option. NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
Examples:
set sky light override of the last spawned text display to 7 subtract 3 from the block light level override of the last spawned text display if sky light level override of {_display} is 5: clear brightness override of {_display}
Returns or changes the height or width of displays. The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it). If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
Examples:
set display height of the last spawned text display to 2.5
Returns or changes the interpolation delay/duration of displays. Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state. Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate. Resetting either value will return that value to 0.
Examples:
set interpolation delay of the last spawned text display to 2 ticks
The teleport duration of displays is the amount of time it takes to get between locations. 0 means that updates are applied immediately. 1 means that the display entity will move from current position to the updated one over one tick. Higher values spread the movement over multiple ticks. Max of 59 ticks.
Examples:
set teleport delay of the last spawned text display to 2 ticks teleport last spawned text display to {_location} wait 2 ticks message "display entity has arrived at %{_location}%"
Returns or changes the transformation rotation of displays. The left rotation is applied first, with the right rotation then being applied based on the rotated axis.
Examples:
set left transformation rotation of last spawned block display to quaternion(1, 0, 0, 0) # reset block display
Returns or changes the view range of displays. Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range. For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
Examples:
set view range of the last spawned text display to 2.9
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.
The first, last, range or a random element of a set, e.g. a list variable. See also: random expression
Examples:
broadcast the first 3 elements of {top players::*} set {_last} to last element of {top players::*} set {_random player} to random element out of all players send 2nd last element of {top players::*} to player set {page2::*} to elements from 11 to 20 of {top players::*}
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.
All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. e.g. all players, all creepers in the player's world, or players in radius 100 of the player.
Examples:
kill all creepers in the player's world send "Psst!" to all players within 100 meters of the player give a diamond to all ops heal all tamed wolves in radius 2000 around {town center} delete all monsters in chunk at player size of all players within {_corner::1} and {_corner::2}}
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.
Examples:
on damage of player: send "You are wounded!" to victim set victim's attack speed attribute to 2
on player experience cooldown change: if xp cooldown change reason is plugin: #Changed by a plugin else if xp cooldown change reason is orb pickup: #Changed by picking up xp orb
The experience cooldown of a player. Experience cooldown is how long until a player can pick up another orb of experience. The cooldown of a player must be 0 to pick up another orb of experience.
Examples:
send experience cooldown of player set the xp pickup cooldown of player to 1 hour if exp collection cooldown of player >= 10 minutes: clear the experience pickup cooldown of player
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.
Examples:
on explode: set the explosion's block yield to 10%
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information
Examples:
on explosion prime: set the yield of the explosion to 10
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information
Examples:
on spawn of a creeper: set the explosive yield of the event-entity to 10
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')
Examples:
# makes a bridge loop blocks from the block below the player in the horizontal facing of the player: set loop-block to cobblestone
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.
Examples:
send "congrats on being staff!" to all players where [player input has permission "staff"]
Represents a 'firework effect' which can be used in the launch firework effect.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.
Examples:
command /date: trigger: send "Full date: %now formatted human-readable%" to sender send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.
Examples:
on teleport: former world was "world_nether" # or 'world was' world will be "world" # or 'world after the event is' on tool change: past tool is an axe the tool after the event will be air on weather change: set {weather::%world%::old} to past weather set {weather::%world%::current} to the new weather
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not furnace, as furnace is not an existing expression. Note that the result and the result slot refer to separate things. the result is the product in a smelt event and the result slot is the output slot of a furnace (where the result will end up). Note that if the result in a smelt event is changed to an item that differs in type from the items currently in the result slot, the smelting will fail to complete (the item will attempt to smelt itself again). Note that if values other than the result are changed, event values may not accurately reflect the actual items in a furnace. Thus you may wish to use the event block in this case (e.g. the fuel slot of the event-block) to get accurate values if needed.
Examples:
set the fuel slot of the clicked block to a lava bucket set the block's ore slot to 64 iron ore give the result of the block to the player clear the result slot of the block
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed. If you have LuckPerms, ensure you have vault integration enabled in the luck perms configurations.
Examples:
on join: broadcast "%group of player%" # this is the player's primary group broadcast "%groups of player%" # this is all of the player's groups
Returns the hanging entity or remover in hanging break and place events.
Examples:
on break of item frame: if item of hanging entity is diamond pickaxe: cancel event if hanging remover is a player: send "You can't break that item frame!" to hanging remover
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.
MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!
Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.
Examples:
command /setpass <text>: trigger: set {password::%uuid of player%} to text-argument hashed with SHA-256 command /login <text>: trigger: if text-argument hashed with SHA-256 is {password::%uuid of player%}: message "Login successful." else: message "Wrong password!"
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.
Examples:
set the block at the player's head to air set the block in front of the player's eyes to glass loop blocks in front of the player's head:
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).
Gets and/or sets the (max) domestication of a horse. The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse). The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
Examples:
function domesticateAndTame(horse: entity, p: offline player, i: int = 10): add {_i} to domestication level of {_horse} if domestication level of {_horse} >= max domestication level of {_horse}: tame {_horse} set tamer of {_horse} to {_p}
The currently selected hotbar slot. To retrieve its number use Slot Index expression. Use future and past tense to grab the previous slot in an item change event, see example.
Examples:
message "%player's current hotbar slot%" set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left
on item held change: if the selected hotbar slot was a diamond: set the currently selected hotbar slot to slot 5 of player
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.
Examples:
on server list ping: clear the hover list add "&aWelcome to the &6Minecraft &aserver!" to the hover list add "" to the hover list # A blank line add "&cThere are &6%online players count% &conline players!" to the hover list
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.
Examples:
set {_first} to the first index of "@" in the text argument if {_s} contains "abc": set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.
Examples:
set {l::*} to "some", "cool" and "values" broadcast "%indices of {l::*}%" # result is 1, 2 and 3
set {_leader-board::first} to 17 set {_leader-board::third} to 30 set {_leader-board::second} to 25 set {_leader-board::fourth} to 42 set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first
on inventory item move: holder of event-initiator-inventory is a chest broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
Represents the input in a filter expression or sort effect. For example, if you ran 'broadcast "something" and "something else" where [input is "something"] the condition would be checked twice, using "something" and "something else" as the inputs. The 'input index' pattern can be used when acting on a variable to access the index of the input.
Examples:
send "congrats on being staff!" to all players where [input has permission "staff"] sort {_list::*} based on length of input index
Gets the amount of rows/slots, viewers and holder of an inventory.
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
Examples:
event-inventory's amount of rows holder of player's top inventory {_inventory}'s viewers
Represents a slot in an inventory. It can be used to change the item in an inventory too.
Examples:
if slot 0 of player is air: set slot 0 of player to 2 stones remove 1 stone from slot 0 of player add 2 stones to slot 0 of player clear slot 1 of player
Change the cooldown of a specific material to a certain amount of Timespan.
Examples:
on right click using stick: set item cooldown of player's tool for player to 1 minute set item cooldown of stone and grass for all players to 20 seconds reset item cooldown of cobblestone and dirt for all players
set the item transform of the last spawned item display to first person left handed set the item transform of the last spawned item display to no transform # Reset to default
An item associated with an entity. For dropped item entities, it gets the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item. Other entities do not have items associated with them.
Examples:
item of event-entity
set the item inside of event-entity to a diamond sword named "Example"
Items or blocks of a specific type, useful for looping.
Examples:
loop items of type ore and log: block contains loop-item message "Theres at least one %loop-item% in this block" drop all blocks at the player # drops one of every block at the player
All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.
Examples:
loop all items in the player's inventory: loop-item is enchanted remove loop-item from the player set {inventory::%uuid of player%::*} to items in the player's inventory
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.
Examples:
message "Online players: %join all players' names with "" | ""%" # %all players% would use the default "x, y, and z" set {_s::*} to the string argument split at ","
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.
Examples:
spawn a priest set {healer::%spawned priest%} to true shoot an arrow from the last spawned entity ignite the shot projectile drop a diamond sword push last dropped item upwards teleport player to last struck lightning delete last launched firework
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.
Examples:
command /onlinefor: trigger: send "You have been online for %difference between player's last login and now%." send "You first joined the server %difference between player's first login and now% ago."
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
Examples:
# use the exp bar as mana on rightclick with a blaze rod: player's level progress is larger than 0.2 shoot a fireball from the player reduce the player's level progress by 0.2 every 2 seconds: loop all players: level progress of loop-player is smaller than 0.9: increase level progress of the loop-player by 0.1 else: set level progress of the loop-player to 0.99 on xp spawn: cancel event
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.
Examples:
# set vampire players standing in bright sunlight on fire every 5 seconds: loop all players: {vampire::%uuid of loop-player%} is true sunlight level at the loop-player is greater than 10 ignite the loop-player for 5 seconds
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.
Examples:
set {home::%uuid of player%} to the location of the player message "You home was set to %player's location% in %player's world%."
# Countdown loop 10 times: message "%11 - loop-number%" wait a second
# Generate a 10x10 floor made of randomly colored wool below the player loop blocks from the block below the player to the block 10 east of the block below the player: loop blocks from the loop-block to the block 10 north of the loop-block: set loop-block-2 to any wool
loop {top-balances::*}: loop-iteration <= 10 send "#%loop-iteration% %loop-index% has $%loop-value%"
The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them. Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
Examples:
on right click: send "%event-entity% has been in love for %love time of event-entity% more than you!" to player
An expression to obtain the lowest or highest solid (impassable) block at a location. Note that the y-coordinate of the location is not taken into account for this expression.
Examples:
teleport the player to the block above the highest block at the player set the highest solid block at the player's location to the lowest solid block at the player's location
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.
The maximum durability of an item. Changing requires Minecraft 1.20.5+ Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
Examples:
maximum durability of diamond sword if max durability of player's tool is not 0: # Item is damageable set max durability of player's tool to 5000 add 5 to max durability of player's tool reset max durability of player's tool delete max durability of player's tool
Returns the max duration an item can be used for before the action completes. E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow. Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
Examples:
on right click: broadcast max usage duration of player's tool
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
Examples:
on server list ping: set the max players count to (online players count + 1)
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.
Examples:
on item mend: set the mending repair amount to 100
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, the death message of a death event or the broadcasted message in a broadcast event. This expression is mostly useful for being changed.
Examples:
on chat: player has permission "admin" set message to "&c%message%"
on first join: set join message to "Welcome %player% to our awesome server!"
on join: player has played before set join message to "Welcome back, %player%!"
on quit: if {vanish::%player's uuid%} is set: clear quit message else: set quit message to "%player% left this awesome server!"
on death: set the death message to "%player% died!"
on broadcast: set broadcast message to "&a[BROADCAST] %broadcast message%"
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.
Examples:
command /stuck: executable by: players trigger: teleport player to the center of player's location send "You're no longer stuck."
How much virtual money a player has (can be changed).
Examples:
message "You have %player's money%" # the currency name will be added automatically remove 20$ from the player's balance # replace '$' by whatever currency you use add 200 to the player's account # or omit the currency altogether
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.
Examples:
give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player set tool of player to the player's tool named "<gold>Wand" set the name of the player's tool to "<gold>Wand" open hopper inventory named "Magic Hopper" to player
Gets the entity nearest to a location or another entity.
Examples:
kill the nearest pig and cow relative to player teleport player to the nearest cow relative to player teleport player to the nearest entity relative to player
The number of uppercase, lowercase, or digit characters in a string.
Examples:
#Simple Chat Filter on chat: if number of uppercase chars in message / length of message > 0.5 cancel event send "<red>Your message has to many caps!" to player
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'
Examples:
loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5 loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5 loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. real online player count always return the real count of online players and can't be changed.
Examples:
on server list ping: # This will make the max players count 5 if there are 4 players online. set the fake max players count to (online player count + 1)
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
Examples:
set {var} to line 1 parsed as number on chat: set {var::*} to message parsed as "buying %items% for %money%" if parse error is set: message "%parse error%" else if {var::*} is set: cancel event remove {var::2} from the player's balance give {var::1::*} to the player
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.
Examples:
set {var} to line 1 parsed as integer if {var} is not set: parse error is set: message "<red>Line 1 is invalid: %last parse error%" else: message "<red>Please put an integer on line 1!"
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle
Examples:
#for 1.11 and lower passenger of the minecart is a creeper or a cow the saddled pig's passenger is a player #for 1.11.2+ passengers of the minecart contains a creeper or a cow the boat's passenger contains a pig add a cow and a zombie to passengers of last spawned boat set passengers of player's vehicle to a pig and a horse remove all pigs from player's vehicle clear passengers of boat
set damage to 10% of victim's health set damage to 125 percent of damage set {_result} to {_percent} percent of 999 set {_result::*} to 10% of {_numbers::*} set experience to 50% of player's total experience
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).
Examples:
command /ping <player=%player%>: trigger: send "%arg-1%'s ping is %arg-1's ping%"
The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective. This expression will not return anything due to Bukkit limitations.
Examples:
add "Skript" and "Njol" to chat completions of all players remove "text" from {_p}'s chat completions clear player's chat completions
The amount of time before an entity can use a portal. By default, it is 15 seconds after exiting a nether portal or end gateway. Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown. Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players.
Examples:
on portal: wait 1 tick set portal cooldown of event-entity to 5 seconds
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.
Examples:
set {_p} to potion effect of speed of tier 1 without particles for 10 minutes add {_p} to potion effects of player's tool add {_p} to potion effects of target entity add potion effect of speed 1 to potion effects of player
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.
Examples:
set {_p::*} to active potion effects of player clear all the potion effects of player clear all the potion effects of player's tool add potion effects of player to potion effects of player's tool add speed to potion effects of target entity remove speed and night vision from potion effects of player
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.
This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).
Examples:
on server list ping: set the version string to "<light green>Version: <orange>%minecraft version%" set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always
One or more random characters between two given characters. Use 'alphanumeric' if you want only alphanumeric characters. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. If strings of more than one character are given, only the first character of each is used.
Examples:
set {_captcha} to join (5 random characters between "a" and "z") with "" send 3 random alphanumeric characters between "0" and "z"
A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.
Examples:
set the player's health to a random number between 5 and 10 send "You rolled a %random integer from 1 to 6%!" to the player set {_chances::*} to 5 random integers between 5 and 96 set {_decimals::*} to 3 random numbers between 2.7 and -1.5
All regions at a particular location. This expression requires a supported regions plugin to be installed.
Examples:
On click on a sign: line 1 of the clicked block is "[region info]" set {_regions::*} to regions at the clicked block if {_regions::*} is empty: message "No regions exist at this sign." else: message "Regions containing this sign: <gold>%{_regions::*}%<r>."
broadcast nl and nl repeated 200 times broadcast "Hello World " repeated 5 times if "aa" repeated 2 times is "aaaa": broadcast "Ahhhh" repeated 100 times
Rotates a quaternion or vector around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
set {_new} to {_quaternion} rotated around x axis by 10 degrees set {_new} to {_vector} rotated around vector(1, 1, 1) by 45 set {_new} to {_quaternion} rotated by x 45, y 90, z 135
Returns the axis or angle that a quaternion will rotate by/around. All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
Examples:
set {_quaternion} to axisAngle(45, vector(1, 2, 3)) send rotation axis of {_quaternion} # 1, 2, 3 send rotation angle of {_quaternion} # 45 set rotation angle of {_quaternion} to 135 set rotation axis of {_quaternion} to vector(0, 1, 0)
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
Examples:
on spawn of a monster: if the spawn reason is mob spawner: add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster: if the attacker is a player: if the victim doesn't have the scoreboard tag "spawned by a spawner": add 1$ to attacker's balance
An expression to obtain or modify data relating to the pickles of a sea pickle block.
Examples:
on block break: type of block is sea pickle send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!" send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!" send "It had to have contained at least %event-block's minimum sea pickle count% pickles!" cancel event set event-block's sea pickle count to event-block's maximum sea pickle count send "This bad boy is going to hold so many pickles now!!"
The commands that will be sent to the player in a send commands to player event. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.
Examples:
on script load: set {server-icons::default} to the default server icon
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
if index of event-slot is 10: send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory if raw index of event-slot > 27: # outside custom inventory cancel event
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.
Examples:
set the player's walk speed to 1 increase the argument's fly speed by 0.1
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).
Examples:
set {_s} to the first 5 characters of the text argument message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console set {_characters::*} to characters at 1, 2 and 7 in player's display name send the last character of all players' names
For players this is the entity at the crosshair. For mobs and experience orbs this is the entity they are attacking/following (if any). Display entities have a hit box of 0, so you should use 'target display' to collect Display entities May grab entities in unloaded chunks.
Examples:
on entity target: if entity's target is a player: send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-less delete targeted entity of player # for players it will delete the target delete target of last spawned zombie # for entities it will make them target-less
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression. The actual target block will regard the actual hit box of the block.
Examples:
set target block of player to stone set target block of player to oak_stairs[waterlogged=true] break target block of player using player's tool give player 1 of type of target block teleport player to location above target block kill all entities in radius 3 around target block of player set {_block} to actual target block of player break actual target block of player
The time of a world. Use the "minecraft timespan" syntax to change the time according to Minecraft's time intervals. Since Minecraft uses discrete intervals for time (ticks), changing the time by real-world minutes or real-world seconds only changes it approximately. Removing an amount of time from a world's time will move the clock forward a day.
Examples:
set time of world "world" to 2:00 add 2 minecraft hours to time of world "world" add 54 real seconds to time of world "world" # approximately 1 minecraft hour
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.
Examples:
set {_t} to time played of player if player's time played is greater than 10 minutes: give player a diamond sword
The time since a date has passed or the time until a date will pass. This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
Examples:
send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player send "%time until {countdown::end}% until the game begins!" to player
The total experience, in points, of players or experience orbs. Adding to a player's experience will trigger Mending, but setting their experience will not.
Examples:
set total experience of player to 100
add 100 to player's experience
if player's total experience is greater than 100: set player's total experience to 0 give player 1 diamond
Type of a block, item, entity, inventory or potion effect. Types of items, blocks and block datas are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.
Examples:
on rightclick on an entity: message "This is a %type of clicked entity%!"
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!
Examples:
# prevents people from joining the server if they use the name of a player # who has played on this server at least once since this script has been added on login: if {uuid::%name of player%} exists: {uuid::%name of player%} is not uuid of player kick player due to "Someone with your name has played on this server before" else: set {uuid::%name of player%} to uuid of player
Gets the value within objects. Usually used with variables to get the value they store rather than the variable itself, or with lists to get the values of a type.
Examples:
set {_entity} to a random entity out of all entities delete entity within {_entity} # This deletes the entity itself and not the value stored in the variable
set {_list::*} to "something", 10, "test" and a zombie broadcast the strings within {_list::*} # "something", "test"
Gets or changes the W, X, Y or Z component of vectors/quaternions. You cannot use the W component with vectors; it is for quaternions only.
Examples:
set {_v} to vector 1, 2, 3 send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
set {_loc} to {_v} to location in world "world" set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90 set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90
Creates vectors from given directions. Relative directions are relative to the origin, (0, 0, 0). Therefore, the vector from the direction 'forwards' is (0, 0, 1).
Examples:
set {_v} to vector from direction upwards set {_v} to vector in direction of player set {_v} to vector in horizontal direction of player set {_v} to vector from facing of player set {_v::*} to vectors from north, south, east, and west
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.
Examples:
on server list ping: set the protocol version to 0 # 13w41a (1.7), so it will show the version string always set the version string to "<light green>Version: <orange>%minecraft version%"
The view distance of a player as set by the server. Can be changed. NOTE: This is the view distance sent by the server to the player. This has nothing to do with client side view distance settings NOTE: This may not work on some versions (such as MC 1.14.x). The return value in this case will be the view distance set in system.properties.
Examples:
set view distance of player to 10 set {_view} to view distance of player reset view distance of all players add 2 to view distance of player
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.
Examples:
set {_clientView} to the client view distance of player set view distance of player to client view distance of player
An expression for obtaining and modifying the server's whitelist. Players may be added and removed from the whitelist. The whitelist can be enabled or disabled by setting the whitelist to true or false respectively.
Examples:
set the whitelist to false add all players to whitelist reset the whitelist
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.
The yaw or pitch of a location or vector. A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise. A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards. Only Paper 1.19+ users may directly change the yaw/pitch of players.
Examples:
log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log" set {_yaw} to yaw of player set {_p} to pitch of target entity set pitch of player to -90 # Makes the player look upwards, Paper 1.19+ only add 180 to yaw of target of player # Makes the target look behind themselves
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.
Note that banning people does not kick them from the server. You can optionally use 'and kick' or consider using the kick effect after applying a ban.
Examples:
unban player ban "127.0.0.1" IP-ban the player because "he is an idiot" ban player due to "inappropriate language" for 2 days ban and kick player due to "inappropriate language" for 2 days
Breaks the block and spawns items as if a player had mined it
You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)
Examples:
on right click: break clicked block naturally loop blocks in radius 10 around player: break loop-block using player's tool loop blocks in radius 10 around player: break loop-block naturally using diamond pickaxe
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.
Examples:
command /nick <text>: executable by: players cooldown: 10 seconds trigger: if length of arg-1 is more than 16: # Makes it so that invalid arguments don't make you wait for the cooldown again cancel the cooldown send "Your nickname may be at most 16 characters." stop set the player's display name to arg-1
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.
Examples:
on death of a zombie: if name of the entity is "&cSpecial": cancel drops of items
on break of a coal ore: cancel the experience drops
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.
Examples:
# set: Set the player's display name to "<red>%name of player%" set the block above the victim to lava # add: add 2 to the player's health # preferably use '<a href='#EffHealth'>heal</a>' for this add argument to {blacklist::*} give a diamond pickaxe of efficiency 5 to the player increase the data value of the clicked block by 1 # remove: remove 2 pickaxes from the victim subtract 2.5 from {points::%uuid of player%} # remove all: remove every iron tool from the player remove all minecarts from {entitylist::*} # delete: delete the block below the player clear drops delete {variable} # reset: reset walk speed of player reset chunk at the targeted block
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.
Examples:
dye player's helmet blue color the player's tool red
Executes a command. This can be useful to use other plugins in triggers. If the command is a bungeecord side command, you can use the [bungeecord] option to execute command on the proxy.
Examples:
make player execute command "/home" execute console command "/say Hello everyone!" execute player bungeecord command "/alert &6Testing Announcement!"
Connect a player to a server running on your proxy, or any server supporting transfers. Read below for more information. If the server is running Minecraft 1.20.5 or above, you may specify an IP and Port to transfer a player over to that server. When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified. If the port is not provided, it will default to `25565`.
Examples:
connect all players to proxy server "hub" transfer player to server "my.server.com" transfer player to server "localhost" on port 25566
Moves the loop to the next iteration. You may also continue an outer loop from an inner one. The loops are labelled from 1 until the current loop, starting with the outermost one.
Examples:
# Broadcast online moderators loop all players: if loop-value does not have permission "moderator": continue # filter out non moderators broadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter set {_counter} to 11 while {_counter} > 0: remove 1 from {_counter} wait a second if {_counter} != 1, 2, 3, 5 or 10: continue # only print when counter is 1, 2, 3, 5 or 10 broadcast "Game starting in %{_counter}% second(s)"
Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over. Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::bar} to 1 set {_foo::sublist::foobar} to "hey" copy {_foo::*} to {_copy::*} broadcast indices of {_copy::*} # bar, sublist broadcast {_copy::bar} # 1 broadcast {_copy::sublist::foobar} # "hey!"
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!
Examples:
wait 2 minutes halt for 5 minecraft hours wait a tick
Change visibility of the given entities for the given players. If no players are given, will hide the entities from all online players.
When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.
Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.
Examples:
on spawn: if event-entity is a chicken: hide event-entity
Equips or unequips an entity with some given armor. This will replace any armor that the entity is wearing.
Examples:
equip player with diamond helmet equip player with all diamond armor unequip diamond chestplate from player unequip all armor from player unequip player's armor
Exits a given amount of loops and conditionals, or the entire trigger.
Examples:
if player has any ore: stop message "%player% has no ores!" loop blocks above the player: loop-block is not air: exit 2 sections set loop-block to water
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.
Examples:
create an explosion of force 10 at the player create an explosion of force 0 at the victim
(show|reveal|hide) [the] [entire|additional] tool[ ]tip of %item types%
Since:
2.9.0
Requirements:
Spigot 1.20.5+
Show or hide the tooltip of an item. If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it. If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
hide the entire tooltip of player's tool hide {_item}'s additional tool tip
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.
Examples:
kill the player kill all creepers in the player's world kill all endermen, witches and bats
Leash living entities to other entities. When trying to leash an Ender Dragon, Wither, Player, or a Bat, this effect will not work. See Spigot's Javadocs for more info.
Examples:
on right click: leash event-entity to player send "&aYou leashed &2%event-entity%!" to player
load [the] server icon (from|of) [the] [image] [file] %text%
Since:
2.3
Requirements:
Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.
Examples:
on load: clear {server-icons::*} loop 5 times: load server icon from file "icons/%loop-number%.png" add the last loaded server icon to {server-icons::*}
on server list ping: set the icon to a random server icon out of {server-icons::*}
Load your worlds or unload your worlds The load effect will create a new world if world doesn't already exist. When attempting to load a normal vanilla world you must define it's environment i.e "world_nether" must be loaded with nether environment
Examples:
load world "world_nether" with environment nether load the world "myCustomWorld" unload "world_nether" unload "world_the_end" without saving unload all worlds
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.
Examples:
on join: log "%player% has just joined the server!" on world change: log "Someone just went to %event-world%!" to file "worldlog/worlds.log" on command: log "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning
Paper 1.17+, Paper 1.19.1+ (Players & Look Anchors)
Forces the mob(s) or player(s) to look at an entity, vector or location. Vanilla max head pitches range from 10 to 50.
Examples:
force the player to look towards event-entity's feet
on entity explosion: set {_player} to the nearest player {_player} is set distance between {_player} and the event-location is less than 15 make {_player} look towards vector from the {_player} to location of the event-entity
force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40
Makes a living entity visible/invisible. This is not a potion and therefore does not have features such as a time limit or particles. When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility.
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.
Examples:
message "A wild %player% appeared!" message "This message is a distraction. Mwahaha!" send "Your kill streak is %{kill streak::%uuid of player%}%." to player if the targeted entity exists: message "You're currently looking at a %type of the targeted entity%!" on chat: cancel event send "[%player%] >> %message%" to all players from player
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.
Examples:
show the victim's inventory to the player open the player's inventory for the player
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.
Examples:
make all creepers pathfind towards player make all cows stop pathfinding make event-entity pathfind towards player at speed 1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.
Examples:
play wolf hearts on the clicked wolf show mob spawner flames at the targeted block to the player
Minecraft 1.18.1+ (entity emitters), Paper 1.19.4+ or Adventure API 4.12.0+ (sound seed)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.
When running 1.19+, playing a sound from an entity directly will result in the sound coming from said entity, even while moving. If the sound is custom, a location emitter will follow the entity. Do note that pitch and volume are reflected based on the entity, and Minecraft may not use the values from this syntax.
If using Paper 1.19.4+ or Adventure API 4.12.0+ you can utilize sound seeds. Minecraft sometimes have a set of sounds under one sound ID that will randomly play, to counter this, you can directly state which seed to use.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
play sound "block.note_block.pling" play sound "entity.experience_orb.pickup" with volume 0.5 to the player play sound "custom.music.1" in jukebox category at {speakerBlock} play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 on target entity for the player #1.20.1+
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.
Examples:
hide player info hide player related information in the server list reveal all player related info
2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects), 2.7 (icon and infinite)
Apply or remove potion effects to/from entities.
Examples:
apply ambient swiftness 2 to the player remove haste from the victim
on join: apply infinite potion of strength of tier {strength::%uuid of player%} to the player apply potion of strength of tier {strength::%uuid of player%} to the player for 999 days # Before 1.19.4
apply potion effects of player's tool to player apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions
2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.
Examples:
replace "<item>" in {textvar} with "%item%" replace every "&" with "§" in line 1 # The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well: on chat: replace all "kys", "idiot" and "noob" with "****" in the message
replace all stone and dirt in player's inventory and player's top inventory with diamond
Causes a bell to ring. Optionally, the entity that rang the bell and the direction the bell should ring can be specified. A bell can only ring in two directions, and the direction is determined by which way the bell is facing. By default, the bell will ring in the direction it is facing.
Rotates displays, quaternions, or vectors around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Rotating a display is a shortcut for rotating its left rotation. If the right rotation needs to be modified, it should be acquired, rotated, and re-set.
Note that rotating a quaternion/display around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating quaternions/displays around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
rotate {_quaternion} around x axis by 10 degrees rotate last spawned block display around y axis by 10 degrees rotate {_vector} around vector(1, 1, 1) by 45 rotate {_quaternion} by x 45, y 90, z 135
send [the] resource pack [from [[the] URL]] %text% to %players%
send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since:
2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.
The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.
Shears or un-shears a shearable entity with drops by shearing and a 'sheared' sound. Using with 'force' will force this effect despite the entity's 'shear state'.
Please note that..:
- If your server is not running with Paper 1.19.4 or higher, this effect will only change its 'shear state', and the 'force' effect is unavailable
- Force-shearing or un-shearing on a sheared mushroom cow is not possible
Examples:
on rightclick on a sheep holding a sword: shear the clicked sheep chance of 10% force shear the clicked sheep
Sorts a list variable using either the natural ordering of the contents or the results of the given expression. Be warned, this will overwrite the indices of the list variable.
When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)
Examples:
set {_words::*} to "pineapple", "banana", "yoghurt", and "apple" sort {_words::*} # alphabetical sort sort {_words::*} by length of input # shortest to longest sort {_words::*} in descending order by length of input # longest to shortest sort {_words::*} based on {tastiness::%input%} # sort based on custom value
Stops specific or all sounds from playing to a group of players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
stop sound "block.chest.open" for the player stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player stop all sounds for all players stop sound in the record category
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.
Examples:
teleport the player to {homes::%player%} teleport the attacker to the victim
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.
If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.
Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.
Examples:
send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds send title "Hi %player%" to player send title "Loot Drop" with subtitle "starts in 3 minutes" to all players send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second send subtitle "Party!" to all players
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
Checks to see if a bell is currently resonating. A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.
Examples:
command /setblock <material>: description: set the block at your crosshair to a different type trigger: player cannot build at the targeted block: message "You do not have permission to change blocks there!" stop set the targeted block to argument
%player% can only see (commands|system messages) [in chat]
%player% can('t|[ ]not) see any (command[s]|message[s]) [in chat]
%player% can('t|[ ]not) see all messages [in chat]
%player% can('t|[ ]not) only see (commands|system messages) [in chat]
Since:
INSERT VERSION
Requirements:
Paper
Checks whether a player can see specific message types in chat.
Examples:
if player can see all messages: send "You can see all messages." if player can only see commands: send "This game doesn't work with commands-only chat." if player can't see any messages: send action bar "Server shutting down in 5 minutes!"
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.
Examples:
the clicked block is a stone slab or a double stone slab time in the player's world is greater than 8:00 the creature is not an enderman or an ender dragon
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.
Examples:
block contains 20 cobblestone player has 4 flint and 2 iron ingots {list::*} contains 5
[the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since:
2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.
Examples:
# make players use their potions of fire resistance whenever they take any kind of fire damage on damage: damage was caused by lava, fire or burning victim is a player victim has a potion of fire resistance cancel event apply fire resistance to the victim for 30 seconds remove 1 potion of fire resistance from the victim # prevent mobs from dropping items under certain circumstances on death: entity is not a player damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison clear drops
Whether the entire or additional tooltip of an item is shown or hidden. The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.). The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners).
Examples:
send true if entire tooltip of player's tool is shown if additional tooltip of {_item} is hidden:
Checks whether living entities have an unobstructed line of sight to other entities or locations.
Examples:
player has direct line of sight to location 5 blocks to the right of player victim has line of sight to attacker player has no line of sight to location 100 blocks in front of player
%players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since:
2.4
Requirements:
Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.
Checks whether a date is in the past or future. Note that using the 'now' expression will not be in the past or future when used directly in the condition.
Examples:
set {_date} to now wait 5 seconds if {_date} is in the past: # this will be true
if now is in the future: # this will be false
set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now if {_dates::*} are in the future: # this will be true if {_dates::*} have passed: # this will be false
Checks if a block is indirectly or directly powered by redstone
Examples:
if clicked block is redstone powered: send "This block is well-powered by redstone!" if clicked block is indirectly redstone powered: send "This block is indirectly redstone powered."
off[ |-]hand[s] of %living entities% (isn't|is not|aren't|are not) raised
Since:
2.8.0
Requirements:
Paper
Checks whether an entity has one or both of their hands raised. Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating).
Examples:
on damage of player: if victim's main hand is raised: drop player's tool at player set player's tool to air
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.
Examples:
on region enter: player is the owner of the region message "Welcome back to %region%!" send "%player% just entered %region%!" to all members of the region
Checks whether a player is online. The 'connected' pattern will return false once this player leaves the server, even if they rejoin. Be aware that using the 'connected' pattern with a variable will not have this special behavior. Use the direct event-player or other non-variable expression for best results.
Examples:
player is online player-argument is offline while player is connected: wait 60 seconds send "hello!" to player
# The following will act like `{_player} is online`. # Using variables with `is connected` will not behave the same as with non-variables. while {_player} is connected: broadcast "online!" wait 1 tick
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.
Checks whether living entities are pathfinding. Can only be a living entity that is a Mob.
Examples:
make {_entity} pathfind to {_location} at speed 2 while {_entity} is pathfinding wait a second launch flickering trailing burst firework colored red at location of {_entity} subtract 10 from {defence::tower::health} clear entity within {_entity}
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.
Examples:
if plugin "Vault" is enabled: if plugin "WorldGuard" is not enabled: if plugins "Essentials" and "Vault" are enabled: if plugin "MyBrokenPlugin" is disabled:
Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore.
Examples:
on left click: event-block is set if player's tool is the preferred tool for event-block: break event-block naturally using player's tool else: cancel event
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.
Examples:
command /slimey: trigger: if chunk at player is a slime chunk: send "Yeah, it is!" else: send "Nope, it isn't"
# prevent mobs from seeing sneaking players if they are at least 4 meters apart on target: target is sneaking distance of target and the entity is bigger than 4 cancel the event
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.
Whether a location is within something else. The "something" can be a block, an entity, a chunk, a world, or a cuboid formed by two other locations. Note that using the is between condition will refer to a straight line between locations, while this condition will refer to the cuboid between locations.
Examples:
if player's location is within {_loc1} and {_loc2}: send "You are in a PvP zone!" to player
if player is in world("world"): send "You are in the overworld!" to player
if attacker's location is inside of victim: cancel event send "Back up!" to attacker and victim
Checks whether an item or an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').
Examples:
tool is of type {selected type} victim is of type {villager type}
Checks if living entities or players are left or right-handed. Armor stands are neither right nor left-handed. Paper 1.17.1+ is required for non-player entities.
Examples:
on damage of player: if victim is left handed: cancel event
Checks whether the defined strings match the input regexes (Regular expressions).
Examples:
on chat: if message partially matches "\d": send "Message contains a digit!" if message doesn't match "[A-Za-z]+": send "Message doesn't only contain letters!"
on resource pack response: if the resource pack wasn't accepted: kick the player due to "You have to install the resource pack to play in this server!"
%date% (was|were)( more|(n't| not) less) than %time span% [ago]
%date% (was|were)((n't| not) more| less) than %time span% [ago]
Since:
2.0
Tests whether a given real time was more or less than some time span ago.
Examples:
command /command-with-cooldown: trigger: {command::%player's uuid%::last-usage} was less than a minute ago: message "Please wait a minute between uses of this command." stop set {command::%player's uuid%::last-usage} to now # ... actual command trigger here ...
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed
parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true
Examples:
if player's health is greater than or equal to 4: send "Your health is okay so far but be careful!"
else if player's health is greater than 2: send "You need to heal ASAP, your health is very low!"
else: # Less than 2 hearts send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"
parse if plugin "SomePluginName" is enabled: # parse if %condition% # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section
Filters a variable list based on the supplied conditions. Unlike the filter expression, this effect maintains the indices of the filtered list. It also supports filtering based on meeting any of the given criteria, rather than all, like multi-line if statements.
Examples:
set {_a::*} to integers between -10 and 10
filter {_a::*} to match: input is a number mod(input, 2) = 0 input > 0
Loop sections repeat their code with multiple values.
A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.
Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.
List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).
Examples:
loop all players: send "Hello %loop-player%!" to loop-player
loop items in player's inventory: if loop-item is dirt: set loop-item to air
loop 10 times: send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc. wait 1 second
loop {Coins::*}: set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200
While Loop sections are loops that will just keep repeating as long as a condition is met.
Examples:
while size of all players < 5: send "More players are needed to begin the adventure" to all players wait 5 seconds
set {_counter} to 1 do while {_counter} > 1: # false but will increase {_counter} by 1 then get out add 1 to {_counter}
# Be careful when using while loops with conditions that are almost # always true for a long time without using 'wait %timespan%' inside it, # otherwise it will probably hang and crash your server. while player is online: give player 1 dirt wait 1 second # without using a delay effect the server will crash
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.
Examples:
on anvil prepare: 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
Called when a block broken by a player drops something.
event-player: The player that broke the block
past event-block: The block that was broken
event-block: The block after being broken
event-items (or drops): The drops of the block
event-entities: The entities of the dropped items
If the breaking of the block leads to others being broken, such as torches, they will appearin "event-items" and "event-entities".
Examples:
on block drop: broadcast event-player broadcast past event-block broadcast event-block broadcast event-items broadcast event-entities on block drop of oak log:
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.
Called whenever a player chats. Use chat format to change message format. Use chat recipients to edit chat recipients.
Examples:
on chat: if player has permission "owner": set chat format to "&amp;amp;amp;lt;red&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;light red&amp;amp;amp;gt;[message]" else if player has permission "admin": set chat format to "&amp;amp;amp;lt;light red&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;orange&amp;amp;amp;gt;[message]" else: #default message format set chat format to "&amp;amp;amp;lt;orange&amp;amp;amp;gt;[player]&amp;amp;amp;lt;light gray&amp;amp;amp;gt;: &amp;amp;amp;lt;white&amp;amp;amp;gt;[message]"
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. 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 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 click on chest[facing=north]: on click on campfire[lit=true]:
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.
Examples:
on command: on command "/stop": on command "pm Njol ":
Called when the 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 greater than 15 kick the player due to "The last 5 slots are reserved for VIP players."
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression
Examples:
on enchant prepare: set enchant offer 1 to sharpness 1 set the cost of enchant offer 1 to 10 levels
Called when an enderman gets mad because a player looked at them. Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
# Stops endermen from getting angry players with the permission "safeFrom.enderman" on enderman enrage: if player has permission "safeFrom.enderman": cancel event
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively. event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
on sheep eat: kill event-entity broadcast "A sheep stole some grass!"
on falling block land: event-entity is a falling dirt cancel event
[on] (entit(y|ies)|%*-entitydatas%) transform[ing] [due to %transform reasons%]
Since:
2.8.0
Called when an entity is about to be replaced by another entity. 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 a zombie transforming due to curing: on mooshroom transforming: on zombie, skeleton or slime transform:
Called when a player's experience cooldown changes. Experience cooldown is how long until a player can pick up another orb of experience.
Examples:
on player experience cooldown change: broadcast event-player broadcast event-timespan broadcast past event-timespan broadcast xp cooldown change reason
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 firework explode on firework exploding colored red, light green and black on firework explosion colored light green: broadcast "A firework colored %colors% was exploded at %location%!"
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).
Called when a tree, giant mushroom or plant grows to next stage. "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: 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]:
Called whenever a player swaps the items in their main- and offhand slots. 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:
on swap hand items: event-player's tool is a diamond sword cancel event
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).
Examples:
on heal: on player healing from a regeneration potion: on healing of a zombie, cow or a wither: heal reason is healing potion cancel event
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.
Examples:
on block ignite: if event-block is a ladder: cancel event
Called when an entity or block (e.g. hopper) tries to move items directly from one inventory to another. 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:
on inventory item move: broadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.
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 their inventory, or a dispenser dispensing an item (not shooting it).
Examples:
on item spawn of iron sword: broadcast "Someone dropped an iron sword!"
Called when the 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!"
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.
Examples:
on language change: if player's language starts with "en": send "Hello!"
[on] %entity type% (move|walk|step) or (turn[ing] around|rotate)
[on] %entity type% (turn[ing] around|rotate) or (move|walk|step)
Since:
2.6, 2.8.0 (turn around)
Requirements:
Paper 1.16.5+ (entity move)
Called when a player or entity moves or rotates their head. 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:
on player move: 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
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.
Examples:
# prevents sand from falling on block physics: block is sand cancel event
Called when a piglin finishes bartering. A piglin may start bartering after picking up an item on its bartering list. Cancelling will prevent piglins from dropping items, but will still make them pick up the input.
Examples:
on piglin barter: if barter drops contain diamond: send "Diamonds belong in the money pit!" to player cancel event
Called when a player has slept long enough to count as passing the night/storm. Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
Called when a player sends an updated input to the server. Note: The input keys event value is the set of keys the player is currently pressing, not the keys that were pressed or released.
Examples:
on any input key press: send "You are pressing: %event-inputkeys%" to player
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. 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.
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.
Examples:
on projectile hit: event-projectile is arrow delete event-projectile
Called when a player is firing a bow and the server is choosing an arrow to use. 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:
on player ready arrow: selected bow's name is "Spectral Bow" if selected arrow is not a spectral arrow: cancel event
Called when a player takes action on a resource pack request sent via the 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:
on resource pack request response: 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!"
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
on load: set {running::%script%} to true on unload: set {running::%script%} to false
[on] send[ing] [of [the]] [server] command[s] list
[on] [server] command list send
Since:
2.8.0
Called when the server sends a list of commands to the player. This usually happens on join. The sent commands can be modified via the sent commands expression. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. 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).
on server list ping: 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::*}
Called when a player stops using an item. For example, when the player releases the interact button when holding a bow, an edible item, or a spyglass. Note that event-timespan will return the time the item was used for.
Examples:
on player stop using item: broadcast "%player% used %event-item% for %event-timespan%."
This event can be used to listen to teleports from non-players or player entities respectively. 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 teleport: on player teleport: on creeper teleport:
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.
Called when a world is initialized. As all default worlds are initialized 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.
every 2 seconds in "world": every minecraft hour in "flatworld": every tick in "world": # can cause lag depending on the code inside the event every minecraft days in "plots":
armor, armor toughness, attack damage, attack knockback, attack speed, block break speed, block interaction range, burning time, entity interaction range, explosion knockback resistance, fall damage multiplier, flying speed, follow range, generic armor, generic armor toughness, generic attack damage, generic attack knockback, generic attack speed, generic burning time, generic explosion knockback resistance, generic fall damage multiplier, generic flying speed, generic follow range, generic gravity, generic jump strength, generic knockback resistance, generic luck, generic max absorption, generic max health, generic movement efficiency, generic movement speed, generic oxygen bonus, generic safe fall distance, generic scale, generic step height, generic tempt range, generic water movement efficiency, gravity, horse jump strength, jump strength, knockback resistance, luck, max absorption, max health, mining efficiency, movement efficiency, movement speed, oxygen bonus, player block break speed, player block interaction range, player entity interaction range, player mining efficiency, player sneaking speed, player submerged mining speed, player sweeping damage ratio, safe fall distance, scale, sneaking speed, spawn reinforcements, step height, submerged mining speed, sweeping damage ratio, tempt range, water movement efficiency, zombie spawn reinforcements
Since:
2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info. NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.
Examples:
set block at player to campfire[lit=false] set target block of player to oak stairs[facing=north;waterlogged=true] set block at player to grass_block[snowy=true] set loop-block to minecraft:chest[facing=north] set block above player to oak_log[axis=y] set target block of player to minecraft:oak_leaves[distance=2;persistent=false]
lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since:
2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.
color of the sheep is red or black set the color of the block to green message "You're holding a &amp;amp;lt;%color of tool%&amp;amp;gt;%color of tool%&amp;amp;lt;reset&amp;amp;gt; wool block"
command /push [&amp;amp;amp;lt;player&amp;amp;amp;gt;]: trigger: if arg-1 is not set: if command sender is console: send "You can't push yourself as a console :\" to sender stop push sender upwards with force 2 send "Yay!" else: push arg-1 upwards with force 2 send "Yay!" to sender and arg-1
sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, campfire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, world border, flying into a wall, cramming, poison, sonic boom, suffocate, custom, kill, killed, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since:
2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.
Examples:
set the block below the victim to a chest loop blocks from the block infront of the player to the block 10 below the player: set the block behind the loop-block to water
aqua affinity, bane of arthropods, binding curse, blast protection, breach, channeling, channelling, curse of binding, curse of vanishing, density, depth strider, efficiency, feather falling, fire aspect, fire protection, flame, fortune, frost walker, impaling, infinity, knockback, looting, loyalty, luck of the sea, lure, mending, multi-shot, multishot, piercing, power, projectile protection, protection, punch, quick charge, respiration, riptide, sharpness, silk touch, smite, soul speed, sweeping edge, swift sneak, thorns, unbreaking, vanishing curse, wind burst
Since:
1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway. NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'. As of Minecraft 1.21 this will also support custom enchantments using namespaces, ex: 'myenchants:explosive'.
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.
Examples:
entity is a zombie or creeper player is an op projectile is an arrow shoot a fireball from the player
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
left movement key, forward movement key, right movement key, backward key, left key, sprint key, forward key, right key, jumping key, sneaking key, jump key, sneak key, sprinting key, backward movement key
Since:
INSERT VERSION
Requirements:
Minecraft 1.21.3+
Represents a movement input key that is pressed by a player.
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).
drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since:
2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.
barrel inventory, a loom inventory, a blast furnace inventory, workbench inventory, ender chest inventory, loom inventory, a workbench inventory, hopper inventory, a merchant inventory, a hopper inventory, chiseled bookshelf, an ender chest inventory, new smithing table, bookshelf, a jukebox, beacon inventory, shulker box inventory, a barrel inventory, a shulker box inventory, lectern inventory, chest inventory, a villager inventory, a smoker inventory, a brewing stand inventory, a smithing inventory, grindstone inventory, a crafter inventory, a crafting table inventory, a player inventory, decorated pot, furnace inventory, a creative inventory, blast furnace inventory, upgrade gear, a composter inventory, an enchanting table inventory, jukebox, a dropper inventory, a cartography table inventory, a upgrade gear, smoker inventory, composter inventory, a chest inventory, upgrade gear table, a upgrade gear table, dispenser inventory, player inventory, stonecutter inventory, a stonecutter inventory, a decorated pot, a lectern inventory, merchant inventory, cartography table inventory, a chiseled bookshelf, a new smithing table, a furnace inventory, anvil inventory, a dispenser inventory, a grindstone inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, a beacon inventory, a bookshelf, crafter inventory, creative inventory, crafting table inventory, an anvil inventory
Since:
2.2-dev32
Minecraft has several different inventory types with their own use cases.
[<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since:
1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.
Examples:
set {_item} to type of the targeted block {_item} is a torch
first person left handed, left handed in first person, right handed in third person, first person left hand, no transform, the ground, third person right hand, third person right handed, right handed in first person, menu, head, third person left hand, first person right handed, first person right hand, fixed position, left handed in third person, gui, ground, fixed, third person left handed
Since:
INSERT VERSION
Represents the transform setting of an item display.
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.
Examples:
give 4 torches to the player add all slabs to the inventory of the block player's tool is a diamond sword of sharpness remove a pickaxes of fortune 4 from {stored items::*} set {_item} to 10 of every upside-down stair block is dirt or farmland
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.
<number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since:
2.0
Requirements:
Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.
Examples:
add 10£ to the player's account remove Fr. 9.95 from the player's money set the victim's money to 0 increase the attacker's balance by the level of the victim * 100
[-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since:
1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.
Examples:
set the player's health to 5.5 set {_temp} to 2*{_temp} - 2.5
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
2.0 beta 8
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.
Examples:
set {_p} to "Notch" parsed as an offlineplayer # returns Notch even if they're offline
Parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in Minecraft databases (name not taken) otherwise it will return the player regardless of their online status.
Since:
1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.
Examples:
set {_p} to "Notch" parsed as a player # returns &amp;amp;lt;none&amp;amp;gt; unless Notch is actually online or starts with Notch like Notchan set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.
Examples:
set tool of player to dirt delete helmet of the victim set the color of the player's tool to green enchant the player's chestplate with projectile protection 5
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.
Examples:
broadcast "Hello World!" message "Hello %player%" message "The id of ""%type of tool%"" is %id of tool%."
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.
Examples:
every 5 minecraft days: wait a minecraft second and 5 ticks every 10 mc days and 12 hours: halt for 12.7 irl minutes, 12 hours and 120.5 seconds
See the type name patterns of all types - including this one
Since:
2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.
Examples:
{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5 {variable} is a type # check whether the variable contains a type, e.g. number or player {variable} is an object # will always succeed if the variable is set as everything is an object, even types. disable PvP in the event-world kill the loop-entity
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).
date(year: number, month: number, day: number, hour: number = 0, minute: number = 0, second: number = 0, millisecond: number = 0, zone_offset: number = NaN, dst_offset: number = NaN)
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).
Examples:
date(2014, 10, 1) # 0:00, 1st October 2014 date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990 date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)
Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this article.
Examples:
command /balance: aliases: bal executable by: players trigger: set {_money} to formatNumber({money::%sender's uuid%}) send "Your balance: %{_money}%" to sender
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.
Examples:
# TELEPORTING teleport player to location(1,1,1, world "world") teleport player to location(1,1,1, world "world", 100, 0) teleport player to location(1,1,1, world "world", yaw of player, pitch of player) teleport player to location(1,1,1, world of player) teleport player to location(1,1,1, world("world")) teleport player to location({_x}, {_y}, {_z}, {_w}, {_yaw}, {_pitch}) # SETTING BLOCKS set block at location(1,1,1, world "world") to stone set block at location(1,1,1, world "world", 100, 0) to stone set block at location(1,1,1, world of player) to stone set block at location(1,1,1, world("world")) to stone set block at location({_x}, {_y}, {_z}, {_w}) to stone # USING VARIABLES set {_l1} to location(1,1,1) set {_l2} to location(10,10,10) set blocks within {_l1} and {_l2} to stone if player is within {_l1} and {_l2}: # OTHER kill all entities in radius 50 around location(1,65,1, world "world") delete all entities in radius 25 around location(50,50,50, world "world_nether") ignite all entities in radius 25 around location(1,1,1, world of player)
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.
Returns a offline player from their name or UUID. This function will still return the player if they're online. If Paper 1.16.5+ is used, the 'allowLookup' parameter can be set to false to prevent this function from doing a web lookup for players who have not joined before. Lookups can cause lag spikes of up to multiple seconds, so use offline players with caution.
Examples:
set {_p} to offlineplayer("Notch") set {_p} to offlineplayer("069a79f4-44e9-4726-a5be-fca90e38aaf5") set {_p} to offlineplayer("Notch", false)
Returns an online player from their name or UUID, if player is offline function will return nothing. Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
Examples:
set {_p} to player("Notch") # will return an online player whose name is or starts with 'Notch' set {_p} to player("Notch", true) # will return the only online player whose name is 'Notch' set {_p} to player("069a79f4-44e9-4726-a5be-fca90e38aaf5") # &lt;none&gt; if player is offline
Returns a RGB color from the given red, green and blue parameters. Alpha values can be added optionally, but these only take affect in certain situations, like text display backgrounds.
Examples:
dye player's leggings rgb(120, 30, 45) set the colour of a text display to rgb(10, 50, 100, 50)
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/docs.json b/docs/nightly/dev/feature/docs.json
index 909651728b..b3df0f0b63 100644
--- a/docs/nightly/dev/feature/docs.json
+++ b/docs/nightly/dev/feature/docs.json
@@ -1,5 +1,5 @@
{
- "skriptVersion": "2.9.4-nightly-1238f62",
+ "skriptVersion": "2.9.4-nightly-6ba6706",
"conditions": [
{
"id": "CondAlphanumeric",
@@ -773,6 +773,25 @@
"%displays%'[s] text (doesn't|does not|do not|don't) have [a] (drop|text) shadow"
]
},
+ {
+ "id": "CondIsPressingKey",
+ "name": "Is Pressing Key",
+ "since": "INSERT VERSION",
+ "description": [
+ "Checks if a player is pressing a certain input key."
+ ],
+ "examples": [
+ "on player input:",
+ "\tif player is pressing forward movement key:",
+ "\t\tsend \"You are moving forward!\""
+ ],
+ "patterns": [
+ "%players% (is|are) pressing %inputkeys%",
+ "%players% (isn't|is not|aren't|are not) pressing %inputkeys%",
+ "%players% (was|were) pressing %inputkeys%",
+ "%players% (wasn't|was not|weren't|were not) pressing %inputkeys%"
+ ]
+ },
{
"id": "CondCanBuild",
"name": "Can Build",
@@ -1932,22 +1951,6 @@
"%locations% (isn't|is not|aren't|are not) within %number% (block|metre|meter)[s] (around|of) %locations%"
]
},
- {
- "id": "CondTextDisplaySeeThroughBlocks",
- "name": "Text Display Visible Through Blocks",
- "since": "INSERT VERSION",
- "description": [
- "Returns whether text displays can be seen through blocks or not."
- ],
- "examples": [
- "if last spawned text display is visible through walls:",
- "\tprevent last spawned text display from being visible through walls"
- ],
- "patterns": [
- "%displays% (is|are) visible through (blocks|walls)",
- "%displays% (isn't|is not|aren't|are not) visible through (blocks|walls)"
- ]
- },
{
"id": "CondCanAge",
"name": "Can Age",
@@ -2033,6 +2036,22 @@
"%livingentities% (isn't|is not|aren't|are not) in lov(e|ing) [state|mode]"
]
},
+ {
+ "id": "CondTextDisplaySeeThroughBlocks",
+ "name": "Text Display Visible Through Blocks",
+ "since": "INSERT VERSION",
+ "description": [
+ "Returns whether text displays can be seen through blocks or not."
+ ],
+ "examples": [
+ "if last spawned text display is visible through walls:",
+ "\tprevent last spawned text display from being visible through walls"
+ ],
+ "patterns": [
+ "%displays% (is|are) visible through (blocks|walls)",
+ "%displays% (isn't|is not|aren't|are not) visible through (blocks|walls)"
+ ]
+ },
{
"id": "CondCompare",
"name": "Comparison",
@@ -3783,42 +3802,6 @@
"rotate %quaternions/displays% by x %number%, y %number%(, [and]| and) z %number%"
]
},
- {
- "id": "EffTextDisplayDropShadow",
- "name": "Text Display Drop Shadow",
- "since": "INSERT VERSION",
- "description": [
- "Applies or removes drop shadow from the displayed text on a text display."
- ],
- "examples": [
- "apply drop shadow to last spawned text display",
- "if {_display} has drop shadow:",
- "\tremove drop shadow from the text of {_display}"
- ],
- "patterns": [
- "(apply|add) (drop|text) shadow to [[the] text of] %displays%",
- "(apply|add) (drop|text) shadow to %displays%'[s] text",
- "(remove|clear) (drop|text) shadow from [[the] text of] %displays%",
- "(remove|clear) (drop|text) shadow from %displays%'[s] text"
- ]
- },
- {
- "id": "EffTextDisplaySeeThroughBlocks",
- "name": "Text Display See Through Blocks",
- "since": "INSERT VERSION",
- "description": [
- "Forces a text display to either be or not be visible through blocks."
- ],
- "examples": [
- "force last spawned text display to be visible through walls",
- "prevent all text displays from being visible through walls"
- ],
- "patterns": [
- "make %displays% visible through (blocks|walls)",
- "force %displays% to be visible through (blocks|walls)",
- "(prevent|block) %displays% from being (visible|seen) through (blocks|walls)"
- ]
- },
{
"id": "EffAllowAging",
"name": "Allow Aging",
@@ -3873,6 +3856,42 @@
"make %livingentities% [a[n]] (adult|:baby)",
"force %livingentities% to be[come] a[n] (adult|:baby)"
]
+ },
+ {
+ "id": "EffTextDisplayDropShadow",
+ "name": "Text Display Drop Shadow",
+ "since": "INSERT VERSION",
+ "description": [
+ "Applies or removes drop shadow from the displayed text on a text display."
+ ],
+ "examples": [
+ "apply drop shadow to last spawned text display",
+ "if {_display} has drop shadow:",
+ "\tremove drop shadow from the text of {_display}"
+ ],
+ "patterns": [
+ "(apply|add) (drop|text) shadow to [[the] text of] %displays%",
+ "(apply|add) (drop|text) shadow to %displays%'[s] text",
+ "(remove|clear) (drop|text) shadow from [[the] text of] %displays%",
+ "(remove|clear) (drop|text) shadow from %displays%'[s] text"
+ ]
+ },
+ {
+ "id": "EffTextDisplaySeeThroughBlocks",
+ "name": "Text Display See Through Blocks",
+ "since": "INSERT VERSION",
+ "description": [
+ "Forces a text display to either be or not be visible through blocks."
+ ],
+ "examples": [
+ "force last spawned text display to be visible through walls",
+ "prevent all text displays from being visible through walls"
+ ],
+ "patterns": [
+ "make %displays% visible through (blocks|walls)",
+ "force %displays% to be visible through (blocks|walls)",
+ "(prevent|block) %displays% from being (visible|seen) through (blocks|walls)"
+ ]
}
],
"expressions": [
@@ -9702,6 +9721,23 @@
"%displays%'[s] text[s]"
]
},
+ {
+ "id": "ExprLoveTime",
+ "name": "Love Time",
+ "since": "INSERT VERSION",
+ "description": [
+ "The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them.",
+ "Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred."
+ ],
+ "examples": [
+ "on right click:",
+ "\tsend \"%event-entity% has been in love for %love time of event-entity% more than you!\" to player"
+ ],
+ "patterns": [
+ "[the] love[d] time of %livingentities%",
+ "%livingentities%'[s] love[d] time"
+ ]
+ },
{
"id": "ExprDisplayBillboard",
"name": "Display Billboard",
@@ -9938,20 +9974,18 @@
]
},
{
- "id": "ExprLoveTime",
- "name": "Love Time",
+ "id": "ExprCurrentInputKeys",
+ "name": "Player Input Keys",
"since": "INSERT VERSION",
"description": [
- "The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them.",
- "Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred."
+ "Get the current input keys of a player."
],
"examples": [
- "on right click:",
- "\tsend \"%event-entity% has been in love for %love time of event-entity% more than you!\" to player"
+ "broadcast \"%player% is pressing %current input keys of player%\""
],
"patterns": [
- "[the] love[d] time of %livingentities%",
- "%livingentities%'[s] love[d] time"
+ "[the] [current] (inputs|input keys) of %players%",
+ "%players%'[s] [current] (inputs|input keys)"
]
},
{
@@ -12713,6 +12747,23 @@
"[entity] love mode [enter]"
]
},
+ {
+ "id": "player_input",
+ "name": "On Player Input",
+ "since": "INSERT VERSION",
+ "description": [
+ "Called when a player sends an updated input to the server.",
+ "Note: The input keys event value is the set of keys the player is currently pressing, not the keys that were pressed or released."
+ ],
+ "examples": [
+ "on any input key press:",
+ "\tsend \"You are pressing: %event-inputkeys%\" to player"
+ ],
+ "patterns": [
+ "[player] (toggle|toggling|1:press[ing]|2:release|2:releasing) of (%-inputkeys%|(an|any) input key)",
+ "([player] %-inputkeys%|[an|any [player]] input key) (toggle|toggling|1:press[ing]|2:release|2:releasing)"
+ ]
+ },
{
"id": "region_enterleave",
"name": "On Region Enter/Leave",
@@ -13478,6 +13529,17 @@
"first person left handed, left handed in first person, right handed in third person, first person left hand, no transform, the ground, third person right hand, third person right handed, right handed in first person, menu, head, third person left hand, first person right handed, first person right hand, fixed position, left handed in third person, gui, ground, fixed, third person left handed"
]
},
+ {
+ "id": "inputkey",
+ "name": "Input Key",
+ "since": "INSERT VERSION",
+ "description": [
+ "Represents a movement input key that is pressed by a player."
+ ],
+ "patterns": [
+ "left movement key, forward movement key, right movement key, backward key, left key, sprint key, forward key, right key, jumping key, sneaking key, jump key, sneak key, sprinting key, backward movement key"
+ ]
+ },
{
"id": "money",
"name": "Money",
diff --git a/docs/nightly/dev/feature/effects.html b/docs/nightly/dev/feature/effects.html
index 0d0cd3d104..ce3dadb8f9 100644
--- a/docs/nightly/dev/feature/effects.html
+++ b/docs/nightly/dev/feature/effects.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.
Note that banning people does not kick them from the server. You can optionally use 'and kick' or consider using the kick effect after applying a ban.
Examples:
unban player ban "127.0.0.1" IP-ban the player because "he is an idiot" ban player due to "inappropriate language" for 2 days ban and kick player due to "inappropriate language" for 2 days
Breaks the block and spawns items as if a player had mined it
You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)
Examples:
on right click: break clicked block naturally loop blocks in radius 10 around player: break loop-block using player's tool loop blocks in radius 10 around player: break loop-block naturally using diamond pickaxe
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.
Examples:
command /nick <text>: executable by: players cooldown: 10 seconds trigger: if length of arg-1 is more than 16: # Makes it so that invalid arguments don't make you wait for the cooldown again cancel the cooldown send "Your nickname may be at most 16 characters." stop set the player's display name to arg-1
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.
Examples:
on death of a zombie: if name of the entity is "&cSpecial": cancel drops of items
on break of a coal ore: cancel the experience drops
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.
Examples:
# set: Set the player's display name to "<red>%name of player%" set the block above the victim to lava # add: add 2 to the player's health # preferably use '<a href='#EffHealth'>heal</a>' for this add argument to {blacklist::*} give a diamond pickaxe of efficiency 5 to the player increase the data value of the clicked block by 1 # remove: remove 2 pickaxes from the victim subtract 2.5 from {points::%uuid of player%} # remove all: remove every iron tool from the player remove all minecarts from {entitylist::*} # delete: delete the block below the player clear drops delete {variable} # reset: reset walk speed of player reset chunk at the targeted block
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.
Examples:
dye player's helmet blue color the player's tool red
Executes a command. This can be useful to use other plugins in triggers. If the command is a bungeecord side command, you can use the [bungeecord] option to execute command on the proxy.
Examples:
make player execute command "/home" execute console command "/say Hello everyone!" execute player bungeecord command "/alert &6Testing Announcement!"
Connect a player to a server running on your proxy, or any server supporting transfers. Read below for more information. If the server is running Minecraft 1.20.5 or above, you may specify an IP and Port to transfer a player over to that server. When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified. If the port is not provided, it will default to `25565`.
Examples:
connect all players to proxy server "hub" transfer player to server "my.server.com" transfer player to server "localhost" on port 25566
Moves the loop to the next iteration. You may also continue an outer loop from an inner one. The loops are labelled from 1 until the current loop, starting with the outermost one.
Examples:
# Broadcast online moderators loop all players: if loop-value does not have permission "moderator": continue # filter out non moderators broadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter set {_counter} to 11 while {_counter} > 0: remove 1 from {_counter} wait a second if {_counter} != 1, 2, 3, 5 or 10: continue # only print when counter is 1, 2, 3, 5 or 10 broadcast "Game starting in %{_counter}% second(s)"
Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over. Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::bar} to 1 set {_foo::sublist::foobar} to "hey" copy {_foo::*} to {_copy::*} broadcast indices of {_copy::*} # bar, sublist broadcast {_copy::bar} # 1 broadcast {_copy::sublist::foobar} # "hey!"
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!
Examples:
wait 2 minutes halt for 5 minecraft hours wait a tick
Change visibility of the given entities for the given players. If no players are given, will hide the entities from all online players.
When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.
Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.
Examples:
on spawn: if event-entity is a chicken: hide event-entity
Equips or unequips an entity with some given armor. This will replace any armor that the entity is wearing.
Examples:
equip player with diamond helmet equip player with all diamond armor unequip diamond chestplate from player unequip all armor from player unequip player's armor
Exits a given amount of loops and conditionals, or the entire trigger.
Examples:
if player has any ore: stop message "%player% has no ores!" loop blocks above the player: loop-block is not air: exit 2 sections set loop-block to water
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.
Examples:
create an explosion of force 10 at the player create an explosion of force 0 at the victim
(show|reveal|hide) [the] [entire|additional] tool[ ]tip of %item types%
Since:
2.9.0
Requirements:
Spigot 1.20.5+
Show or hide the tooltip of an item. If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it. If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
hide the entire tooltip of player's tool hide {_item}'s additional tool tip
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.
Examples:
kill the player kill all creepers in the player's world kill all endermen, witches and bats
Leash living entities to other entities. When trying to leash an Ender Dragon, Wither, Player, or a Bat, this effect will not work. See Spigot's Javadocs for more info.
Examples:
on right click: leash event-entity to player send "&aYou leashed &2%event-entity%!" to player
load [the] server icon (from|of) [the] [image] [file] %text%
Since:
2.3
Requirements:
Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.
Examples:
on load: clear {server-icons::*} loop 5 times: load server icon from file "icons/%loop-number%.png" add the last loaded server icon to {server-icons::*}
on server list ping: set the icon to a random server icon out of {server-icons::*}
Load your worlds or unload your worlds The load effect will create a new world if world doesn't already exist. When attempting to load a normal vanilla world you must define it's environment i.e "world_nether" must be loaded with nether environment
Examples:
load world "world_nether" with environment nether load the world "myCustomWorld" unload "world_nether" unload "world_the_end" without saving unload all worlds
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.
Examples:
on join: log "%player% has just joined the server!" on world change: log "Someone just went to %event-world%!" to file "worldlog/worlds.log" on command: log "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning
Paper 1.17+, Paper 1.19.1+ (Players & Look Anchors)
Forces the mob(s) or player(s) to look at an entity, vector or location. Vanilla max head pitches range from 10 to 50.
Examples:
force the player to look towards event-entity's feet
on entity explosion: set {_player} to the nearest player {_player} is set distance between {_player} and the event-location is less than 15 make {_player} look towards vector from the {_player} to location of the event-entity
force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40
Makes a living entity visible/invisible. This is not a potion and therefore does not have features such as a time limit or particles. When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility.
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.
Examples:
message "A wild %player% appeared!" message "This message is a distraction. Mwahaha!" send "Your kill streak is %{kill streak::%uuid of player%}%." to player if the targeted entity exists: message "You're currently looking at a %type of the targeted entity%!" on chat: cancel event send "[%player%] >> %message%" to all players from player
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.
Examples:
show the victim's inventory to the player open the player's inventory for the player
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.
Examples:
make all creepers pathfind towards player make all cows stop pathfinding make event-entity pathfind towards player at speed 1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.
Examples:
play wolf hearts on the clicked wolf show mob spawner flames at the targeted block to the player
Minecraft 1.18.1+ (entity emitters), Paper 1.19.4+ or Adventure API 4.12.0+ (sound seed)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.
When running 1.19+, playing a sound from an entity directly will result in the sound coming from said entity, even while moving. If the sound is custom, a location emitter will follow the entity. Do note that pitch and volume are reflected based on the entity, and Minecraft may not use the values from this syntax.
If using Paper 1.19.4+ or Adventure API 4.12.0+ you can utilize sound seeds. Minecraft sometimes have a set of sounds under one sound ID that will randomly play, to counter this, you can directly state which seed to use.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
play sound "block.note_block.pling" play sound "entity.experience_orb.pickup" with volume 0.5 to the player play sound "custom.music.1" in jukebox category at {speakerBlock} play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 on target entity for the player #1.20.1+
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.
Examples:
hide player info hide player related information in the server list reveal all player related info
2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects), 2.7 (icon and infinite)
Apply or remove potion effects to/from entities.
Examples:
apply ambient swiftness 2 to the player remove haste from the victim
on join: apply infinite potion of strength of tier {strength::%uuid of player%} to the player apply potion of strength of tier {strength::%uuid of player%} to the player for 999 days # Before 1.19.4
apply potion effects of player's tool to player apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions
2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.
Examples:
replace "<item>" in {textvar} with "%item%" replace every "&" with "§" in line 1 # The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well: on chat: replace all "kys", "idiot" and "noob" with "****" in the message
replace all stone and dirt in player's inventory and player's top inventory with diamond
Causes a bell to ring. Optionally, the entity that rang the bell and the direction the bell should ring can be specified. A bell can only ring in two directions, and the direction is determined by which way the bell is facing. By default, the bell will ring in the direction it is facing.
Rotates displays, quaternions, or vectors around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Rotating a display is a shortcut for rotating its left rotation. If the right rotation needs to be modified, it should be acquired, rotated, and re-set.
Note that rotating a quaternion/display around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating quaternions/displays around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
rotate {_quaternion} around x axis by 10 degrees rotate last spawned block display around y axis by 10 degrees rotate {_vector} around vector(1, 1, 1) by 45 rotate {_quaternion} by x 45, y 90, z 135
send [the] resource pack [from [[the] URL]] %text% to %players%
send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since:
2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.
The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.
Shears or un-shears a shearable entity with drops by shearing and a 'sheared' sound. Using with 'force' will force this effect despite the entity's 'shear state'.
Please note that..:
- If your server is not running with Paper 1.19.4 or higher, this effect will only change its 'shear state', and the 'force' effect is unavailable
- Force-shearing or un-shearing on a sheared mushroom cow is not possible
Examples:
on rightclick on a sheep holding a sword: shear the clicked sheep chance of 10% force shear the clicked sheep
Sorts a list variable using either the natural ordering of the contents or the results of the given expression. Be warned, this will overwrite the indices of the list variable.
When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)
Examples:
set {_words::*} to "pineapple", "banana", "yoghurt", and "apple" sort {_words::*} # alphabetical sort sort {_words::*} by length of input # shortest to longest sort {_words::*} in descending order by length of input # longest to shortest sort {_words::*} based on {tastiness::%input%} # sort based on custom value
Stops specific or all sounds from playing to a group of players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
stop sound "block.chest.open" for the player stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player stop all sounds for all players stop sound in the record category
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.
Examples:
teleport the player to {homes::%player%} teleport the attacker to the victim
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.
If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.
Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.
Examples:
send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds send title "Hi %player%" to player send title "Loot Drop" with subtitle "starts in 3 minutes" to all players send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second send subtitle "Party!" to all players
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.
Note that banning people does not kick them from the server. You can optionally use 'and kick' or consider using the kick effect after applying a ban.
Examples:
unban player ban "127.0.0.1" IP-ban the player because "he is an idiot" ban player due to "inappropriate language" for 2 days ban and kick player due to "inappropriate language" for 2 days
Breaks the block and spawns items as if a player had mined it
You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)
Examples:
on right click: break clicked block naturally loop blocks in radius 10 around player: break loop-block using player's tool loop blocks in radius 10 around player: break loop-block naturally using diamond pickaxe
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.
Examples:
command /nick <text>: executable by: players cooldown: 10 seconds trigger: if length of arg-1 is more than 16: # Makes it so that invalid arguments don't make you wait for the cooldown again cancel the cooldown send "Your nickname may be at most 16 characters." stop set the player's display name to arg-1
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.
Examples:
on death of a zombie: if name of the entity is "&cSpecial": cancel drops of items
on break of a coal ore: cancel the experience drops
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.
Examples:
# set: Set the player's display name to "<red>%name of player%" set the block above the victim to lava # add: add 2 to the player's health # preferably use '<a href='#EffHealth'>heal</a>' for this add argument to {blacklist::*} give a diamond pickaxe of efficiency 5 to the player increase the data value of the clicked block by 1 # remove: remove 2 pickaxes from the victim subtract 2.5 from {points::%uuid of player%} # remove all: remove every iron tool from the player remove all minecarts from {entitylist::*} # delete: delete the block below the player clear drops delete {variable} # reset: reset walk speed of player reset chunk at the targeted block
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.
Examples:
dye player's helmet blue color the player's tool red
Executes a command. This can be useful to use other plugins in triggers. If the command is a bungeecord side command, you can use the [bungeecord] option to execute command on the proxy.
Examples:
make player execute command "/home" execute console command "/say Hello everyone!" execute player bungeecord command "/alert &6Testing Announcement!"
Connect a player to a server running on your proxy, or any server supporting transfers. Read below for more information. If the server is running Minecraft 1.20.5 or above, you may specify an IP and Port to transfer a player over to that server. When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified. If the port is not provided, it will default to `25565`.
Examples:
connect all players to proxy server "hub" transfer player to server "my.server.com" transfer player to server "localhost" on port 25566
Moves the loop to the next iteration. You may also continue an outer loop from an inner one. The loops are labelled from 1 until the current loop, starting with the outermost one.
Examples:
# Broadcast online moderators loop all players: if loop-value does not have permission "moderator": continue # filter out non moderators broadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter set {_counter} to 11 while {_counter} > 0: remove 1 from {_counter} wait a second if {_counter} != 1, 2, 3, 5 or 10: continue # only print when counter is 1, 2, 3, 5 or 10 broadcast "Game starting in %{_counter}% second(s)"
Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over. Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::bar} to 1 set {_foo::sublist::foobar} to "hey" copy {_foo::*} to {_copy::*} broadcast indices of {_copy::*} # bar, sublist broadcast {_copy::bar} # 1 broadcast {_copy::sublist::foobar} # "hey!"
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!
Examples:
wait 2 minutes halt for 5 minecraft hours wait a tick
Change visibility of the given entities for the given players. If no players are given, will hide the entities from all online players.
When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.
Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.
Examples:
on spawn: if event-entity is a chicken: hide event-entity
Equips or unequips an entity with some given armor. This will replace any armor that the entity is wearing.
Examples:
equip player with diamond helmet equip player with all diamond armor unequip diamond chestplate from player unequip all armor from player unequip player's armor
Exits a given amount of loops and conditionals, or the entire trigger.
Examples:
if player has any ore: stop message "%player% has no ores!" loop blocks above the player: loop-block is not air: exit 2 sections set loop-block to water
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.
Examples:
create an explosion of force 10 at the player create an explosion of force 0 at the victim
(show|reveal|hide) [the] [entire|additional] tool[ ]tip of %item types%
Since:
2.9.0
Requirements:
Spigot 1.20.5+
Show or hide the tooltip of an item. If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it. If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
hide the entire tooltip of player's tool hide {_item}'s additional tool tip
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.
Examples:
kill the player kill all creepers in the player's world kill all endermen, witches and bats
Leash living entities to other entities. When trying to leash an Ender Dragon, Wither, Player, or a Bat, this effect will not work. See Spigot's Javadocs for more info.
Examples:
on right click: leash event-entity to player send "&aYou leashed &2%event-entity%!" to player
load [the] server icon (from|of) [the] [image] [file] %text%
Since:
2.3
Requirements:
Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.
Examples:
on load: clear {server-icons::*} loop 5 times: load server icon from file "icons/%loop-number%.png" add the last loaded server icon to {server-icons::*}
on server list ping: set the icon to a random server icon out of {server-icons::*}
Load your worlds or unload your worlds The load effect will create a new world if world doesn't already exist. When attempting to load a normal vanilla world you must define it's environment i.e "world_nether" must be loaded with nether environment
Examples:
load world "world_nether" with environment nether load the world "myCustomWorld" unload "world_nether" unload "world_the_end" without saving unload all worlds
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.
Examples:
on join: log "%player% has just joined the server!" on world change: log "Someone just went to %event-world%!" to file "worldlog/worlds.log" on command: log "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning
Paper 1.17+, Paper 1.19.1+ (Players & Look Anchors)
Forces the mob(s) or player(s) to look at an entity, vector or location. Vanilla max head pitches range from 10 to 50.
Examples:
force the player to look towards event-entity's feet
on entity explosion: set {_player} to the nearest player {_player} is set distance between {_player} and the event-location is less than 15 make {_player} look towards vector from the {_player} to location of the event-entity
force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40
Makes a living entity visible/invisible. This is not a potion and therefore does not have features such as a time limit or particles. When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility.
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.
Examples:
message "A wild %player% appeared!" message "This message is a distraction. Mwahaha!" send "Your kill streak is %{kill streak::%uuid of player%}%." to player if the targeted entity exists: message "You're currently looking at a %type of the targeted entity%!" on chat: cancel event send "[%player%] >> %message%" to all players from player
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.
Examples:
show the victim's inventory to the player open the player's inventory for the player
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.
Examples:
make all creepers pathfind towards player make all cows stop pathfinding make event-entity pathfind towards player at speed 1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.
Examples:
play wolf hearts on the clicked wolf show mob spawner flames at the targeted block to the player
Minecraft 1.18.1+ (entity emitters), Paper 1.19.4+ or Adventure API 4.12.0+ (sound seed)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.
When running 1.19+, playing a sound from an entity directly will result in the sound coming from said entity, even while moving. If the sound is custom, a location emitter will follow the entity. Do note that pitch and volume are reflected based on the entity, and Minecraft may not use the values from this syntax.
If using Paper 1.19.4+ or Adventure API 4.12.0+ you can utilize sound seeds. Minecraft sometimes have a set of sounds under one sound ID that will randomly play, to counter this, you can directly state which seed to use.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
play sound "block.note_block.pling" play sound "entity.experience_orb.pickup" with volume 0.5 to the player play sound "custom.music.1" in jukebox category at {speakerBlock} play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 on target entity for the player #1.20.1+
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.
Examples:
hide player info hide player related information in the server list reveal all player related info
2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects), 2.7 (icon and infinite)
Apply or remove potion effects to/from entities.
Examples:
apply ambient swiftness 2 to the player remove haste from the victim
on join: apply infinite potion of strength of tier {strength::%uuid of player%} to the player apply potion of strength of tier {strength::%uuid of player%} to the player for 999 days # Before 1.19.4
apply potion effects of player's tool to player apply haste potion of tier 3 without any particles whilst hiding the potion icon to the player # Hide potions
2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.
Examples:
replace "<item>" in {textvar} with "%item%" replace every "&" with "§" in line 1 # The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well: on chat: replace all "kys", "idiot" and "noob" with "****" in the message
replace all stone and dirt in player's inventory and player's top inventory with diamond
Causes a bell to ring. Optionally, the entity that rang the bell and the direction the bell should ring can be specified. A bell can only ring in two directions, and the direction is determined by which way the bell is facing. By default, the bell will ring in the direction it is facing.
Rotates displays, quaternions, or vectors around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Rotating a display is a shortcut for rotating its left rotation. If the right rotation needs to be modified, it should be acquired, rotated, and re-set.
Note that rotating a quaternion/display around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating quaternions/displays around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
rotate {_quaternion} around x axis by 10 degrees rotate last spawned block display around y axis by 10 degrees rotate {_vector} around vector(1, 1, 1) by 45 rotate {_quaternion} by x 45, y 90, z 135
send [the] resource pack [from [[the] URL]] %text% to %players%
send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since:
2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.
The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.
Shears or un-shears a shearable entity with drops by shearing and a 'sheared' sound. Using with 'force' will force this effect despite the entity's 'shear state'.
Please note that..:
- If your server is not running with Paper 1.19.4 or higher, this effect will only change its 'shear state', and the 'force' effect is unavailable
- Force-shearing or un-shearing on a sheared mushroom cow is not possible
Examples:
on rightclick on a sheep holding a sword: shear the clicked sheep chance of 10% force shear the clicked sheep
Sorts a list variable using either the natural ordering of the contents or the results of the given expression. Be warned, this will overwrite the indices of the list variable.
When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)
Examples:
set {_words::*} to "pineapple", "banana", "yoghurt", and "apple" sort {_words::*} # alphabetical sort sort {_words::*} by length of input # shortest to longest sort {_words::*} in descending order by length of input # longest to shortest sort {_words::*} based on {tastiness::%input%} # sort based on custom value
Stops specific or all sounds from playing to a group of players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
stop sound "block.chest.open" for the player stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player stop all sounds for all players stop sound in the record category
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.
Examples:
teleport the player to {homes::%player%} teleport the attacker to the victim
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.
If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.
Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.
Examples:
send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds send title "Hi %player%" to player send title "Loot Drop" with subtitle "starts in 3 minutes" to all players send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second send subtitle "Party!" to all players
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/events.html b/docs/nightly/dev/feature/events.html
index 7b74aa123e..94f7529f11 100644
--- a/docs/nightly/dev/feature/events.html
+++ b/docs/nightly/dev/feature/events.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
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.
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.
Examples:
on anvil prepare: 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
Called when a block broken by a player drops something.
event-player: The player that broke the block
past event-block: The block that was broken
event-block: The block after being broken
event-items (or drops): The drops of the block
event-entities: The entities of the dropped items
If the breaking of the block leads to others being broken, such as torches, they will appearin "event-items" and "event-entities".
Examples:
on block drop: broadcast event-player broadcast past event-block broadcast event-block broadcast event-items broadcast event-entities on block drop of oak log:
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.
Called whenever a player chats. Use chat format to change message format. Use chat recipients to edit chat recipients.
Examples:
on chat: if player has permission "owner": set chat format to "&amp;lt;red&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;light red&amp;gt;[message]" else if player has permission "admin": set chat format to "&amp;lt;light red&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;orange&amp;gt;[message]" else: #default message format set chat format to "&amp;lt;orange&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;white&amp;gt;[message]"
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. 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 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 click on chest[facing=north]: on click on campfire[lit=true]:
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.
Examples:
on command: on command "/stop": on command "pm Njol ":
Called when the 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 greater than 15 kick the player due to "The last 5 slots are reserved for VIP players."
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression
Examples:
on enchant prepare: set enchant offer 1 to sharpness 1 set the cost of enchant offer 1 to 10 levels
Called when an enderman gets mad because a player looked at them. Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
# Stops endermen from getting angry players with the permission "safeFrom.enderman" on enderman enrage: if player has permission "safeFrom.enderman": cancel event
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively. event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
on sheep eat: kill event-entity broadcast "A sheep stole some grass!"
on falling block land: event-entity is a falling dirt cancel event
[on] (entit(y|ies)|%*-entitydatas%) transform[ing] [due to %transform reasons%]
Since:
2.8.0
Called when an entity is about to be replaced by another entity. 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 a zombie transforming due to curing: on mooshroom transforming: on zombie, skeleton or slime transform:
Called when a player's experience cooldown changes. Experience cooldown is how long until a player can pick up another orb of experience.
Examples:
on player experience cooldown change: broadcast event-player broadcast event-timespan broadcast past event-timespan broadcast xp cooldown change reason
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 firework explode on firework exploding colored red, light green and black on firework explosion colored light green: broadcast "A firework colored %colors% was exploded at %location%!"
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).
Called when a tree, giant mushroom or plant grows to next stage. "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: 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]:
Called whenever a player swaps the items in their main- and offhand slots. 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:
on swap hand items: event-player's tool is a diamond sword cancel event
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).
Examples:
on heal: on player healing from a regeneration potion: on healing of a zombie, cow or a wither: heal reason is healing potion cancel event
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.
Examples:
on block ignite: if event-block is a ladder: cancel event
Called when an entity or block (e.g. hopper) tries to move items directly from one inventory to another. 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:
on inventory item move: broadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.
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 their inventory, or a dispenser dispensing an item (not shooting it).
Examples:
on item spawn of iron sword: broadcast "Someone dropped an iron sword!"
Called when the 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!"
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.
Examples:
on language change: if player's language starts with "en": send "Hello!"
[on] %entity type% (move|walk|step) or (turn[ing] around|rotate)
[on] %entity type% (turn[ing] around|rotate) or (move|walk|step)
Since:
2.6, 2.8.0 (turn around)
Requirements:
Paper 1.16.5+ (entity move)
Called when a player or entity moves or rotates their head. 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:
on player move: 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
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.
Examples:
# prevents sand from falling on block physics: block is sand cancel event
Called when a piglin finishes bartering. A piglin may start bartering after picking up an item on its bartering list. Cancelling will prevent piglins from dropping items, but will still make them pick up the input.
Examples:
on piglin barter: if barter drops contain diamond: send "Diamonds belong in the money pit!" to player cancel event
Called when a player has slept long enough to count as passing the night/storm. Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
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. 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.
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.
Examples:
on projectile hit: event-projectile is arrow delete event-projectile
Called when a player is firing a bow and the server is choosing an arrow to use. 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:
on player ready arrow: selected bow's name is "Spectral Bow" if selected arrow is not a spectral arrow: cancel event
Called when a player takes action on a resource pack request sent via the 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:
on resource pack request response: 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!"
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
on load: set {running::%script%} to true on unload: set {running::%script%} to false
[on] send[ing] [of [the]] [server] command[s] list
[on] [server] command list send
Since:
2.8.0
Called when the server sends a list of commands to the player. This usually happens on join. The sent commands can be modified via the sent commands expression. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. 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).
on server list ping: 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::*}
Called when a player stops using an item. For example, when the player releases the interact button when holding a bow, an edible item, or a spyglass. Note that event-timespan will return the time the item was used for.
Examples:
on player stop using item: broadcast "%player% used %event-item% for %event-timespan%."
This event can be used to listen to teleports from non-players or player entities respectively. 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 teleport: on player teleport: on creeper teleport:
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.
Called when a world is initialized. As all default worlds are initialized 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.
every 2 seconds in "world": every minecraft hour in "flatworld": every tick in "world": # can cause lag depending on the code inside the event every minecraft days in "plots":
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
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.
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.
Examples:
on anvil prepare: 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
Called when a block broken by a player drops something.
event-player: The player that broke the block
past event-block: The block that was broken
event-block: The block after being broken
event-items (or drops): The drops of the block
event-entities: The entities of the dropped items
If the breaking of the block leads to others being broken, such as torches, they will appearin "event-items" and "event-entities".
Examples:
on block drop: broadcast event-player broadcast past event-block broadcast event-block broadcast event-items broadcast event-entities on block drop of oak log:
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.
Called whenever a player chats. Use chat format to change message format. Use chat recipients to edit chat recipients.
Examples:
on chat: if player has permission "owner": set chat format to "&amp;lt;red&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;light red&amp;gt;[message]" else if player has permission "admin": set chat format to "&amp;lt;light red&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;orange&amp;gt;[message]" else: #default message format set chat format to "&amp;lt;orange&amp;gt;[player]&amp;lt;light gray&amp;gt;: &amp;lt;white&amp;gt;[message]"
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. 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 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 click on chest[facing=north]: on click on campfire[lit=true]:
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.
Examples:
on command: on command "/stop": on command "pm Njol ":
Called when the 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 greater than 15 kick the player due to "The last 5 slots are reserved for VIP players."
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression
Examples:
on enchant prepare: set enchant offer 1 to sharpness 1 set the cost of enchant offer 1 to 10 levels
Called when an enderman gets mad because a player looked at them. Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
# Stops endermen from getting angry players with the permission "safeFrom.enderman" on enderman enrage: if player has permission "safeFrom.enderman": cancel event
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively. event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
on sheep eat: kill event-entity broadcast "A sheep stole some grass!"
on falling block land: event-entity is a falling dirt cancel event
[on] (entit(y|ies)|%*-entitydatas%) transform[ing] [due to %transform reasons%]
Since:
2.8.0
Called when an entity is about to be replaced by another entity. 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 a zombie transforming due to curing: on mooshroom transforming: on zombie, skeleton or slime transform:
Called when a player's experience cooldown changes. Experience cooldown is how long until a player can pick up another orb of experience.
Examples:
on player experience cooldown change: broadcast event-player broadcast event-timespan broadcast past event-timespan broadcast xp cooldown change reason
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 firework explode on firework exploding colored red, light green and black on firework explosion colored light green: broadcast "A firework colored %colors% was exploded at %location%!"
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).
Called when a tree, giant mushroom or plant grows to next stage. "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: 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]:
Called whenever a player swaps the items in their main- and offhand slots. 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:
on swap hand items: event-player's tool is a diamond sword cancel event
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).
Examples:
on heal: on player healing from a regeneration potion: on healing of a zombie, cow or a wither: heal reason is healing potion cancel event
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.
Examples:
on block ignite: if event-block is a ladder: cancel event
Called when an entity or block (e.g. hopper) tries to move items directly from one inventory to another. 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:
on inventory item move: broadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.
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 their inventory, or a dispenser dispensing an item (not shooting it).
Examples:
on item spawn of iron sword: broadcast "Someone dropped an iron sword!"
Called when the 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!"
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.
Examples:
on language change: if player's language starts with "en": send "Hello!"
[on] %entity type% (move|walk|step) or (turn[ing] around|rotate)
[on] %entity type% (turn[ing] around|rotate) or (move|walk|step)
Since:
2.6, 2.8.0 (turn around)
Requirements:
Paper 1.16.5+ (entity move)
Called when a player or entity moves or rotates their head. 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:
on player move: 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
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.
Examples:
# prevents sand from falling on block physics: block is sand cancel event
Called when a piglin finishes bartering. A piglin may start bartering after picking up an item on its bartering list. Cancelling will prevent piglins from dropping items, but will still make them pick up the input.
Examples:
on piglin barter: if barter drops contain diamond: send "Diamonds belong in the money pit!" to player cancel event
Called when a player has slept long enough to count as passing the night/storm. Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
Called when a player sends an updated input to the server. Note: The input keys event value is the set of keys the player is currently pressing, not the keys that were pressed or released.
Examples:
on any input key press: send "You are pressing: %event-inputkeys%" to player
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. 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.
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.
Examples:
on projectile hit: event-projectile is arrow delete event-projectile
Called when a player is firing a bow and the server is choosing an arrow to use. 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:
on player ready arrow: selected bow's name is "Spectral Bow" if selected arrow is not a spectral arrow: cancel event
Called when a player takes action on a resource pack request sent via the 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:
on resource pack request response: 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!"
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
on load: set {running::%script%} to true on unload: set {running::%script%} to false
[on] send[ing] [of [the]] [server] command[s] list
[on] [server] command list send
Since:
2.8.0
Called when the server sends a list of commands to the player. This usually happens on join. The sent commands can be modified via the sent commands expression. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. 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).
on server list ping: 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::*}
Called when a player stops using an item. For example, when the player releases the interact button when holding a bow, an edible item, or a spyglass. Note that event-timespan will return the time the item was used for.
Examples:
on player stop using item: broadcast "%player% used %event-item% for %event-timespan%."
This event can be used to listen to teleports from non-players or player entities respectively. 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 teleport: on player teleport: on creeper teleport:
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.
Called when a world is initialized. As all default worlds are initialized 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.
every 2 seconds in "world": every minecraft hour in "flatworld": every tick in "world": # can cause lag depending on the code inside the event every minecraft days in "plots":
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/expressions.html b/docs/nightly/dev/feature/expressions.html
index 1a4285c754..774ee6a0c0 100644
--- a/docs/nightly/dev/feature/expressions.html
+++ b/docs/nightly/dev/feature/expressions.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
Returns the item the entities are currently using (ie: the food they're eating, the bow they're drawing back, etc.). This cannot be changed. If an entity is not using any item, this will return null.
Examples:
on damage of player: if victim's active tool is a bow: interrupt player's active item use
Returns the time that the entities have either spent using an item, or the time left for them to finish using an item. If an entity is not using any item, this will return 0 seconds.
Examples:
on right click: broadcast player's remaining item use time wait 1 second broadcast player's item use time
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.
Examples:
# Set targeted crop to fully grown crop set age of targeted block to maximum age of targeted block
# Spawn a baby cow that will only need 1 minute to become an adult spawn a baby cow at player set age of last spawned entity to -1200 # in ticks = 60 seconds
Returns all of the scripts, or just the enabled or disabled ones.
Examples:
command /scripts: trigger: send "All Scripts: %scripts%" to player send "Loaded Scripts: %enabled scripts%" to player send "Unloaded Scripts: %disabled scripts%" to player
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.
Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples:
message "There are %number of all players% players online!"
Returns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair. The default value of max cost set by vanilla Minecraft is 40.
Examples:
on inventory click: if {AnvilRepairSaleActive} = true: wait a tick # recommended, to avoid client bugs set anvil repair cost to anvil repair cost * 50% send "Anvil repair sale is ON!" to player
on inventory click: player have permission "anvil.repair.max.bypass" set max repair cost of event-inventory to 99999
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.
Examples:
give the item-argument to the player-argument damage the player-argument by the number-argument give a diamond pickaxe to the argument add argument 1 to argument 2 heal the last argument
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.
Examples:
set the player's health to 10 - the player's health loop (argument + 2) / 5 times: message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%" message "You have %health of player * 2% half hearts of HP!"
Equipment of living entities, i.e. the boots, leggings, chestplate or helmet.
Examples:
set chestplate of the player to a diamond chestplate helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.
Examples:
on damage: if attack cooldown of attacker < 1: set damage to 0 send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.
Examples:
on damage: victim is a creeper damage the attacked by 1 heart
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.
Examples:
on damage: attacker is a player health of attacker is less than or equal to 2 damage victim by 1 heart
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.
NOTE: Offline players can not have their bed location changed, only online players.
Examples:
if bed of player exists: teleport player the the player's bed else: teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location set the safe bed location of player to spawn location of world("world") # safe/valid bed location
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).
Examples:
# damage player in deserts constantly every real minute: loop all players: biome at loop-player is desert damage the loop-player by 1
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
Gets the speed at which the given player would break this block, taking into account tools, potion effects, whether or not the player is in water, enchantments, etc. The returned value is the amount of progress made in breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the player jumps/enters water.
Examples:
on left click using diamond pickaxe: event-block is set send "Break Speed: %break speed for player%" to player
Gets the sound that a given block, blockdata, or itemtype will use in a specific scenario. This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
Examples:
play sound (break sound of dirt) at all players set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.
Examples:
loop blocks above the player: loop blocks between the block below the player and the targeted block: set the blocks below the player, the victim and the targeted block to air set all blocks within {loc1} and {loc2} to stone set all blocks within chunk at player to air
The pages of a book (Supports Skript's chat format) Note: In order to modify the pages of a new written book, you must have the title and author of the book set. Skript will do this for you, but if you want your own, please set those values.
Examples:
on book sign: message "Book Pages: %pages of event-item%" message "Book Page 1: %page 1 of event-item%"
set page 1 of player's held item to "Book writing"
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case
Examples:
"Oops!" in lowercase # oops! "oops!" in uppercase # OOPS! "hellO i'm steve!" in proper case # HellO I'm Steve! "hellO i'm steve!" in strict proper case # Hello I'm Steve! "spAwn neW boSs ()" in camel case # spAwnNeWBoSs() "spAwn neW boSs ()" in strict camel case # spawnNewBoss() "geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer() "geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber() "Hello Player!" in snake case # Hello_Player! "Hello Player!" in lower snake case # hello_player! "Hello Player!" in upper snake case # HELLO_PLAYER! "What is your name?" in kebab case # What-is-your-name? "What is your name?" in lower kebab case # what-is-your-name? "What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?
function is_in_order(letters: strings) :: boolean: loop {_letters::*}: set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if: {_previous-codepoint} is set # if the codepoint of the current character is not # 1 more than the codepoint of the previous character # then the letters are not in order {_codepoint} - {_previous-codepoint} is not 1 then: return false
set {_previous-codepoint} to {_codepoint} return true
All characters between two given characters, useful for generating random strings. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. The ASCII table linked here shows this ordering for the first 256 characters. If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression. If strings of more than one character are given, only the first character of each is used.
Examples:
loop characters from "a" to "f": broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz send alphanumeric characters between "0" and "z"
The color of an item, entity, block, firework effect, or text display. This can also be used to color chat messages with "<%color of ...%>this text is colored!". Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
Examples:
on click on wool: message "This wool block is <%color of block%>%color of block%<reset>!" set the color of the block to black
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.
Examples:
on chat: set message to colored message # Safe; only colors get parsed command /fade <player>: trigger: set display name of the player-argument to uncolored display name of the player-argument command /format <text>: trigger: message formatted text-argument # Safe, because we're sending to whoever used this command
The command that caused an 'on command' event (excluding the leading slash and all arguments)
Examples:
# prevent any commands except for the /exit command during some game on command: if {game::%player%::playing} is true: if the command is not "exit": message "You're not allowed to use commands during the game" cancel the event
main command label of command "skript" description of command "help" label of command "pl" usage of command "help" aliases of command "bukkit:help" permission of command "/op" command "op"'s permission message command "sk"'s plugin owner
command /greet <player>: usage: /greet <target> trigger: if arg-1 is sender: send "&cYou can't greet yourself! Usage: %the usage%" stop send "%sender% greets you!" to arg-1 send "You greeted %arg-1%!"
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%
Examples:
make the command sender execute "/say hi!"
on command: log "%executor% used command /%command% %arguments%" to "commands.log"
# make all player's compasses target a player stored in {compass::target::%player%} every 5 seconds: loop all players: set the loop-player's compass target to location of {compass::target::%%loop-player%}
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.
Examples:
command /home: cooldown: 10 seconds cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%. trigger: teleport player to {home::%player%}
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.
Examples:
give a diamond sword of sharpness 3 to the player kill the creeper kill all powered creepers in the wolf's world projectile is an arrow
How much damage is done in a entity/vehicle/item damage events. For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart). For items, it's the amount of durability damage the item will be taking.
Examples:
on item damage: event-item is any tool clear damage # unbreakable tools as the damage will be 0 on damage: increase the damage by 2
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks
Examples:
give player diamond sword with damage value 100 set player's tool to diamond hoe damaged by 250 give player diamond sword with damage 700 named "BROKEN SWORD" set {_item} to diamond hoe with damage value 50 named "SAD HOE" set target block of player to wool with data value 1 set target block of player to potato plant with data value 7
The difference between two values Supported types include numbers, dates and times.
Examples:
if difference between {command::%player%::lastuse} and now is smaller than a minute: message "You have to wait a minute before using this command again!"
thrust the player upwards set the block behind the player to water loop blocks above the player: set {_rand} to a random integer between 1 and 10 set the block {_rand} meters south east of the loop-block to stone block in horizontal facing of the clicked entity from the player is air spawn a creeper 1.5 meters horizontally behind the player spawn a TNT 5 meters above and 2 meters horizontally behind the player thrust the last spawned TNT in the horizontal direction of the player with speed 0.2 push the player upwards and horizontally forward at speed 0.5 push the clicked entity in in the direction of the player at speed -0.5 open the inventory of the block 2 blocks below the player to the player teleport the clicked entity behind the player grow a regular tree 2 meters horizontally behind the player
Returns or changes the billboard setting of displays. This describes the axes/points around which the display can pivot. Displays spawn with the 'fixed' billboard by default. Resetting this expression will also set it to 'fixed'.
Examples:
set billboard of the last spawned text display to center
Returns or changes the brightness override of displays. Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override. Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option. NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
Examples:
set sky light override of the last spawned text display to 7 subtract 3 from the block light level override of the last spawned text display if sky light level override of {_display} is 5: clear brightness override of {_display}
Returns or changes the height or width of displays. The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it). If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
Examples:
set display height of the last spawned text display to 2.5
Returns or changes the interpolation delay/duration of displays. Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state. Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate. Resetting either value will return that value to 0.
Examples:
set interpolation delay of the last spawned text display to 2 ticks
The teleport duration of displays is the amount of time it takes to get between locations. 0 means that updates are applied immediately. 1 means that the display entity will move from current position to the updated one over one tick. Higher values spread the movement over multiple ticks. Max of 59 ticks.
Examples:
set teleport delay of the last spawned text display to 2 ticks teleport last spawned text display to {_location} wait 2 ticks message "display entity has arrived at %{_location}%"
Returns or changes the transformation rotation of displays. The left rotation is applied first, with the right rotation then being applied based on the rotated axis.
Examples:
set left transformation rotation of last spawned block display to quaternion(1, 0, 0, 0) # reset block display
Returns or changes the view range of displays. Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range. For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
Examples:
set view range of the last spawned text display to 2.9
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.
The first, last, range or a random element of a set, e.g. a list variable. See also: random expression
Examples:
broadcast the first 3 elements of {top players::*} set {_last} to last element of {top players::*} set {_random player} to random element out of all players send 2nd last element of {top players::*} to player set {page2::*} to elements from 11 to 20 of {top players::*}
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.
All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. e.g. all players, all creepers in the player's world, or players in radius 100 of the player.
Examples:
kill all creepers in the player's world send "Psst!" to all players within 100 meters of the player give a diamond to all ops heal all tamed wolves in radius 2000 around {town center} delete all monsters in chunk at player size of all players within {_corner::1} and {_corner::2}}
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.
Examples:
on damage of player: send "You are wounded!" to victim set victim's attack speed attribute to 2
on player experience cooldown change: if xp cooldown change reason is plugin: #Changed by a plugin else if xp cooldown change reason is orb pickup: #Changed by picking up xp orb
The experience cooldown of a player. Experience cooldown is how long until a player can pick up another orb of experience. The cooldown of a player must be 0 to pick up another orb of experience.
Examples:
send experience cooldown of player set the xp pickup cooldown of player to 1 hour if exp collection cooldown of player >= 10 minutes: clear the experience pickup cooldown of player
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.
Examples:
on explode: set the explosion's block yield to 10%
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information
Examples:
on explosion prime: set the yield of the explosion to 10
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information
Examples:
on spawn of a creeper: set the explosive yield of the event-entity to 10
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')
Examples:
# makes a bridge loop blocks from the block below the player in the horizontal facing of the player: set loop-block to cobblestone
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.
Examples:
send "congrats on being staff!" to all players where [player input has permission "staff"]
Represents a 'firework effect' which can be used in the launch firework effect.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.
Examples:
command /date: trigger: send "Full date: %now formatted human-readable%" to sender send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.
Examples:
on teleport: former world was "world_nether" # or 'world was' world will be "world" # or 'world after the event is' on tool change: past tool is an axe the tool after the event will be air on weather change: set {weather::%world%::old} to past weather set {weather::%world%::current} to the new weather
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not furnace, as furnace is not an existing expression. Note that the result and the result slot refer to separate things. the result is the product in a smelt event and the result slot is the output slot of a furnace (where the result will end up). Note that if the result in a smelt event is changed to an item that differs in type from the items currently in the result slot, the smelting will fail to complete (the item will attempt to smelt itself again). Note that if values other than the result are changed, event values may not accurately reflect the actual items in a furnace. Thus you may wish to use the event block in this case (e.g. the fuel slot of the event-block) to get accurate values if needed.
Examples:
set the fuel slot of the clicked block to a lava bucket set the block's ore slot to 64 iron ore give the result of the block to the player clear the result slot of the block
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed. If you have LuckPerms, ensure you have vault integration enabled in the luck perms configurations.
Examples:
on join: broadcast "%group of player%" # this is the player's primary group broadcast "%groups of player%" # this is all of the player's groups
Returns the hanging entity or remover in hanging break and place events.
Examples:
on break of item frame: if item of hanging entity is diamond pickaxe: cancel event if hanging remover is a player: send "You can't break that item frame!" to hanging remover
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.
MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!
Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.
Examples:
command /setpass <text>: trigger: set {password::%uuid of player%} to text-argument hashed with SHA-256 command /login <text>: trigger: if text-argument hashed with SHA-256 is {password::%uuid of player%}: message "Login successful." else: message "Wrong password!"
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.
Examples:
set the block at the player's head to air set the block in front of the player's eyes to glass loop blocks in front of the player's head:
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).
Gets and/or sets the (max) domestication of a horse. The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse). The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
Examples:
function domesticateAndTame(horse: entity, p: offline player, i: int = 10): add {_i} to domestication level of {_horse} if domestication level of {_horse} >= max domestication level of {_horse}: tame {_horse} set tamer of {_horse} to {_p}
The currently selected hotbar slot. To retrieve its number use Slot Index expression. Use future and past tense to grab the previous slot in an item change event, see example.
Examples:
message "%player's current hotbar slot%" set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left
on item held change: if the selected hotbar slot was a diamond: set the currently selected hotbar slot to slot 5 of player
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.
Examples:
on server list ping: clear the hover list add "&aWelcome to the &6Minecraft &aserver!" to the hover list add "" to the hover list # A blank line add "&cThere are &6%online players count% &conline players!" to the hover list
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.
Examples:
set {_first} to the first index of "@" in the text argument if {_s} contains "abc": set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.
Examples:
set {l::*} to "some", "cool" and "values" broadcast "%indices of {l::*}%" # result is 1, 2 and 3
set {_leader-board::first} to 17 set {_leader-board::third} to 30 set {_leader-board::second} to 25 set {_leader-board::fourth} to 42 set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first
on inventory item move: holder of event-initiator-inventory is a chest broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
Represents the input in a filter expression or sort effect. For example, if you ran 'broadcast "something" and "something else" where [input is "something"] the condition would be checked twice, using "something" and "something else" as the inputs. The 'input index' pattern can be used when acting on a variable to access the index of the input.
Examples:
send "congrats on being staff!" to all players where [input has permission "staff"] sort {_list::*} based on length of input index
Gets the amount of rows/slots, viewers and holder of an inventory.
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
Examples:
event-inventory's amount of rows holder of player's top inventory {_inventory}'s viewers
Represents a slot in an inventory. It can be used to change the item in an inventory too.
Examples:
if slot 0 of player is air: set slot 0 of player to 2 stones remove 1 stone from slot 0 of player add 2 stones to slot 0 of player clear slot 1 of player
Change the cooldown of a specific material to a certain amount of Timespan.
Examples:
on right click using stick: set item cooldown of player's tool for player to 1 minute set item cooldown of stone and grass for all players to 20 seconds reset item cooldown of cobblestone and dirt for all players
set the item transform of the last spawned item display to first person left handed set the item transform of the last spawned item display to no transform # Reset to default
An item associated with an entity. For dropped item entities, it gets the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item. Other entities do not have items associated with them.
Examples:
item of event-entity
set the item inside of event-entity to a diamond sword named "Example"
Items or blocks of a specific type, useful for looping.
Examples:
loop items of type ore and log: block contains loop-item message "Theres at least one %loop-item% in this block" drop all blocks at the player # drops one of every block at the player
All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.
Examples:
loop all items in the player's inventory: loop-item is enchanted remove loop-item from the player set {inventory::%uuid of player%::*} to items in the player's inventory
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.
Examples:
message "Online players: %join all players' names with "" | ""%" # %all players% would use the default "x, y, and z" set {_s::*} to the string argument split at ","
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.
Examples:
spawn a priest set {healer::%spawned priest%} to true shoot an arrow from the last spawned entity ignite the shot projectile drop a diamond sword push last dropped item upwards teleport player to last struck lightning delete last launched firework
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.
Examples:
command /onlinefor: trigger: send "You have been online for %difference between player's last login and now%." send "You first joined the server %difference between player's first login and now% ago."
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
Examples:
# use the exp bar as mana on rightclick with a blaze rod: player's level progress is larger than 0.2 shoot a fireball from the player reduce the player's level progress by 0.2 every 2 seconds: loop all players: level progress of loop-player is smaller than 0.9: increase level progress of the loop-player by 0.1 else: set level progress of the loop-player to 0.99 on xp spawn: cancel event
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.
Examples:
# set vampire players standing in bright sunlight on fire every 5 seconds: loop all players: {vampire::%uuid of loop-player%} is true sunlight level at the loop-player is greater than 10 ignite the loop-player for 5 seconds
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.
Examples:
set {home::%uuid of player%} to the location of the player message "You home was set to %player's location% in %player's world%."
# Countdown loop 10 times: message "%11 - loop-number%" wait a second
# Generate a 10x10 floor made of randomly colored wool below the player loop blocks from the block below the player to the block 10 east of the block below the player: loop blocks from the loop-block to the block 10 north of the loop-block: set loop-block-2 to any wool
loop {top-balances::*}: loop-iteration <= 10 send "#%loop-iteration% %loop-index% has $%loop-value%"
The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them. Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
Examples:
on right click: send "%event-entity% has been in love for %love time of event-entity% more than you!" to player
An expression to obtain the lowest or highest solid (impassable) block at a location. Note that the y-coordinate of the location is not taken into account for this expression.
Examples:
teleport the player to the block above the highest block at the player set the highest solid block at the player's location to the lowest solid block at the player's location
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.
The maximum durability of an item. Changing requires Minecraft 1.20.5+ Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
Examples:
maximum durability of diamond sword if max durability of player's tool is not 0: # Item is damageable set max durability of player's tool to 5000 add 5 to max durability of player's tool reset max durability of player's tool delete max durability of player's tool
Returns the max duration an item can be used for before the action completes. E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow. Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
Examples:
on right click: broadcast max usage duration of player's tool
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
Examples:
on server list ping: set the max players count to (online players count + 1)
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.
Examples:
on item mend: set the mending repair amount to 100
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, the death message of a death event or the broadcasted message in a broadcast event. This expression is mostly useful for being changed.
Examples:
on chat: player has permission "admin" set message to "&c%message%"
on first join: set join message to "Welcome %player% to our awesome server!"
on join: player has played before set join message to "Welcome back, %player%!"
on quit: if {vanish::%player's uuid%} is set: clear quit message else: set quit message to "%player% left this awesome server!"
on death: set the death message to "%player% died!"
on broadcast: set broadcast message to "&a[BROADCAST] %broadcast message%"
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.
Examples:
command /stuck: executable by: players trigger: teleport player to the center of player's location send "You're no longer stuck."
How much virtual money a player has (can be changed).
Examples:
message "You have %player's money%" # the currency name will be added automatically remove 20$ from the player's balance # replace '$' by whatever currency you use add 200 to the player's account # or omit the currency altogether
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.
Examples:
give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player set tool of player to the player's tool named "<gold>Wand" set the name of the player's tool to "<gold>Wand" open hopper inventory named "Magic Hopper" to player
Gets the entity nearest to a location or another entity.
Examples:
kill the nearest pig and cow relative to player teleport player to the nearest cow relative to player teleport player to the nearest entity relative to player
The number of uppercase, lowercase, or digit characters in a string.
Examples:
#Simple Chat Filter on chat: if number of uppercase chars in message / length of message > 0.5 cancel event send "<red>Your message has to many caps!" to player
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'
Examples:
loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5 loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5 loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. real online player count always return the real count of online players and can't be changed.
Examples:
on server list ping: # This will make the max players count 5 if there are 4 players online. set the fake max players count to (online player count + 1)
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
Examples:
set {var} to line 1 parsed as number on chat: set {var::*} to message parsed as "buying %items% for %money%" if parse error is set: message "%parse error%" else if {var::*} is set: cancel event remove {var::2} from the player's balance give {var::1::*} to the player
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.
Examples:
set {var} to line 1 parsed as integer if {var} is not set: parse error is set: message "<red>Line 1 is invalid: %last parse error%" else: message "<red>Please put an integer on line 1!"
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle
Examples:
#for 1.11 and lower passenger of the minecart is a creeper or a cow the saddled pig's passenger is a player #for 1.11.2+ passengers of the minecart contains a creeper or a cow the boat's passenger contains a pig add a cow and a zombie to passengers of last spawned boat set passengers of player's vehicle to a pig and a horse remove all pigs from player's vehicle clear passengers of boat
set damage to 10% of victim's health set damage to 125 percent of damage set {_result} to {_percent} percent of 999 set {_result::*} to 10% of {_numbers::*} set experience to 50% of player's total experience
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).
Examples:
command /ping <player=%player%>: trigger: send "%arg-1%'s ping is %arg-1's ping%"
The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective. This expression will not return anything due to Bukkit limitations.
Examples:
add "Skript" and "Njol" to chat completions of all players remove "text" from {_p}'s chat completions clear player's chat completions
The amount of time before an entity can use a portal. By default, it is 15 seconds after exiting a nether portal or end gateway. Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown. Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players.
Examples:
on portal: wait 1 tick set portal cooldown of event-entity to 5 seconds
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.
Examples:
set {_p} to potion effect of speed of tier 1 without particles for 10 minutes add {_p} to potion effects of player's tool add {_p} to potion effects of target entity add potion effect of speed 1 to potion effects of player
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.
Examples:
set {_p::*} to active potion effects of player clear all the potion effects of player clear all the potion effects of player's tool add potion effects of player to potion effects of player's tool add speed to potion effects of target entity remove speed and night vision from potion effects of player
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.
This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).
Examples:
on server list ping: set the version string to "<light green>Version: <orange>%minecraft version%" set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always
One or more random characters between two given characters. Use 'alphanumeric' if you want only alphanumeric characters. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. If strings of more than one character are given, only the first character of each is used.
Examples:
set {_captcha} to join (5 random characters between "a" and "z") with "" send 3 random alphanumeric characters between "0" and "z"
A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.
Examples:
set the player's health to a random number between 5 and 10 send "You rolled a %random integer from 1 to 6%!" to the player set {_chances::*} to 5 random integers between 5 and 96 set {_decimals::*} to 3 random numbers between 2.7 and -1.5
All regions at a particular location. This expression requires a supported regions plugin to be installed.
Examples:
On click on a sign: line 1 of the clicked block is "[region info]" set {_regions::*} to regions at the clicked block if {_regions::*} is empty: message "No regions exist at this sign." else: message "Regions containing this sign: <gold>%{_regions::*}%<r>."
broadcast nl and nl repeated 200 times broadcast "Hello World " repeated 5 times if "aa" repeated 2 times is "aaaa": broadcast "Ahhhh" repeated 100 times
Rotates a quaternion or vector around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
set {_new} to {_quaternion} rotated around x axis by 10 degrees set {_new} to {_vector} rotated around vector(1, 1, 1) by 45 set {_new} to {_quaternion} rotated by x 45, y 90, z 135
Returns the axis or angle that a quaternion will rotate by/around. All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
Examples:
set {_quaternion} to axisAngle(45, vector(1, 2, 3)) send rotation axis of {_quaternion} # 1, 2, 3 send rotation angle of {_quaternion} # 45 set rotation angle of {_quaternion} to 135 set rotation axis of {_quaternion} to vector(0, 1, 0)
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
Examples:
on spawn of a monster: if the spawn reason is mob spawner: add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster: if the attacker is a player: if the victim doesn't have the scoreboard tag "spawned by a spawner": add 1$ to attacker's balance
An expression to obtain or modify data relating to the pickles of a sea pickle block.
Examples:
on block break: type of block is sea pickle send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!" send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!" send "It had to have contained at least %event-block's minimum sea pickle count% pickles!" cancel event set event-block's sea pickle count to event-block's maximum sea pickle count send "This bad boy is going to hold so many pickles now!!"
The commands that will be sent to the player in a send commands to player event. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.
Examples:
on script load: set {server-icons::default} to the default server icon
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
if index of event-slot is 10: send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory if raw index of event-slot > 27: # outside custom inventory cancel event
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.
Examples:
set the player's walk speed to 1 increase the argument's fly speed by 0.1
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).
Examples:
set {_s} to the first 5 characters of the text argument message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console set {_characters::*} to characters at 1, 2 and 7 in player's display name send the last character of all players' names
For players this is the entity at the crosshair. For mobs and experience orbs this is the entity they are attacking/following (if any). Display entities have a hit box of 0, so you should use 'target display' to collect Display entities May grab entities in unloaded chunks.
Examples:
on entity target: if entity's target is a player: send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-less delete targeted entity of player # for players it will delete the target delete target of last spawned zombie # for entities it will make them target-less
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression. The actual target block will regard the actual hit box of the block.
Examples:
set target block of player to stone set target block of player to oak_stairs[waterlogged=true] break target block of player using player's tool give player 1 of type of target block teleport player to location above target block kill all entities in radius 3 around target block of player set {_block} to actual target block of player break actual target block of player
The time of a world. Use the "minecraft timespan" syntax to change the time according to Minecraft's time intervals. Since Minecraft uses discrete intervals for time (ticks), changing the time by real-world minutes or real-world seconds only changes it approximately. Removing an amount of time from a world's time will move the clock forward a day.
Examples:
set time of world "world" to 2:00 add 2 minecraft hours to time of world "world" add 54 real seconds to time of world "world" # approximately 1 minecraft hour
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.
Examples:
set {_t} to time played of player if player's time played is greater than 10 minutes: give player a diamond sword
The time since a date has passed or the time until a date will pass. This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
Examples:
send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player send "%time until {countdown::end}% until the game begins!" to player
The total experience, in points, of players or experience orbs. Adding to a player's experience will trigger Mending, but setting their experience will not.
Examples:
set total experience of player to 100
add 100 to player's experience
if player's total experience is greater than 100: set player's total experience to 0 give player 1 diamond
Type of a block, item, entity, inventory or potion effect. Types of items, blocks and block datas are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.
Examples:
on rightclick on an entity: message "This is a %type of clicked entity%!"
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!
Examples:
# prevents people from joining the server if they use the name of a player # who has played on this server at least once since this script has been added on login: if {uuid::%name of player%} exists: {uuid::%name of player%} is not uuid of player kick player due to "Someone with your name has played on this server before" else: set {uuid::%name of player%} to uuid of player
Gets the value within objects. Usually used with variables to get the value they store rather than the variable itself, or with lists to get the values of a type.
Examples:
set {_entity} to a random entity out of all entities delete entity within {_entity} # This deletes the entity itself and not the value stored in the variable
set {_list::*} to "something", 10, "test" and a zombie broadcast the strings within {_list::*} # "something", "test"
Gets or changes the W, X, Y or Z component of vectors/quaternions. You cannot use the W component with vectors; it is for quaternions only.
Examples:
set {_v} to vector 1, 2, 3 send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
set {_loc} to {_v} to location in world "world" set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90 set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90
Creates vectors from given directions. Relative directions are relative to the origin, (0, 0, 0). Therefore, the vector from the direction 'forwards' is (0, 0, 1).
Examples:
set {_v} to vector from direction upwards set {_v} to vector in direction of player set {_v} to vector in horizontal direction of player set {_v} to vector from facing of player set {_v::*} to vectors from north, south, east, and west
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.
Examples:
on server list ping: set the protocol version to 0 # 13w41a (1.7), so it will show the version string always set the version string to "<light green>Version: <orange>%minecraft version%"
The view distance of a player as set by the server. Can be changed. NOTE: This is the view distance sent by the server to the player. This has nothing to do with client side view distance settings NOTE: This may not work on some versions (such as MC 1.14.x). The return value in this case will be the view distance set in system.properties.
Examples:
set view distance of player to 10 set {_view} to view distance of player reset view distance of all players add 2 to view distance of player
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.
Examples:
set {_clientView} to the client view distance of player set view distance of player to client view distance of player
An expression for obtaining and modifying the server's whitelist. Players may be added and removed from the whitelist. The whitelist can be enabled or disabled by setting the whitelist to true or false respectively.
Examples:
set the whitelist to false add all players to whitelist reset the whitelist
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.
The yaw or pitch of a location or vector. A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise. A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards. Only Paper 1.19+ users may directly change the yaw/pitch of players.
Examples:
log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log" set {_yaw} to yaw of player set {_p} to pitch of target entity set pitch of player to -90 # Makes the player look upwards, Paper 1.19+ only add 180 to yaw of target of player # Makes the target look behind themselves
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
Returns the item the entities are currently using (ie: the food they're eating, the bow they're drawing back, etc.). This cannot be changed. If an entity is not using any item, this will return null.
Examples:
on damage of player: if victim's active tool is a bow: interrupt player's active item use
Returns the time that the entities have either spent using an item, or the time left for them to finish using an item. If an entity is not using any item, this will return 0 seconds.
Examples:
on right click: broadcast player's remaining item use time wait 1 second broadcast player's item use time
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.
Examples:
# Set targeted crop to fully grown crop set age of targeted block to maximum age of targeted block
# Spawn a baby cow that will only need 1 minute to become an adult spawn a baby cow at player set age of last spawned entity to -1200 # in ticks = 60 seconds
Returns all of the scripts, or just the enabled or disabled ones.
Examples:
command /scripts: trigger: send "All Scripts: %scripts%" to player send "Loaded Scripts: %enabled scripts%" to player send "Unloaded Scripts: %disabled scripts%" to player
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.
Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples:
message "There are %number of all players% players online!"
Returns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair. The default value of max cost set by vanilla Minecraft is 40.
Examples:
on inventory click: if {AnvilRepairSaleActive} = true: wait a tick # recommended, to avoid client bugs set anvil repair cost to anvil repair cost * 50% send "Anvil repair sale is ON!" to player
on inventory click: player have permission "anvil.repair.max.bypass" set max repair cost of event-inventory to 99999
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.
Examples:
give the item-argument to the player-argument damage the player-argument by the number-argument give a diamond pickaxe to the argument add argument 1 to argument 2 heal the last argument
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.
Examples:
set the player's health to 10 - the player's health loop (argument + 2) / 5 times: message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%" message "You have %health of player * 2% half hearts of HP!"
Equipment of living entities, i.e. the boots, leggings, chestplate or helmet.
Examples:
set chestplate of the player to a diamond chestplate helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.
Examples:
on damage: if attack cooldown of attacker < 1: set damage to 0 send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.
Examples:
on damage: victim is a creeper damage the attacked by 1 heart
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.
Examples:
on damage: attacker is a player health of attacker is less than or equal to 2 damage victim by 1 heart
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.
NOTE: Offline players can not have their bed location changed, only online players.
Examples:
if bed of player exists: teleport player the the player's bed else: teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location set the safe bed location of player to spawn location of world("world") # safe/valid bed location
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).
Examples:
# damage player in deserts constantly every real minute: loop all players: biome at loop-player is desert damage the loop-player by 1
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
block is ore set block below to air spawn a creeper above the block loop blocks in radius 4: loop-block is obsidian set loop-block to water block is a chest: clear the inventory of the block
Gets the speed at which the given player would break this block, taking into account tools, potion effects, whether or not the player is in water, enchantments, etc. The returned value is the amount of progress made in breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the player jumps/enters water.
Examples:
on left click using diamond pickaxe: event-block is set send "Break Speed: %break speed for player%" to player
Gets the sound that a given block, blockdata, or itemtype will use in a specific scenario. This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
Examples:
play sound (break sound of dirt) at all players set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.
Examples:
loop blocks above the player: loop blocks between the block below the player and the targeted block: set the blocks below the player, the victim and the targeted block to air set all blocks within {loc1} and {loc2} to stone set all blocks within chunk at player to air
The pages of a book (Supports Skript's chat format) Note: In order to modify the pages of a new written book, you must have the title and author of the book set. Skript will do this for you, but if you want your own, please set those values.
Examples:
on book sign: message "Book Pages: %pages of event-item%" message "Book Page 1: %page 1 of event-item%"
set page 1 of player's held item to "Book writing"
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case
Examples:
"Oops!" in lowercase # oops! "oops!" in uppercase # OOPS! "hellO i'm steve!" in proper case # HellO I'm Steve! "hellO i'm steve!" in strict proper case # Hello I'm Steve! "spAwn neW boSs ()" in camel case # spAwnNeWBoSs() "spAwn neW boSs ()" in strict camel case # spawnNewBoss() "geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer() "geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber() "Hello Player!" in snake case # Hello_Player! "Hello Player!" in lower snake case # hello_player! "Hello Player!" in upper snake case # HELLO_PLAYER! "What is your name?" in kebab case # What-is-your-name? "What is your name?" in lower kebab case # what-is-your-name? "What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?
function is_in_order(letters: strings) :: boolean: loop {_letters::*}: set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if: {_previous-codepoint} is set # if the codepoint of the current character is not # 1 more than the codepoint of the previous character # then the letters are not in order {_codepoint} - {_previous-codepoint} is not 1 then: return false
set {_previous-codepoint} to {_codepoint} return true
All characters between two given characters, useful for generating random strings. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. The ASCII table linked here shows this ordering for the first 256 characters. If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression. If strings of more than one character are given, only the first character of each is used.
Examples:
loop characters from "a" to "f": broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz send alphanumeric characters between "0" and "z"
The color of an item, entity, block, firework effect, or text display. This can also be used to color chat messages with "<%color of ...%>this text is colored!". Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
Examples:
on click on wool: message "This wool block is <%color of block%>%color of block%<reset>!" set the color of the block to black
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.
Examples:
on chat: set message to colored message # Safe; only colors get parsed command /fade <player>: trigger: set display name of the player-argument to uncolored display name of the player-argument command /format <text>: trigger: message formatted text-argument # Safe, because we're sending to whoever used this command
The command that caused an 'on command' event (excluding the leading slash and all arguments)
Examples:
# prevent any commands except for the /exit command during some game on command: if {game::%player%::playing} is true: if the command is not "exit": message "You're not allowed to use commands during the game" cancel the event
main command label of command "skript" description of command "help" label of command "pl" usage of command "help" aliases of command "bukkit:help" permission of command "/op" command "op"'s permission message command "sk"'s plugin owner
command /greet <player>: usage: /greet <target> trigger: if arg-1 is sender: send "&cYou can't greet yourself! Usage: %the usage%" stop send "%sender% greets you!" to arg-1 send "You greeted %arg-1%!"
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%
Examples:
make the command sender execute "/say hi!"
on command: log "%executor% used command /%command% %arguments%" to "commands.log"
# make all player's compasses target a player stored in {compass::target::%player%} every 5 seconds: loop all players: set the loop-player's compass target to location of {compass::target::%%loop-player%}
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.
Examples:
command /home: cooldown: 10 seconds cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%. trigger: teleport player to {home::%player%}
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.
Examples:
give a diamond sword of sharpness 3 to the player kill the creeper kill all powered creepers in the wolf's world projectile is an arrow
How much damage is done in a entity/vehicle/item damage events. For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart). For items, it's the amount of durability damage the item will be taking.
Examples:
on item damage: event-item is any tool clear damage # unbreakable tools as the damage will be 0 on damage: increase the damage by 2
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks
Examples:
give player diamond sword with damage value 100 set player's tool to diamond hoe damaged by 250 give player diamond sword with damage 700 named "BROKEN SWORD" set {_item} to diamond hoe with damage value 50 named "SAD HOE" set target block of player to wool with data value 1 set target block of player to potato plant with data value 7
The difference between two values Supported types include numbers, dates and times.
Examples:
if difference between {command::%player%::lastuse} and now is smaller than a minute: message "You have to wait a minute before using this command again!"
thrust the player upwards set the block behind the player to water loop blocks above the player: set {_rand} to a random integer between 1 and 10 set the block {_rand} meters south east of the loop-block to stone block in horizontal facing of the clicked entity from the player is air spawn a creeper 1.5 meters horizontally behind the player spawn a TNT 5 meters above and 2 meters horizontally behind the player thrust the last spawned TNT in the horizontal direction of the player with speed 0.2 push the player upwards and horizontally forward at speed 0.5 push the clicked entity in in the direction of the player at speed -0.5 open the inventory of the block 2 blocks below the player to the player teleport the clicked entity behind the player grow a regular tree 2 meters horizontally behind the player
Returns or changes the billboard setting of displays. This describes the axes/points around which the display can pivot. Displays spawn with the 'fixed' billboard by default. Resetting this expression will also set it to 'fixed'.
Examples:
set billboard of the last spawned text display to center
Returns or changes the brightness override of displays. Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override. Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option. NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
Examples:
set sky light override of the last spawned text display to 7 subtract 3 from the block light level override of the last spawned text display if sky light level override of {_display} is 5: clear brightness override of {_display}
Returns or changes the height or width of displays. The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it). If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
Examples:
set display height of the last spawned text display to 2.5
Returns or changes the interpolation delay/duration of displays. Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state. Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate. Resetting either value will return that value to 0.
Examples:
set interpolation delay of the last spawned text display to 2 ticks
The teleport duration of displays is the amount of time it takes to get between locations. 0 means that updates are applied immediately. 1 means that the display entity will move from current position to the updated one over one tick. Higher values spread the movement over multiple ticks. Max of 59 ticks.
Examples:
set teleport delay of the last spawned text display to 2 ticks teleport last spawned text display to {_location} wait 2 ticks message "display entity has arrived at %{_location}%"
Returns or changes the transformation rotation of displays. The left rotation is applied first, with the right rotation then being applied based on the rotated axis.
Examples:
set left transformation rotation of last spawned block display to quaternion(1, 0, 0, 0) # reset block display
Returns or changes the view range of displays. Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range. For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
Examples:
set view range of the last spawned text display to 2.9
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.
The first, last, range or a random element of a set, e.g. a list variable. See also: random expression
Examples:
broadcast the first 3 elements of {top players::*} set {_last} to last element of {top players::*} set {_random player} to random element out of all players send 2nd last element of {top players::*} to player set {page2::*} to elements from 11 to 20 of {top players::*}
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.
All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. e.g. all players, all creepers in the player's world, or players in radius 100 of the player.
Examples:
kill all creepers in the player's world send "Psst!" to all players within 100 meters of the player give a diamond to all ops heal all tamed wolves in radius 2000 around {town center} delete all monsters in chunk at player size of all players within {_corner::1} and {_corner::2}}
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.
Examples:
on damage of player: send "You are wounded!" to victim set victim's attack speed attribute to 2
on player experience cooldown change: if xp cooldown change reason is plugin: #Changed by a plugin else if xp cooldown change reason is orb pickup: #Changed by picking up xp orb
The experience cooldown of a player. Experience cooldown is how long until a player can pick up another orb of experience. The cooldown of a player must be 0 to pick up another orb of experience.
Examples:
send experience cooldown of player set the xp pickup cooldown of player to 1 hour if exp collection cooldown of player >= 10 minutes: clear the experience pickup cooldown of player
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.
Examples:
on explode: set the explosion's block yield to 10%
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information
Examples:
on explosion prime: set the yield of the explosion to 10
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information
Examples:
on spawn of a creeper: set the explosive yield of the event-entity to 10
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')
Examples:
# makes a bridge loop blocks from the block below the player in the horizontal facing of the player: set loop-block to cobblestone
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.
Examples:
send "congrats on being staff!" to all players where [player input has permission "staff"]
Represents a 'firework effect' which can be used in the launch firework effect.
Examples:
launch flickering trailing burst firework colored blue and green at player launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.
Examples:
command /date: trigger: send "Full date: %now formatted human-readable%" to sender send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.
Examples:
on teleport: former world was "world_nether" # or 'world was' world will be "world" # or 'world after the event is' on tool change: past tool is an axe the tool after the event will be air on weather change: set {weather::%world%::old} to past weather set {weather::%world%::current} to the new weather
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not furnace, as furnace is not an existing expression. Note that the result and the result slot refer to separate things. the result is the product in a smelt event and the result slot is the output slot of a furnace (where the result will end up). Note that if the result in a smelt event is changed to an item that differs in type from the items currently in the result slot, the smelting will fail to complete (the item will attempt to smelt itself again). Note that if values other than the result are changed, event values may not accurately reflect the actual items in a furnace. Thus you may wish to use the event block in this case (e.g. the fuel slot of the event-block) to get accurate values if needed.
Examples:
set the fuel slot of the clicked block to a lava bucket set the block's ore slot to 64 iron ore give the result of the block to the player clear the result slot of the block
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed. If you have LuckPerms, ensure you have vault integration enabled in the luck perms configurations.
Examples:
on join: broadcast "%group of player%" # this is the player's primary group broadcast "%groups of player%" # this is all of the player's groups
Returns the hanging entity or remover in hanging break and place events.
Examples:
on break of item frame: if item of hanging entity is diamond pickaxe: cancel event if hanging remover is a player: send "You can't break that item frame!" to hanging remover
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.
MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!
Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.
Examples:
command /setpass <text>: trigger: set {password::%uuid of player%} to text-argument hashed with SHA-256 command /login <text>: trigger: if text-argument hashed with SHA-256 is {password::%uuid of player%}: message "Login successful." else: message "Wrong password!"
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.
Examples:
set the block at the player's head to air set the block in front of the player's eyes to glass loop blocks in front of the player's head:
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).
Gets and/or sets the (max) domestication of a horse. The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse). The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
Examples:
function domesticateAndTame(horse: entity, p: offline player, i: int = 10): add {_i} to domestication level of {_horse} if domestication level of {_horse} >= max domestication level of {_horse}: tame {_horse} set tamer of {_horse} to {_p}
The currently selected hotbar slot. To retrieve its number use Slot Index expression. Use future and past tense to grab the previous slot in an item change event, see example.
Examples:
message "%player's current hotbar slot%" set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left
on item held change: if the selected hotbar slot was a diamond: set the currently selected hotbar slot to slot 5 of player
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.
Examples:
on server list ping: clear the hover list add "&aWelcome to the &6Minecraft &aserver!" to the hover list add "" to the hover list # A blank line add "&cThere are &6%online players count% &conline players!" to the hover list
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.
Examples:
set {_first} to the first index of "@" in the text argument if {_s} contains "abc": set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.
Examples:
set {l::*} to "some", "cool" and "values" broadcast "%indices of {l::*}%" # result is 1, 2 and 3
set {_leader-board::first} to 17 set {_leader-board::third} to 30 set {_leader-board::second} to 25 set {_leader-board::fourth} to 42 set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first
on inventory item move: holder of event-initiator-inventory is a chest broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
Represents the input in a filter expression or sort effect. For example, if you ran 'broadcast "something" and "something else" where [input is "something"] the condition would be checked twice, using "something" and "something else" as the inputs. The 'input index' pattern can be used when acting on a variable to access the index of the input.
Examples:
send "congrats on being staff!" to all players where [input has permission "staff"] sort {_list::*} based on length of input index
Gets the amount of rows/slots, viewers and holder of an inventory.
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
Examples:
event-inventory's amount of rows holder of player's top inventory {_inventory}'s viewers
Represents a slot in an inventory. It can be used to change the item in an inventory too.
Examples:
if slot 0 of player is air: set slot 0 of player to 2 stones remove 1 stone from slot 0 of player add 2 stones to slot 0 of player clear slot 1 of player
Change the cooldown of a specific material to a certain amount of Timespan.
Examples:
on right click using stick: set item cooldown of player's tool for player to 1 minute set item cooldown of stone and grass for all players to 20 seconds reset item cooldown of cobblestone and dirt for all players
set the item transform of the last spawned item display to first person left handed set the item transform of the last spawned item display to no transform # Reset to default
An item associated with an entity. For dropped item entities, it gets the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item. Other entities do not have items associated with them.
Examples:
item of event-entity
set the item inside of event-entity to a diamond sword named "Example"
Items or blocks of a specific type, useful for looping.
Examples:
loop items of type ore and log: block contains loop-item message "Theres at least one %loop-item% in this block" drop all blocks at the player # drops one of every block at the player
All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.
Examples:
loop all items in the player's inventory: loop-item is enchanted remove loop-item from the player set {inventory::%uuid of player%::*} to items in the player's inventory
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.
Examples:
message "Online players: %join all players' names with "" | ""%" # %all players% would use the default "x, y, and z" set {_s::*} to the string argument split at ","
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.
Examples:
spawn a priest set {healer::%spawned priest%} to true shoot an arrow from the last spawned entity ignite the shot projectile drop a diamond sword push last dropped item upwards teleport player to last struck lightning delete last launched firework
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.
Examples:
command /onlinefor: trigger: send "You have been online for %difference between player's last login and now%." send "You first joined the server %difference between player's first login and now% ago."
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
Examples:
# use the exp bar as mana on rightclick with a blaze rod: player's level progress is larger than 0.2 shoot a fireball from the player reduce the player's level progress by 0.2 every 2 seconds: loop all players: level progress of loop-player is smaller than 0.9: increase level progress of the loop-player by 0.1 else: set level progress of the loop-player to 0.99 on xp spawn: cancel event
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.
Examples:
# set vampire players standing in bright sunlight on fire every 5 seconds: loop all players: {vampire::%uuid of loop-player%} is true sunlight level at the loop-player is greater than 10 ignite the loop-player for 5 seconds
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.
Examples:
set {home::%uuid of player%} to the location of the player message "You home was set to %player's location% in %player's world%."
# Countdown loop 10 times: message "%11 - loop-number%" wait a second
# Generate a 10x10 floor made of randomly colored wool below the player loop blocks from the block below the player to the block 10 east of the block below the player: loop blocks from the loop-block to the block 10 north of the loop-block: set loop-block-2 to any wool
loop {top-balances::*}: loop-iteration <= 10 send "#%loop-iteration% %loop-index% has $%loop-value%"
The amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them. Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
Examples:
on right click: send "%event-entity% has been in love for %love time of event-entity% more than you!" to player
An expression to obtain the lowest or highest solid (impassable) block at a location. Note that the y-coordinate of the location is not taken into account for this expression.
Examples:
teleport the player to the block above the highest block at the player set the highest solid block at the player's location to the lowest solid block at the player's location
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.
The maximum durability of an item. Changing requires Minecraft 1.20.5+ Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
Examples:
maximum durability of diamond sword if max durability of player's tool is not 0: # Item is damageable set max durability of player's tool to 5000 add 5 to max durability of player's tool reset max durability of player's tool delete max durability of player's tool
Returns the max duration an item can be used for before the action completes. E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow. Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
Examples:
on right click: broadcast max usage duration of player's tool
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
Examples:
on server list ping: set the max players count to (online players count + 1)
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.
Examples:
on item mend: set the mending repair amount to 100
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, the death message of a death event or the broadcasted message in a broadcast event. This expression is mostly useful for being changed.
Examples:
on chat: player has permission "admin" set message to "&c%message%"
on first join: set join message to "Welcome %player% to our awesome server!"
on join: player has played before set join message to "Welcome back, %player%!"
on quit: if {vanish::%player's uuid%} is set: clear quit message else: set quit message to "%player% left this awesome server!"
on death: set the death message to "%player% died!"
on broadcast: set broadcast message to "&a[BROADCAST] %broadcast message%"
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.
Examples:
command /stuck: executable by: players trigger: teleport player to the center of player's location send "You're no longer stuck."
How much virtual money a player has (can be changed).
Examples:
message "You have %player's money%" # the currency name will be added automatically remove 20$ from the player's balance # replace '$' by whatever currency you use add 200 to the player's account # or omit the currency altogether
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, gamerule or world.
Players
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules (1.13+)
Name: The name of the gamerule. Cannot be changed.
Worlds
Name: The name of the world. Cannot be changed.
Examples:
on join: player has permission "name.red" set the player's display name to "<red>[admin] <gold>%name of player%" set the player's tab list name to "<green>%player's name%" set the name of the player's tool to "Legendary Sword of Awesomeness"
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.
Examples:
give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player set tool of player to the player's tool named "<gold>Wand" set the name of the player's tool to "<gold>Wand" open hopper inventory named "Magic Hopper" to player
Gets the entity nearest to a location or another entity.
Examples:
kill the nearest pig and cow relative to player teleport player to the nearest cow relative to player teleport player to the nearest entity relative to player
The number of uppercase, lowercase, or digit characters in a string.
Examples:
#Simple Chat Filter on chat: if number of uppercase chars in message / length of message > 0.5 cancel event send "<red>Your message has to many caps!" to player
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'
Examples:
loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5 loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5 loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. real online player count always return the real count of online players and can't be changed.
Examples:
on server list ping: # This will make the max players count 5 if there are 4 players online. set the fake max players count to (online player count + 1)
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
Examples:
set {var} to line 1 parsed as number on chat: set {var::*} to message parsed as "buying %items% for %money%" if parse error is set: message "%parse error%" else if {var::*} is set: cancel event remove {var::2} from the player's balance give {var::1::*} to the player
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.
Examples:
set {var} to line 1 parsed as integer if {var} is not set: parse error is set: message "<red>Line 1 is invalid: %last parse error%" else: message "<red>Please put an integer on line 1!"
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle
Examples:
#for 1.11 and lower passenger of the minecart is a creeper or a cow the saddled pig's passenger is a player #for 1.11.2+ passengers of the minecart contains a creeper or a cow the boat's passenger contains a pig add a cow and a zombie to passengers of last spawned boat set passengers of player's vehicle to a pig and a horse remove all pigs from player's vehicle clear passengers of boat
set damage to 10% of victim's health set damage to 125 percent of damage set {_result} to {_percent} percent of 999 set {_result::*} to 10% of {_numbers::*} set experience to 50% of player's total experience
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).
Examples:
command /ping <player=%player%>: trigger: send "%arg-1%'s ping is %arg-1's ping%"
The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective. This expression will not return anything due to Bukkit limitations.
Examples:
add "Skript" and "Njol" to chat completions of all players remove "text" from {_p}'s chat completions clear player's chat completions
The amount of time before an entity can use a portal. By default, it is 15 seconds after exiting a nether portal or end gateway. Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown. Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players.
Examples:
on portal: wait 1 tick set portal cooldown of event-entity to 5 seconds
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.
Examples:
set {_p} to potion effect of speed of tier 1 without particles for 10 minutes add {_p} to potion effects of player's tool add {_p} to potion effects of target entity add potion effect of speed 1 to potion effects of player
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.
Examples:
set {_p::*} to active potion effects of player clear all the potion effects of player clear all the potion effects of player's tool add potion effects of player to potion effects of player's tool add speed to potion effects of target entity remove speed and night vision from potion effects of player
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.
This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).
Examples:
on server list ping: set the version string to "<light green>Version: <orange>%minecraft version%" set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always
One or more random characters between two given characters. Use 'alphanumeric' if you want only alphanumeric characters. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. If strings of more than one character are given, only the first character of each is used.
Examples:
set {_captcha} to join (5 random characters between "a" and "z") with "" send 3 random alphanumeric characters between "0" and "z"
A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.
Examples:
set the player's health to a random number between 5 and 10 send "You rolled a %random integer from 1 to 6%!" to the player set {_chances::*} to 5 random integers between 5 and 96 set {_decimals::*} to 3 random numbers between 2.7 and -1.5
All regions at a particular location. This expression requires a supported regions plugin to be installed.
Examples:
On click on a sign: line 1 of the clicked block is "[region info]" set {_regions::*} to regions at the clicked block if {_regions::*} is empty: message "No regions exist at this sign." else: message "Regions containing this sign: <gold>%{_regions::*}%<r>."
broadcast nl and nl repeated 200 times broadcast "Hello World " repeated 5 times if "aa" repeated 2 times is "aaaa": broadcast "Ahhhh" repeated 100 times
Rotates a quaternion or vector around an axis a set amount of degrees, or around all 3 axes at once. Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis. Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once. Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis. The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
set {_new} to {_quaternion} rotated around x axis by 10 degrees set {_new} to {_vector} rotated around vector(1, 1, 1) by 45 set {_new} to {_quaternion} rotated by x 45, y 90, z 135
Returns the axis or angle that a quaternion will rotate by/around. All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
Examples:
set {_quaternion} to axisAngle(45, vector(1, 2, 3)) send rotation axis of {_quaternion} # 1, 2, 3 send rotation angle of {_quaternion} # 45 set rotation angle of {_quaternion} to 135 set rotation axis of {_quaternion} to vector(0, 1, 0)
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
Examples:
on spawn of a monster: if the spawn reason is mob spawner: add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster: if the attacker is a player: if the victim doesn't have the scoreboard tag "spawned by a spawner": add 1$ to attacker's balance
An expression to obtain or modify data relating to the pickles of a sea pickle block.
Examples:
on block break: type of block is sea pickle send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!" send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!" send "It had to have contained at least %event-block's minimum sea pickle count% pickles!" cancel event set event-block's sea pickle count to event-block's maximum sea pickle count send "This bad boy is going to hold so many pickles now!!"
The commands that will be sent to the player in a send commands to player event. 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:
on send command list: set command list to command list where [input does not contain ":"] remove "help" from command list
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.
Examples:
on script load: set {server-icons::default} to the default server icon
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
if index of event-slot is 10: send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory if raw index of event-slot > 27: # outside custom inventory cancel event
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.
Examples:
set the player's walk speed to 1 increase the argument's fly speed by 0.1
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).
Examples:
set {_s} to the first 5 characters of the text argument message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console set {_characters::*} to characters at 1, 2 and 7 in player's display name send the last character of all players' names
For players this is the entity at the crosshair. For mobs and experience orbs this is the entity they are attacking/following (if any). Display entities have a hit box of 0, so you should use 'target display' to collect Display entities May grab entities in unloaded chunks.
Examples:
on entity target: if entity's target is a player: send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-less delete targeted entity of player # for players it will delete the target delete target of last spawned zombie # for entities it will make them target-less
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression. The actual target block will regard the actual hit box of the block.
Examples:
set target block of player to stone set target block of player to oak_stairs[waterlogged=true] break target block of player using player's tool give player 1 of type of target block teleport player to location above target block kill all entities in radius 3 around target block of player set {_block} to actual target block of player break actual target block of player
The time of a world. Use the "minecraft timespan" syntax to change the time according to Minecraft's time intervals. Since Minecraft uses discrete intervals for time (ticks), changing the time by real-world minutes or real-world seconds only changes it approximately. Removing an amount of time from a world's time will move the clock forward a day.
Examples:
set time of world "world" to 2:00 add 2 minecraft hours to time of world "world" add 54 real seconds to time of world "world" # approximately 1 minecraft hour
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.
Examples:
set {_t} to time played of player if player's time played is greater than 10 minutes: give player a diamond sword
The time since a date has passed or the time until a date will pass. This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
Examples:
send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player send "%time until {countdown::end}% until the game begins!" to player
The total experience, in points, of players or experience orbs. Adding to a player's experience will trigger Mending, but setting their experience will not.
Examples:
set total experience of player to 100
add 100 to player's experience
if player's total experience is greater than 100: set player's total experience to 0 give player 1 diamond
Type of a block, item, entity, inventory or potion effect. Types of items, blocks and block datas are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.
Examples:
on rightclick on an entity: message "This is a %type of clicked entity%!"
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!
Examples:
# prevents people from joining the server if they use the name of a player # who has played on this server at least once since this script has been added on login: if {uuid::%name of player%} exists: {uuid::%name of player%} is not uuid of player kick player due to "Someone with your name has played on this server before" else: set {uuid::%name of player%} to uuid of player
Gets the value within objects. Usually used with variables to get the value they store rather than the variable itself, or with lists to get the values of a type.
Examples:
set {_entity} to a random entity out of all entities delete entity within {_entity} # This deletes the entity itself and not the value stored in the variable
set {_list::*} to "something", 10, "test" and a zombie broadcast the strings within {_list::*} # "something", "test"
Gets or changes the W, X, Y or Z component of vectors/quaternions. You cannot use the W component with vectors; it is for quaternions only.
Examples:
set {_v} to vector 1, 2, 3 send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
set {_loc} to {_v} to location in world "world" set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90 set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90
Creates vectors from given directions. Relative directions are relative to the origin, (0, 0, 0). Therefore, the vector from the direction 'forwards' is (0, 0, 1).
Examples:
set {_v} to vector from direction upwards set {_v} to vector in direction of player set {_v} to vector in horizontal direction of player set {_v} to vector from facing of player set {_v::*} to vectors from north, south, east, and west
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.
Examples:
on server list ping: set the protocol version to 0 # 13w41a (1.7), so it will show the version string always set the version string to "<light green>Version: <orange>%minecraft version%"
The view distance of a player as set by the server. Can be changed. NOTE: This is the view distance sent by the server to the player. This has nothing to do with client side view distance settings NOTE: This may not work on some versions (such as MC 1.14.x). The return value in this case will be the view distance set in system.properties.
Examples:
set view distance of player to 10 set {_view} to view distance of player reset view distance of all players add 2 to view distance of player
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.
Examples:
set {_clientView} to the client view distance of player set view distance of player to client view distance of player
An expression for obtaining and modifying the server's whitelist. Players may be added and removed from the whitelist. The whitelist can be enabled or disabled by setting the whitelist to true or false respectively.
Examples:
set the whitelist to false add all players to whitelist reset the whitelist
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.
The yaw or pitch of a location or vector. A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise. A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards. Only Paper 1.19+ users may directly change the yaw/pitch of players.
Examples:
log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log" set {_yaw} to yaw of player set {_p} to pitch of target entity set pitch of player to -90 # Makes the player look upwards, Paper 1.19+ only add 180 to yaw of target of player # Makes the target look behind themselves
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/functions.html b/docs/nightly/dev/feature/functions.html
index 98a176a8b7..3107e79be2 100644
--- a/docs/nightly/dev/feature/functions.html
+++ b/docs/nightly/dev/feature/functions.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
These functions are defined by Skript. You may also create your own functions! Tutorial for doing so is planned, but right now you need to seek it elsewhere.
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).
date(year: number, month: number, day: number, hour: number = 0, minute: number = 0, second: number = 0, millisecond: number = 0, zone_offset: number = NaN, dst_offset: number = NaN)
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).
Examples:
date(2014, 10, 1) # 0:00, 1st October 2014 date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990 date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)
Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this article.
Examples:
command /balance: aliases: bal executable by: players trigger: set {_money} to formatNumber({money::%sender's uuid%}) send "Your balance: %{_money}%" to sender
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.
Examples:
# TELEPORTING teleport player to location(1,1,1, world "world") teleport player to location(1,1,1, world "world", 100, 0) teleport player to location(1,1,1, world "world", yaw of player, pitch of player) teleport player to location(1,1,1, world of player) teleport player to location(1,1,1, world("world")) teleport player to location({_x}, {_y}, {_z}, {_w}, {_yaw}, {_pitch}) # SETTING BLOCKS set block at location(1,1,1, world "world") to stone set block at location(1,1,1, world "world", 100, 0) to stone set block at location(1,1,1, world of player) to stone set block at location(1,1,1, world("world")) to stone set block at location({_x}, {_y}, {_z}, {_w}) to stone # USING VARIABLES set {_l1} to location(1,1,1) set {_l2} to location(10,10,10) set blocks within {_l1} and {_l2} to stone if player is within {_l1} and {_l2}: # OTHER kill all entities in radius 50 around location(1,65,1, world "world") delete all entities in radius 25 around location(50,50,50, world "world_nether") ignite all entities in radius 25 around location(1,1,1, world of player)
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.
Returns a offline player from their name or UUID. This function will still return the player if they're online. If Paper 1.16.5+ is used, the 'allowLookup' parameter can be set to false to prevent this function from doing a web lookup for players who have not joined before. Lookups can cause lag spikes of up to multiple seconds, so use offline players with caution.
Examples:
set {_p} to offlineplayer("Notch") set {_p} to offlineplayer("069a79f4-44e9-4726-a5be-fca90e38aaf5") set {_p} to offlineplayer("Notch", false)
Returns an online player from their name or UUID, if player is offline function will return nothing. Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
Examples:
set {_p} to player("Notch") # will return an online player whose name is or starts with 'Notch' set {_p} to player("Notch", true) # will return the only online player whose name is 'Notch' set {_p} to player("069a79f4-44e9-4726-a5be-fca90e38aaf5") # &amp;amp;lt;none&amp;amp;gt; if player is offline
Returns a RGB color from the given red, green and blue parameters. Alpha values can be added optionally, but these only take affect in certain situations, like text display backgrounds.
Examples:
dye player's leggings rgb(120, 30, 45) set the colour of a text display to rgb(10, 50, 100, 50)
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.
These functions are defined by Skript. You may also create your own functions! Tutorial for doing so is planned, but right now you need to seek it elsewhere.
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).
date(year: number, month: number, day: number, hour: number = 0, minute: number = 0, second: number = 0, millisecond: number = 0, zone_offset: number = NaN, dst_offset: number = NaN)
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).
Examples:
date(2014, 10, 1) # 0:00, 1st October 2014 date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990 date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)
Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this article.
Examples:
command /balance: aliases: bal executable by: players trigger: set {_money} to formatNumber({money::%sender's uuid%}) send "Your balance: %{_money}%" to sender
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.
Examples:
# TELEPORTING teleport player to location(1,1,1, world "world") teleport player to location(1,1,1, world "world", 100, 0) teleport player to location(1,1,1, world "world", yaw of player, pitch of player) teleport player to location(1,1,1, world of player) teleport player to location(1,1,1, world("world")) teleport player to location({_x}, {_y}, {_z}, {_w}, {_yaw}, {_pitch}) # SETTING BLOCKS set block at location(1,1,1, world "world") to stone set block at location(1,1,1, world "world", 100, 0) to stone set block at location(1,1,1, world of player) to stone set block at location(1,1,1, world("world")) to stone set block at location({_x}, {_y}, {_z}, {_w}) to stone # USING VARIABLES set {_l1} to location(1,1,1) set {_l2} to location(10,10,10) set blocks within {_l1} and {_l2} to stone if player is within {_l1} and {_l2}: # OTHER kill all entities in radius 50 around location(1,65,1, world "world") delete all entities in radius 25 around location(50,50,50, world "world_nether") ignite all entities in radius 25 around location(1,1,1, world of player)
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.
Returns a offline player from their name or UUID. This function will still return the player if they're online. If Paper 1.16.5+ is used, the 'allowLookup' parameter can be set to false to prevent this function from doing a web lookup for players who have not joined before. Lookups can cause lag spikes of up to multiple seconds, so use offline players with caution.
Examples:
set {_p} to offlineplayer("Notch") set {_p} to offlineplayer("069a79f4-44e9-4726-a5be-fca90e38aaf5") set {_p} to offlineplayer("Notch", false)
Returns an online player from their name or UUID, if player is offline function will return nothing. Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
Examples:
set {_p} to player("Notch") # will return an online player whose name is or starts with 'Notch' set {_p} to player("Notch", true) # will return the only online player whose name is 'Notch' set {_p} to player("069a79f4-44e9-4726-a5be-fca90e38aaf5") # &amp;amp;lt;none&amp;amp;gt; if player is offline
Returns a RGB color from the given red, green and blue parameters. Alpha values can be added optionally, but these only take affect in certain situations, like text display backgrounds.
Examples:
dye player's leggings rgb(120, 30, 45) set the colour of a text display to rgb(10, 50, 100, 50)
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.
Skript is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.
This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.
Skript is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.
This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.
Quick Look
command /sethome:
permission: skript.home # Permission required for this command
description: Set your home # Description of this command
executable by: players # Console won't be able to run this command
diff --git a/docs/nightly/dev/feature/sections.html b/docs/nightly/dev/feature/sections.html
index c94cb8fdd5..57bc9215ae 100644
--- a/docs/nightly/dev/feature/sections.html
+++ b/docs/nightly/dev/feature/sections.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed
parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true
Examples:
if player's health is greater than or equal to 4: send "Your health is okay so far but be careful!"
else if player's health is greater than 2: send "You need to heal ASAP, your health is very low!"
else: # Less than 2 hearts send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"
parse if plugin "SomePluginName" is enabled: # parse if %condition% # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section
Filters a variable list based on the supplied conditions. Unlike the filter expression, this effect maintains the indices of the filtered list. It also supports filtering based on meeting any of the given criteria, rather than all, like multi-line if statements.
Examples:
set {_a::*} to integers between -10 and 10
filter {_a::*} to match: input is a number mod(input, 2) = 0 input > 0
Loop sections repeat their code with multiple values.
A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.
Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.
List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).
Examples:
loop all players: send "Hello %loop-player%!" to loop-player
loop items in player's inventory: if loop-item is dirt: set loop-item to air
loop 10 times: send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc. wait 1 second
loop {Coins::*}: set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
While Loop sections are loops that will just keep repeating as long as a condition is met.
Examples:
while size of all players < 5: send "More players are needed to begin the adventure" to all players wait 5 seconds
set {_counter} to 1 do while {_counter} > 1: # false but will increase {_counter} by 1 then get out add 1 to {_counter}
# Be careful when using while loops with conditions that are almost # always true for a long time without using 'wait %timespan%' inside it, # otherwise it will probably hang and crash your server. while player is online: give player 1 dirt wait 1 second # without using a delay effect the server will crash
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed
parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true
Examples:
if player's health is greater than or equal to 4: send "Your health is okay so far but be careful!"
else if player's health is greater than 2: send "You need to heal ASAP, your health is very low!"
else: # Less than 2 hearts send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"
parse if plugin "SomePluginName" is enabled: # parse if %condition% # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section
Filters a variable list based on the supplied conditions. Unlike the filter expression, this effect maintains the indices of the filtered list. It also supports filtering based on meeting any of the given criteria, rather than all, like multi-line if statements.
Examples:
set {_a::*} to integers between -10 and 10
filter {_a::*} to match: input is a number mod(input, 2) = 0 input > 0
Loop sections repeat their code with multiple values.
A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.
Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.
List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).
Examples:
loop all players: send "Hello %loop-player%!" to loop-player
loop items in player's inventory: if loop-item is dirt: set loop-item to air
loop 10 times: send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc. wait 1 second
loop {Coins::*}: set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200
Spawns entities. This can be used as an effect and as a section.
If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Examples:
spawn 3 creepers at the targeted block spawn a ghast 5 meters above the player spawn a zombie at the player: set name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player: set billboard of event-display to center # allows the display to rotate around the center axis
While Loop sections are loops that will just keep repeating as long as a condition is met.
Examples:
while size of all players < 5: send "More players are needed to begin the adventure" to all players wait 5 seconds
set {_counter} to 1 do while {_counter} > 1: # false but will increase {_counter} by 1 then get out add 1 to {_counter}
# Be careful when using while loops with conditions that are almost # always true for a long time without using 'wait %timespan%' inside it, # otherwise it will probably hang and crash your server. while player is online: give player 1 dirt wait 1 second # without using a delay effect the server will crash
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/structures.html b/docs/nightly/dev/feature/structures.html
index 1e016ef47c..35dc69281a 100644
--- a/docs/nightly/dev/feature/structures.html
+++ b/docs/nightly/dev/feature/structures.html
@@ -1 +1 @@
- Skript Documentation - 2.9.4-nightly-1238f62
command /broadcast <string>: usage: A command for broadcasting a message to all players. permission: skript.command.broadcast permission message: You don't have permission to broadcast messages aliases: /bc executable by: players and console cooldown: 15 seconds cooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%. cooldown bypass: skript.command.broadcast.admin cooldown storage: {cooldown::%player%} trigger: broadcast the argument
Functions are structures that can be executed with arguments/parameters to run code. They can also return a value to the trigger that is executing the function. Note that local functions come before global functions execution
Examples:
function sayMessage(message: text): broadcast {_message} # our message argument is available in '{_message}'
local function giveApple(amount: number) :: item: return {_amount} of apple
function getPoints(p: player) returns number: return {points::%{_p}%}
Options are used for replacing parts of a script with something else. For example, an option may represent a message that appears in multiple locations. Take a look at the example below that showcases this.
Examples:
options: no_permission: You're missing the required permission to execute this command!
Used for defining variables present within a script. This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Examples:
variables: {joins} = 0 {balance::%player%} = 0
on join: add 1 to {joins} message "Your balance is %{balance::%player%}%"
\ No newline at end of file
+ Skript Documentation - 2.9.4-nightly-6ba6706
command /broadcast <string>: usage: A command for broadcasting a message to all players. permission: skript.command.broadcast permission message: You don't have permission to broadcast messages aliases: /bc executable by: players and console cooldown: 15 seconds cooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%. cooldown bypass: skript.command.broadcast.admin cooldown storage: {cooldown::%player%} trigger: broadcast the argument
Functions are structures that can be executed with arguments/parameters to run code. They can also return a value to the trigger that is executing the function. Note that local functions come before global functions execution
Examples:
function sayMessage(message: text): broadcast {_message} # our message argument is available in '{_message}'
local function giveApple(amount: number) :: item: return {_amount} of apple
function getPoints(p: player) returns number: return {points::%{_p}%}
Options are used for replacing parts of a script with something else. For example, an option may represent a message that appears in multiple locations. Take a look at the example below that showcases this.
Examples:
options: no_permission: You're missing the required permission to execute this command!
Used for defining variables present within a script. This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Examples:
variables: {joins} = 0 {balance::%player%} = 0
on join: add 1 to {joins} message "Your balance is %{balance::%player%}%"
\ No newline at end of file
diff --git a/docs/nightly/dev/feature/text.html b/docs/nightly/dev/feature/text.html
index 4575cb9158..74a056c59d 100644
--- a/docs/nightly/dev/feature/text.html
+++ b/docs/nightly/dev/feature/text.html
@@ -1,2 +1,2 @@
- Skript Documentation - 2.9.4-nightly-1238f62
Skript allows you to write pieces of text (programmers usually call them strings) in the scripts. This is done by putting the text inside double quotes, as follows:
"this is text"
Simple, isn't it? If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to write it right there!
Formatting Text
But isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.
Colors
Minecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:
Skript allows you to write pieces of text (programmers usually call them strings) in the scripts. This is done by putting the text inside double quotes, as follows:
"this is text"
Simple, isn't it? If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to write it right there!
Formatting Text
But isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.
Colors
Minecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:
Color name tags, for example <red>
Minecraft color codes, like §c; using & works, too
Here's a table of all colors, including both Skript names and color codes:
Color
Code
Name
Alternative Names
§0
black
§1
blue
dark blue
§2
green
dark green
§3
cyan
aqua, dark cyan, dark aqua, dark turquoise, dark turquois
§4
red
dark red
§5
purple
dark purple
§6
orange
orange, gold, dark yellow
§7
grey
light grey, gray, light gray, silver
§8
dark gray
dark grey
§9
light blue
light blue, indigo
§a
light green
lime, lime green
§b
light cyan
light aqua, turquoise, turquois, light blue
§c
light red
pink
§d
magenta
light purple
§e
yellow
light yellow
§f
white
In Minecraft 1.16, support was added for 6-digit hexadecimal colors to specify custom colors other than the 16 default color codes. A new tag can be used to format with these colors. The tag looks like this:
<#hex code>
Here's what the tag would look like when used in a script:
send "<#123456>Hey %player%!" to player
For information not related to Skript, see Minecraft Wiki page concerning colors. Note that depending on Skript configuration, color codes may do more than just change color of text after them. By default, for backwards compatibility, they clear following styles: magic, bold, strikethrough, underlined, italic. Other styles are not affected, and this feature can be toggled of in config.sk.
Other Styles
Minecraft also has various other styles available. The following are available everywhere, including item and entity names:
Code
Name
Alternative Names
§k
magic test
obfuscated
§l
bold
b
§m
strikethrough
strike, s
§n
underlined
underline, u
§o
italic
italics, i
§r
reset
r
If it wasn't clear from the table, §r clears all other formatting and colors. You'll probably use it quite often when sending chat messages from scripts.
Skript also supports certain newer features, which are only available in chat. Those do not have formatting codes, so you must use tags for them.
Name
Alternative Names
Description
link
open url, url
Opens a link when player clicks on text
run command
command, cmd
Makes player execute a chat command when they click on text
suggest command
sgt
Adds a command to chat prompt of player when clicked
tooltip
show text, ttp
Shows a tooltip when player hovers over text with their mouse
font
f
Change the font of the text (1.16+)
insertion
insert, ins
Will append a text at player's current cursor in chat input only while holding SHIFT.
All of these styles require a parameter, in format
<name:parameter>
For link, parameter must be either http or https url if you want clients to recognize it. For others, it can be any text you'd like (you can make player run invalid commands if you wish).
Text and Variables
Variable names are text, but obviously formatting that text does no good. However, everything else you can do for text, you can do for variable names. A guide about this is coming... some day.