Patterns: |
|
Since: | 2.5 |
Usable in events: | sponge absorb |
Return Type: | Block |
Examples:
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper |
Return Type: | Item |
Examples:
if victim's active tool is a bow:
interrupt player's active item use
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper |
Return Type: | Timespan |
Examples:
broadcast player's remaining item use time
wait 1 second
broadcast player's item use time
Patterns: |
|
Since: | 2.4 |
Return Type: | Living Entity |
Examples:
loop affected entities:
if loop-value is a player:
send "WARNING: you've step on an area effect cloud!" to loop-value
Patterns: | |
Since: | 2.7 |
Return Type: | integer |
Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | Object |
Examples:
trigger:
send all the banned players
Patterns: |
|
Since: | 2.2-dev35 |
Requirements: | Vault, a permission plugin that supports Vault |
Return Type: | Text |
Examples:
trigger:
if argument is "list":
send "%all groups%"
Patterns: |
|
Since: | 2.7 |
Return Type: | Offline Player |
Examples:
Patterns: | |
Since: | 2.2-dev33 |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | 2.5 |
Return Type: | Text |
Examples:
trigger:
send "All Scripts: %scripts%" to player
send "Loaded Scripts: %enabled scripts%" to player
send "Unloaded Scripts: %disabled scripts%" to player
Patterns: |
|
Since: | 2.6 |
Return Type: | Text |
Examples:
send "Number of all script commands: %size of all script commands%"
Patterns: | |
Since: | 1.4.3 |
Return Type: | Number |
Examples:
altitude of the attacker is higher than the altitude of the victim
set damage to damage * 1.2
Patterns: | |
Since: | 1.0 |
Return Type: | long |
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.
{list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6
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:
Patterns: |
|
Since: | 2.0 |
Return Type: | long |
Examples:
Patterns: |
|
Since: | 2.8.0 |
Return Type: | integer |
Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | Text |
Examples:
type of event-inventory is anvil inventory
if the anvil text input of the event-inventory is "FREE OP":
ban player
Patterns: |
|
Since: | 2.5 |
Usable in events: | enchant |
Return Type: | Enchantment Type |
Examples:
set the applied enchantments to sharpness 10 and fire aspect 5
Patterns: | |
Since: | 1.0, 2.7 (support for command events) |
Return Type: | Object |
Examples:
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
Patterns: |
|
Since: | 1.4.2 |
Return Type: | Object |
Examples:
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!"
Patterns: |
|
Since: | 1.0, 2.8.0 (Armour) |
Return Type: | Slot |
Examples:
helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin
Patterns: |
|
Since: | 2.8.0 |
Return Type: | Block |
Examples:
Patterns: |
|
Since: | 2.5.1 |
Return Type: | long |
Examples:
event-projectile is an arrow
set arrow knockback strength of event-projectile to 10
Patterns: |
|
Since: | 2.5 |
Return Type: | long |
Examples:
Patterns: | |
Since: | 2.6.1 |
Requirements: | Minecraft 1.15+ |
Return Type: | float |
Examples:
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
Patterns: |
|
Since: | 1.3, 2.6.1 (projectile hit event) |
Usable in events: | damage, death, projectile hit |
Return Type: | Entity |
Examples:
victim is a creeper
damage the attacked by 1 heart
Patterns: |
|
Since: | 1.3 |
Usable in events: | damage, death, destroy |
Return Type: | Entity |
Examples:
attacker is a player
health of attacker is less than or equal to 2
damage victim by 1 heart
Patterns: |
|
Since: | 2.0, 2.7 (offlineplayers, safe bed) |
Return Type: | Location |
safe bed location
.NOTE: Offline players can not have their bed location changed, only online players.
Examples:
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
Patterns: | |
Since: | 1.4.4, 2.6.1 (3D biomes) |
Return Type: | Biome |
Examples:
every real minute:
loop all players:
biome at loop-player is desert
damage the loop-player by 1
Patterns: |
|
Since: | 1.0 |
Return Type: | Block |
Examples:
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
Patterns: | |
Since: | 1.0 |
Return Type: | Block |
Examples:
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
Patterns: | |
Since: | 2.7 |
Requirements: | 1.17+ |
Return Type: | float |
Examples:
event-block is set
send "Break Speed: %break speed for player%" to player
Patterns: | |
Since: | 2.5, 2.5.2 (set) |
Requirements: | Minecraft 1.13+ |
Return Type: | Block Data |
Examples:
set block at player to {data}
set block data of target block to oak_stairs[facing=south;waterlogged=true]
Patterns: |
|
Since: | 2.6 |
Requirements: | Minecraft 1.13+ |
Return Type: | Number |
Examples:
if block hardness of target block > 5:
Patterns: | |
Since: | 1.0 |
Return Type: | Block |
Examples:
set loop-block to air
Patterns: |
|
Since: | 1.0, 2.5.1 (within/cuboid/chunk) |
Return Type: | Block |
Examples:
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
Patterns: |
|
Since: | 2.1 |
Requirements: | Supported regions plugin |
Return Type: | Block |
Examples:
clear the loop-block
Patterns: |
|
Since: | 2.2-dev31 |
Return Type: | Text |
Examples:
message "Book Title: %author of event-item%"
Patterns: |
|
Since: | 2.2-dev31, 2.7 (changers) |
Return Type: | Text |
Examples:
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"
Patterns: |
|
Since: | 2.2-dev31 |
Return Type: | Text |
Examples:
message "Book Title: %title of event-item%"
Patterns: |
|
Since: | 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases) |
Return Type: | Text |
Examples:
"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?
Patterns: | |
Since: | 2.9.0 |
Return Type: | integer |
Examples:
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
Patterns: |
|
Since: | 2.9.0 |
Return Type: | Text |
Examples:
set {_lower} to codepoint of {_lower}
return {_none} if {_lower} is not set
set {_upper} to codepoint of {_upper}
return {_none} if {_upper} is not set
loop integers between {_lower} and {_upper}:
add character from codepoint loop-value to {_chars::*}
return {_chars::*}
Patterns: | |
Since: | 2.8.0 |
Return Type: | Text |
Examples:
broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz
send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz
send alphanumeric characters between "0" and "z"
Patterns: |
|
Since: | 2.2-dev31 |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | 2.2-Fixes-v7, 2.2-dev35 (clearing recipients) |
Return Type: | Player |
Examples:
Patterns: |
|
Since: | 2.0, 2.8.0 (loaded chunks) |
Return Type: | Chunk |
Examples:
set {_chunks::*} to the loaded chunks of the player's world
Patterns: |
|
Since: | 1.0, 2.2-dev35 (more clickable things) |
Usable in events: | click, inventory click |
Return Type: | Object |
Examples:
if the clicked block is a chest:
show the inventory of the clicked block to the player
Patterns: |
|
Since: | 1.2 |
Return Type: | Color |
Examples:
message "This wool block is <%color of block%>%color of block%<reset>!"
set the color of the block to black
Patterns: | |
Since: | 2.0 |
Return Type: | Text |
Examples:
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
Patterns: |
|
Since: | 2.0, 2.7 (support for script commands) |
Usable in events: | command |
Return Type: | Text |
Examples:
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
Patterns: |
|
Since: | 2.6 |
Return Type: | Text |
Examples:
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%!"
Patterns: |
|
Since: | 2.0 |
Usable in events: | command |
Return Type: | Command Sender |
Examples:
on command:
log "%executor% used command /%command% %arguments%" to "commands.log"
Patterns: | |
Since: | 2.0 |
Return Type: | Location |
Examples:
every 5 seconds:
loop all players:
set the loop-player's compass target to location of {compass::target::%%loop-player%}
Patterns: |
|
Since: | 1.3.1 |
Return Type: | Command Sender |
Examples:
send "message to console" to the console
Patterns: |
|
Since: | 2.2-dev33 |
Return Type: | Object |
Examples:
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%}
Patterns: | |
Since: | 1.4.3 |
Return Type: | Number |
Examples:
message "Watch out for lava!"
Patterns: |
|
Since: | 1.0 |
Return Type: | Entity |
Examples:
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow
Patterns: | |
Since: | 2.2-dev34, 2.8.0 (chat format) |
Requirements: | Paper 1.16+ (chat format) |
Return Type: | Inventory |
Examples:
set {_inventory} to a chest inventory with 1 row
set slot 4 of {_inventory} to a diamond named "example"
open {_inventory} to player
open chest inventory named "<#00ff00>hex coloured title!" with 6 rows to player
Patterns: |
|
Since: | 2.5 |
Requirements: | 1.14+ |
Return Type: | long |
Examples:
set {_model} to custom model data of player's tool
Patterns: |
|
Since: | 1.3.5, 2.8.0 (item damage event) |
Usable in events: | Damage, Vehicle Damage, Item Damage |
Return Type: | Number |
Examples:
event-item is any tool
clear damage # unbreakable tools as the damage will be 0
on damage:
increase the damage by 2
Patterns: |
|
Since: | 2.0 |
Return Type: | Damage Cause |
Examples:
Patterns: |
|
Since: | 1.2, 2.7 (durability reversed) |
Return Type: | integer |
Examples:
reset the durability of {_item}
set durability of player's held item to 0
Patterns: | |
Since: | 2.4 |
Return Type: | Item Type |
Examples:
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
Patterns: | |
Since: | 2.2-dev33 |
Return Type: | Date |
Examples:
set {_hourAfter} to 1 hour after {someOtherDate}
set {_hoursBefore} to 5 hours before {someOtherDate}
Patterns: | |
Since: | 1.4 |
Return Type: | Object |
Examples:
message "You have to wait a minute before using this command again!"
Patterns: | |
Since: | 2.3 |
Return Type: | Difficulty |
Examples:
Patterns: |
|
Since: | 1.0 (basic), 2.0 (extended) |
Return Type: | Direction |
Examples:
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
Patterns: |
|
Since: | 1.0 |
Usable in events: | death |
Return Type: | Item Type |
Examples:
remove 4 planks from the drops
Patterns: | |
Since: | 2.5.1 |
Requirements: | Minecraft 1.15+ ('as %entity%') |
Return Type: | Item Type |
Examples:
give drops of block using player's tool to player
Patterns: | |
Since: | 2.0, 2.7 (relative to last element), 2.8.0 (range of elements) |
Return Type: | Object |
Examples:
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::*}
Patterns: |
|
Since: | 2.5 |
Usable in events: | enchant prepare, enchant |
Return Type: | Item Type |
Examples:
set the enchanted item to a diamond chestplate
on enchant prepare:
set the enchant item to a wooden sword
Patterns: |
|
Since: | 2.5 |
Usable in events: | enchant |
Return Type: | long |
Examples:
send "Cost: %the displayed enchanting cost%" to player
Patterns: |
|
Since: | 2.5 |
Usable in events: | enchant prepare |
Return Type: | long |
Examples:
send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player
Patterns: |
|
Since: | 2.0 |
Return Type: | long |
Examples:
message "You have a sword of sharpness %level of sharpness of the player's tool% equipped"
Patterns: | |
Since: | 2.5 |
Usable in events: | enchant prepare |
Requirements: | 1.11 or newer |
Return Type: | Enchantment Offer |
Examples:
send "Your enchantment offers are: %the enchantment offers%" to player
Patterns: |
|
Since: | 2.5 |
Requirements: | 1.11 or newer |
Return Type: | long |
Examples:
Patterns: |
|
Since: | 1.2.1, 2.5 (chunks) |
Return Type: | Entity |
all players
, all creepers in the player's world
, or players in radius 100 of the player
. Examples:
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
Patterns: |
|
Since: | 2.5 |
Return Type: | Boolean |
Examples:
Patterns: |
|
Since: | 2.5, 2.6.1 (final attribute value) |
Return Type: | Number |
Examples:
send "You are wounded!" to victim
set victim's attack speed attribute to 2
Patterns: |
|
Since: | 2.5 |
Return Type: | Offline Player |
Examples:
delete owner of target entity
set {_t} to uuid of tamer of target entity
Patterns: |
|
Since: | 2.1, 2.5.3 (block break event), 2.7 (experience change event) |
Usable in events: | experience spawn, break / mine, experience change |
Return Type: | Experience |
Examples:
add 5 to the spawned experience
on break of coal ore:
clear dropped experience
on break of diamond ore:
if tool of player = diamond pickaxe:
add 100 to dropped experience
Patterns: |
|
Since: | 2.5, 2.8.6 (modify blocks) |
Usable in events: | explode |
Return Type: | Block |
Examples:
loop exploded blocks:
add loop-block to {exploded::blocks::*}
on explode:
loop exploded blocks:
if loop-block is grass:
remove loop-block from exploded blocks
on explode:
clear exploded blocks
on explode:
set exploded blocks to blocks in radius 10 around event-entity
on explode:
add blocks above event-entity to exploded blocks
Patterns: |
|
Since: | 2.5 |
Usable in events: | explosion |
Return Type: | Number |
Examples:
set the explosion's block yield to 10%
Patterns: |
|
Since: | 2.5 |
Usable in events: | explosion prime |
Return Type: | Number |
Examples:
set the yield of the explosion to 10
Patterns: | |
Since: | 2.5 |
Requirements: | Minecraft 1.12 or newer for creepers |
Return Type: | Number |
Examples:
set the explosive yield of the event-entity to 10
Patterns: |
|
Since: | 1.4 |
Return Type: | Direction |
Examples:
loop blocks from the block below the player in the horizontal facing of the player:
set loop-block to cobblestone
Patterns: |
|
Since: | 2.5 |
Usable in events: | block fertilize |
Requirements: | Minecraft 1.13 or newer |
Return Type: | Block |
Examples:
Patterns: |
|
Since: | 2.2-dev36 |
Return Type: | Object |
Examples:
Patterns: |
|
Since: | 2.4 |
Return Type: | Firework Effect |
Examples:
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
Patterns: | |
Since: | 2.2-dev31, 2.7 (support variables in format) |
Return Type: | Text |
Examples:
trigger:
send "Full date: %now formatted human-readable%" to sender
send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
Patterns: | |
Since: | 1.1 |
Return Type: | Object |
Examples:
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
Patterns: |
|
Since: | 2.8.0 |
Return Type: | double |
Examples:
send action bar "Memory left: %free memory%/%max memory%MB" to player
wait 5 ticks
Patterns: | |
Since: | 1.0, 2.8.0 (syntax rework) |
Usable in events: | smelt, fuel burn |
Return Type: | Slot |
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 block's ore slot to 64 iron ore
give the result of the block to the player
clear the result slot of the block
Patterns: | |
Since: | 2.5 |
Requirements: | Minecraft 1.13+ |
Return Type: | Gamerule Value |
Examples:
Patterns: |
|
Since: | 2.2-dev21 |
Return Type: | Boolean |
Examples:
Patterns: |
|
Since: | 2.2-dev35 |
Requirements: | Vault, a permission plugin that supports Vault |
Return Type: | Text |
Examples:
broadcast "%group of player%" # this is the player's primary group
broadcast "%groups of player%" # this is all of the player's groups
Patterns: |
|
Since: | 2.6.2 |
Return Type: | Entity |
Examples:
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
Patterns: |
|
Since: | 2.0, 2.2-dev32 (SHA-256 algorithm) |
Return Type: | Text |
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:
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!"
Patterns: |
|
Since: | 2.7 |
Usable in events: | Egg Throw |
Return Type: | Entity Type |
Examples:
set the hatching entity type to a primed tnt
Patterns: |
|
Since: | 2.0 |
Return Type: | Location |
Examples:
set the block in front of the player's eyes to glass
loop blocks in front of the player's head:
Patterns: |
|
Since: | 2.5.1 |
Usable in events: | heal |
Return Type: | double |
Examples:
increase the heal amount by 2
remove 0.5 from the healing amount
Patterns: |
|
Since: | 2.5 |
Usable in events: | heal |
Return Type: | Heal Reason |
Examples:
heal reason is satiated
send "You ate enough food and gained full health back!"
Patterns: |
|
Since: | 1.0 |
Usable in events: | damage |
Return Type: | Number |
Examples:
Patterns: | |
Since: | 2.3 |
Return Type: | Player |
Examples:
Patterns: |
|
Since: | 2.5 |
Return Type: | long |
Examples:
send "You clicked the hotbar button %hotbar button%!"
Patterns: | |
Since: | 2.2-dev36 |
Return Type: | Slot |
Examples:
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
Patterns: |
|
Since: | 2.3 |
Usable in events: | server list ping |
Requirements: | Paper 1.12.2 or newer |
Return Type: | Text |
Examples:
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
Patterns: | |
Since: | 1.4, 2.2-dev26 (when used in connect event), 2.3 (when used in server list ping event) |
Return Type: | Text |
Examples:
broadcast "Banned the IP %IP of player%"
on connect:
log "[%now%] %player% (%ip%) is connected to the server."
on server list ping:
send "%IP-address%" to the console
Patterns: | |
Since: | 2.1 |
Return Type: | long |
Examples:
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}
Patterns: | |
Since: | 2.4 (indices), 2.6.1 (sorting) |
Return Type: | Text |
Examples:
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
Patterns: |
|
Since: | 2.8.0 |
Usable in events: | Inventory Item Move |
Return Type: | Inventory |
Examples:
holder of event-initiator-inventory is a chest
broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
Patterns: |
|
Since: | 2.2-dev36, 2.9.0 (input index) |
Return Type: | Object |
Examples:
sort {_list::*} based on length of input index
Patterns: |
|
Since: | 1.0 |
Return Type: | Object |
Examples:
clear the player's inventory
remove 5 wool from the inventory of the clicked block
Patterns: |
|
Since: | 2.2-dev16 |
Return Type: | Inventory Action |
Examples:
Patterns: |
|
Since: | 2.8.0 |
Usable in events: | Inventory Close |
Requirements: | Paper |
Return Type: | Inventory Close Reasons |
Examples:
inventory close reason is teleport
send "Your inventory closed due to teleporting!" to player
Patterns: |
|
Since: | 2.2-dev34, 2.5 (slots) |
Return Type: | Object |
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:
holder of player's top inventory
{_inventory}'s viewers
Patterns: | |
Since: | 2.2-dev24 |
Return Type: | Slot |
Examples:
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
Patterns: |
|
Since: | unknown (before 2.1) |
Return Type: | Item |
Examples:
item is a clock
set the time to 6:00
Patterns: |
|
Since: | 2.2-dev24 |
Return Type: | long |
Examples:
Patterns: |
|
Since: | 2.8.0 |
Return Type: | Timespan |
Examples:
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
Patterns: |
|
Since: | 2.2-dev36 |
Return Type: | Enchantment Type |
Examples:
Patterns: | |
Since: | 2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles) |
Requirements: | Minecraft 1.15.2+ (throwable projectiles) |
Return Type: | Slot |
Examples:
Patterns: | |
Since: | 2.5 |
Requirements: | 1.14+ |
Return Type: | Item Type |
Examples:
set slot 1 of inventory of player to wooden hoe with custom model data 357
Patterns: | |
Since: | 2.3 |
Return Type: | Item Type |
Examples:
give {_test} to player
Patterns: |
|
Since: | 1.0 pre-5 |
Return Type: | Item Type |
Examples:
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
Patterns: |
|
Since: | 2.0, 2.8.0 (specific types of items) |
Return Type: | Slot |
Examples:
loop-item is enchanted
remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory
Patterns: |
|
Since: | 2.1, 2.5.2 (regex support), 2.7 (case sensitivity) |
Return Type: | Text |
Examples:
set {_s::*} to the string argument split at ","
Patterns: | |
Since: | 2.3 |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | 2.5.1 |
Return Type: | Number |
Examples:
Patterns: |
|
Since: | 2.2-Fixes-V10 |
Return Type: | Damage Cause |
Examples:
Patterns: |
|
Since: | 2.3 |
Requirements: | Paper 1.12.2 or newer |
Return Type: | Server Icon |
Examples:
Patterns: | |
Since: | 2.4 |
Requirements: | Paper 1.9 or newer |
Return Type: | Resource Pack State |
Examples:
Patterns: |
|
Since: | 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), 2.7 (struck lightning, firework) |
Return Type: | Entity |
Examples:
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
Patterns: |
|
Since: | 2.5 |
Return Type: | Date |
Examples:
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."
Patterns: |
|
Since: | 2.3 |
Return Type: | Entity |
Examples:
Patterns: | |
Since: | unknown (before 2.1) |
Usable in events: | level change |
Return Type: | long |
Examples:
set the player's level to 0
Patterns: | |
Since: | 2.0 |
Usable in events: | level change |
Return Type: | Number |
increase the player's level progress by 0.5
will make the player gain a level if their progress was more than 50%. Examples:
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
Patterns: | |
Since: | 1.3.4 |
Return Type: | byte |
Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | Text |
Examples:
broadcast "This server uses Vault plugin!"
send "Plugins (%size of loaded plugins%): %plugins%" to player
Patterns: |
|
Since: | 2.0 |
Return Type: | Location |
Examples:
set {_loc} to the location 1 meter above the player
Patterns: |
|
Since: | 2.0 |
Return Type: | Location |
Examples:
set {_loc} to the location 1 meter above the player
Patterns: | |
Since: | Unknown |
Return Type: | Location |
Examples:
message "You home was set to %player's location% in %player's world%."
Patterns: |
|
Since: | 2.8.0 |
Return Type: | long |
Examples:
give player 1 stone
wait 5 ticks
if loop-counter > 30:
stop loop
loop {top-balances::*}:
if loop-iteration <= 10:
broadcast "#%loop-iteration% %loop-index% has $%loop-value%"
Patterns: |
|
Since: | 1.0, 2.8.0 (loop-counter) |
Return Type: | Object |
Examples:
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%"
Patterns: |
|
Since: | 2.7 |
Requirements: | MC 1.16+ |
Return Type: | Item |
Examples:
chance of %10
add 64 diamonds
send "You hit the jackpot!!"
Patterns: |
|
Since: | 2.1 |
Return Type: | Text |
Examples:
Patterns: | |
Since: | 2.2-dev34, 2.9.0 (lowest solid block, 'non-air' option removed, additional syntax option) |
Return Type: | Block |
Examples:
set the highest solid block at the player's location to the lowest solid block at the player's location
Patterns: |
|
Since: | 2.3 |
Return Type: | Text |
Examples:
set the motd to "Join now!"
Patterns: |
|
Since: | 2.5, 2.9.0 (change) |
Requirements: | Minecraft 1.20.5+ (custom amount) |
Return Type: | integer |
Examples:
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
Patterns: |
|
Since: | 2.0 |
Usable in events: | damage, death |
Return Type: | Number |
Examples:
set the maximum health of the player to 100
spawn a giant
set the last spawned entity's max health to 1000
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper |
Return Type: | Timespan |
Examples:
broadcast max usage duration of player's tool
Patterns: |
|
Since: | 2.3, 2.7 (modify max real players) |
Requirements: | Paper 1.16+ (modify max real players) |
Return Type: | integer |
Examples:
set the max players count to (online players count + 1)
Patterns: | |
Since: | 2.7 |
Return Type: | Timespan |
Examples:
send "you're about to freeze!" to the player
Patterns: | |
Since: | 2.1 |
Return Type: | long |
Examples:
Patterns: |
|
Since: | 2.1.1 |
Return Type: | Player |
Examples:
!kick myself
!give a diamond axe to me
Patterns: |
|
Since: | 2.5.1 |
Return Type: | long |
Examples:
set the mending repair amount to 100
Patterns: |
|
Since: | 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message), 2.9.0 (clear message) |
Usable in events: | chat, join, quit, death |
Return Type: | Text |
Examples:
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!"
Patterns: |
|
Since: | 2.2-dev36 |
Return Type: | Object |
Examples:
broadcast "%metadata value ""healer"" of player%"
clear metadata value "healer" of player
Patterns: | |
Since: | 2.6.1 |
Return Type: | Location |
Examples:
executable by: players
trigger:
teleport player to the center of player's location
send "You're no longer stuck."
Patterns: | |
Since: | 2.5.1 |
Return Type: | Vector |
Examples:
set derailed velocity of event-entity to vector 2, 10, 2
Patterns: |
|
Since: | 2.0, 2.5 (offline players) |
Requirements: | Vault, an economy plugin that supports Vault |
Return Type: | Money |
Examples:
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
Patterns: | |
Since: | 2.7 |
Requirements: | Paper 1.16+ |
Return Type: | Moon Phase |
Examples:
send "Watch for the wolves!"
Patterns: |
|
Since: | 2.2-dev27 |
Return Type: | Block |
Examples:
Patterns: |
|
Since: | before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name), 2.7 (worlds) |
Return Type: | Text |
- 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:
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"
Patterns: | |
Since: | before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name), 2.7 (worlds) |
Return Type: | Text |
- 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:
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"
Patterns: |
|
Since: | 2.0, 2.2-dev34 (inventories) |
Return Type: | Object |
set name of <item/inventory> to <text>
. Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | Entity |
Examples:
teleport player to the nearest cow relative to player
teleport player to the nearest entity relative to player
on click:
kill nearest pig
Patterns: |
|
Since: | 2.5 |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | 2.5 |
Return Type: | long |
Examples:
set victim's invulnerability ticks to 20 #Victim will not take damage for the next second
Patterns: |
|
Since: | 1.4 |
Return Type: | Date |
Examples:
Patterns: | |
Since: | 2.5 |
Return Type: | long |
Examples:
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
Patterns: | |
Since: | 1.4.6 (integers & numbers), 2.5.1 (decimals) |
Return Type: | Number |
Examples:
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
Patterns: |
|
Since: | 2.2-dev35 |
Return Type: | Offline Player |
Examples:
Patterns: |
|
Since: | 2.3 |
Requirements: | Paper (fake count) |
Return Type: | long |
real online player count
always return the real count of online players and can't be changed. Examples:
# 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)
Patterns: | |
Since: | 2.2-dev24, 2.2-dev35 (Just 'current inventory' works in player events) |
Return Type: | Inventory |
Examples:
Patterns: | |
Since: | 2.0 |
Return Type: | Object |
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:
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
Patterns: |
|
Since: | 2.0 |
Return Type: | Text |
Examples:
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!"
Patterns: | |
Since: | 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+) |
Return Type: | Entity |
Examples:
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
Patterns: | |
Since: | 2.8.0 |
Return Type: | Number |
Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | double |
Examples:
Patterns: | |
Since: | 2.2-dev36 |
Return Type: | long |
Examples:
trigger:
send "%arg-1%'s ping is %arg-1's ping%"
Patterns: |
|
Since: | 2.6 |
Return Type: | Item Type |
Examples:
send "You are holding a plain diamond!"
Patterns: | |
Since: | 2.6.2 |
Requirements: | Paper 1.12.2 or newer |
Return Type: | integer |
Examples:
trigger:
send "Protocol version of %arg-1%: %protocol version of arg-1%"
Patterns: |
|
Since: | 2.0 |
Return Type: | Item Type |
Examples:
set the block at the entity to the entity's skull
Patterns: | |
Since: | 2.2-dev34 |
Return Type: | Weather Type |
Examples:
reset player's weather
if arg-player's weather is rainy
Patterns: |
|
Since: | 2.4 |
Usable in events: | portal_create |
Return Type: | Block |
Examples:
loop portal blocks:
broadcast "%loop-block% is part of a portal!"
Patterns: | |
Since: | 2.8.0 |
Return Type: | Timespan |
Examples:
wait 1 tick
set portal cooldown of event-entity to 5 seconds
Patterns: |
|
Since: | 2.5.2 |
Return Type: | Potion Effect |
Examples:
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
Patterns: |
|
Since: | 2.7 |
Return Type: | integer |
Examples:
Patterns: |
|
Since: | 2.5.2 |
Return Type: | Potion Effect |
Examples:
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
Patterns: | |
Since: | 2.0 |
Requirements: | Vault, a chat plugin that supports Vault |
Return Type: | Text |
Examples:
cancel event
broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world
set the player's prefix to "[<red>Admin<reset>] "
Patterns: |
|
Since: | 2.5.1 |
Return Type: | Boolean |
Examples:
event-projectile is an arrow
set projectile critical mode of event-projectile to true
Patterns: |
|
Since: | 2.3 |
Usable in events: | server list ping |
Requirements: | Paper 1.12.2 or newer |
Return Type: | long |
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:
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
Patterns: |
|
Since: | 2.8.0 |
Requirements: | Paper 1.16.5+ |
Return Type: | Quit Reason |
Examples:
quit reason was kicked
player is banned
clear {server::player::%uuid of player%::*}
Patterns: | |
Since: | 2.8.0 |
Return Type: | Text |
Examples:
send 3 random alphanumeric characters between "0" and "z"
Patterns: | |
Since: | 1.4 |
Return Type: | Number |
random number between 2 and 1
will work as well as random number between 1 and 2
. Examples:
send "You rolled a %random integer from 1 to 6%!" to the player
Patterns: |
|
Since: | 2.5.1 |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | unknown (2.2) |
Return Type: | Text |
Examples:
Patterns: |
|
Since: | 2.8.0 |
Usable in events: | ready arrow |
Return Type: | Item |
Examples:
selected bow's name is "Spectral Bow"
if selected arrow is not a spectral arrow:
cancel event
Patterns: | |
Since: | 2.1 |
Requirements: | Supported regions plugin |
Return Type: | Offline Player |
Examples:
message "You're entering %region% whose owners are %owners of region%"
Patterns: | |
Since: | 2.1 |
Requirements: | Supported regions plugin |
Return Type: | Region |
Examples:
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>."
Patterns: |
|
Since: | 2.0 |
Return Type: | Timespan |
Examples:
send "hurry, get to the surface!" to the player
Patterns: | |
Since: | 2.9.0 |
Requirements: | Spigot 1.19.4+ |
Return Type: | Timespan |
Examples:
Patterns: |
|
Since: | 2.2-dev35 |
Return Type: | Location |
Examples:
set respawn location to {example::spawn}
Patterns: | |
Since: | 2.0 |
Return Type: | long |
Examples:
set line 1 of the block to rounded "%(1.5 * player's level)%"
add rounded down argument to the player's health
Patterns: | |
Since: | 2.2-Fixes-v10, 2.2-dev35 (fully modifiable), 2.6.2 (syntax pattern changed) |
Return Type: | Number |
Examples:
Patterns: | |
Since: | 2.3 |
Return Type: | Text |
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
Examples:
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
Patterns: |
|
Since: | 2.0 |
Usable in events: | Script Load/Unload |
Return Type: | Text |
Examples:
set {running::%script%} to true
on script unload:
set {running::%script%} to false
Patterns: | |
Since: | 2.7 |
Return Type: | integer |
Examples:
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!!"
Patterns: |
|
Since: | 2.8.0 |
Usable in events: | send command list |
Return Type: | Text |
Examples:
set command list to command list where [input does not contain ":"]
remove "help" from command list
Patterns: |
|
Since: | 2.3 |
Requirements: | Paper 1.12.2 or newer |
Return Type: | Server Icon |
Examples:
set {server-icons::default} to the default server icon
Patterns: |
|
Since: | 1.3.7 |
Return Type: | Living Entity |
Examples:
Patterns: | |
Since: | 1.3 |
Return Type: | Text |
Examples:
line 2 of the clicked block is "[Heal]":
heal the player
set line 3 to "%player%"
Patterns: | |
Since: | 2.9.0 |
Return Type: | Offline Player |
Examples:
set skull owner of {_block} to "Njol" parsed as offlineplayer
Patterns: | |
Since: | 2.2-dev35, 2.8.0 (raw index) |
Return Type: | long |
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
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
Patterns: |
|
Since: | 2.3 |
Return Type: | Spawn Reason |
Examples:
spawn reason is reinforcements or breeding
cancel event
Patterns: | |
Since: | 2.4, 2.9.2 (trial spawner) |
Return Type: | Entity Type |
Examples:
if event-block is spawner:
send "Spawner's type is %target block's entity type%"
Patterns: |
|
Since: | 2.2-dev32d |
Return Type: | Number |
Examples:
Patterns: | |
Since: | 2.4-alpha4, 2.7 (Paper Spectator Event) |
Requirements: | Paper |
Return Type: | Entity |
Examples:
message "&c%spectator target% currently has %{game::kills::%spectator target%}% kills!" to the player
on player stop spectating:
past spectator target was a zombie
set spectator target to the nearest skeleton
Patterns: | |
Since: | unknown (before 2.1) |
Return Type: | Number |
Examples:
increase the argument's fly speed by 0.1
Patterns: |
|
Since: | 2.1, 2.5.2 (character at, multiple strings support) |
Return Type: | Text |
Examples:
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
Patterns: |
|
Since: | 2.2-dev36 |
Return Type: | Number |
Examples:
Patterns: |
|
Since: | 2.2-dev25 |
Return Type: | Player |
Examples:
if the tamer is a player:
send "someone tamed something!" to console
Patterns: |
|
Since: | 1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks) |
Return Type: | Entity |
Examples:
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
Patterns: |
|
Since: | 1.0, 2.9.0 (actual/exact) |
Return Type: | Block |
Examples:
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
Patterns: |
|
Since: | 2.2-dev35 |
Return Type: | Teleport Cause |
Examples:
teleport cause is nether portal, end portal or end gateway
cancel event
Patterns: |
|
Since: | 2.7 |
Usable in events: | Egg Throw |
Return Type: | Projectile |
Examples:
Patterns: | |
Since: | 1.0 |
Return Type: | Time |
Examples:
add 2 minecraft hours to time of world "world"
add 54 real seconds to time of world "world" # approximately 1 minecraft hour
Patterns: |
|
Since: | 2.5, 2.7 (offline players) |
Requirements: | MC 1.15+ (offline players) |
Return Type: | Timespan |
<none>
. Examples:
if player's time played is greater than 10 minutes:
give player a diamond sword
set player's time played to 0 seconds
Patterns: |
|
Since: | 2.9.0 |
Return Type: | long |
Examples:
send "It has been %days of {_t}% day(s) since last payout."
Patterns: |
|
Since: | 1.0 |
Return Type: | Slot |
Examples:
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow
Patterns: | |
Since: | 2.7 |
Return Type: | integer |
Examples:
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
Patterns: |
|
Since: | 2.8.0 |
Return Type: | Transform Reason |
Examples:
transform reason is infection, drowned or frozen
Patterns: |
|
Since: | 1.4, 2.5.2 (potion effect), 2.7 (block datas) |
Return Type: | Object |
Examples:
message "This is a %type of clicked entity%!"
Patterns: |
|
Since: | 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs) |
Return Type: | Text |
Examples:
# 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
Patterns: |
|
Since: | 2.2-dev13b, 2.9.0 (breakable) |
Return Type: | Item Type |
Examples:
give breakable {_weapon} to all players
Patterns: | |
Since: | 2.7 |
Return Type: | Object |
Examples:
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"
Patterns: | |
Since: | 2.2-dev28 |
Return Type: | Location |
Examples:
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
Patterns: |
|
Since: | 2.8.0 |
Return Type: | Vector |
Examples:
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
Patterns: | |
Since: | 2.2-dev28 |
Return Type: | Vector |
Examples:
set {_v} to cylindrical vector radius 1, yaw loop-value, height 2
set {_v} to cylindrical vector radius 1, yaw 90, height 2
Patterns: | |
Since: | 2.2-dev28 |
Return Type: | Number |
Examples:
set {_v} to vector 1, 2, 3
set standard length of {_v} to 2
send "%standard length of {_v}%"
Patterns: |
|
Since: | 2.2-dev28, 2.7 (signed components) |
Return Type: | Vector |
Examples:
Patterns: | |
Since: | 2.2-dev28 |
Return Type: | Vector |
Examples:
set {_v} to spherical vector radius 1, yaw loop-value, pitch loop-value
set {_v} to spherical vector radius 1, yaw 45, pitch 90
Patterns: | |
Since: | 2.2-dev28 |
Return Type: | Number |
Examples:
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::*}%"
Patterns: |
|
Since: | 2.0 |
Return Type: | Text |
Examples:
message "This server is powered by Skript %skript version%"
Patterns: |
|
Since: | 2.3 |
Usable in events: | Server List Ping |
Requirements: | Paper 1.12.2+ |
Return Type: | Text |
Examples:
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%"
Patterns: | |
Since: | 2.4 |
Requirements: | Paper |
Return Type: | integer |
Examples:
set {_view} to view distance of player
reset view distance of all players
add 2 to view distance of player
Patterns: | |
Since: | 2.5 |
Requirements: | 1.13.2+ |
Return Type: | long |
Examples:
set view distance of player to client view distance of player
Patterns: | |
Since: | 1.0 |
Usable in events: | weather change |
Return Type: | Weather Type |
Examples:
weather in "world" is rainy
Patterns: |
|
Since: | 2.9.0 |
Return Type: | Boolean |
Examples:
broadcast "Flying: %whether player is flying%"
Patterns: |
|
Since: | 2.5.2, 2.9.0 (delete) |
Return Type: | Offline Player |
Examples:
add all players to whitelist
reset the whitelist
Patterns: | |
Since: | 2.9.0 |
Requirements: | Spigot 1.20.5+ |
Return Type: | Item Type |
Examples:
equip player with netherite helmet without fire resistance
drop fire resistant stone at player
Patterns: | |
Since: | 1.0 |
Return Type: | World |
Examples:
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk
Patterns: | |
Since: | 2.7 |
Return Type: | World Environment |
Examples:
apply fire resistance to player for 10 minutes
Patterns: |
|
Since: | 1.0 |
Return Type: | World |
Examples:
broadcast "You're in %loop-world%" to loop-world
Patterns: |
|
Since: | 1.2 |
Return Type: | Object |
Examples:
Patterns: | |
Since: | 2.0, 2.2-dev28 (vector yaw/pitch), 2.9.0 (entity changers) |
Requirements: | Paper 1.19+ (player changers) |
Return Type: | float |
Examples:
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