Expressions

Absorbed blocks

🔗

Expression

Patterns:
  • [the] absorbed blocks
Since: 2.5
Usable in events: sponge absorb
Return Type: Block
The blocks absorbed by a sponge block.

Examples:

the absorbed blocks

Active Item

🔗

Expression

Patterns:
Since: 2.8.0
Requirements: Paper
Return Type: Item
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

Active Item Use Time

🔗

Expression

Patterns:
Since: 2.8.0
Requirements: Paper
Return Type: Timespan
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

Affected Entities

🔗

Expression

Patterns:
  • [the] affected entities
Since: 2.4
Return Type: Living Entity
The affected entities in the area cloud effect event.

Examples:

on area cloud effect:
    loop affected entities:
        if loop-value is a player:
            send "WARNING: you've step on an area effect cloud!" to loop-value

Age of Block/Entity

🔗

Expression

Patterns:
Since: 2.7
Return Type: integer
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

All Banned Players/IPs

🔗

Expression

Patterns:
  • [all [[of] the]|the] banned (players|(ips|ip addresses))
Since: 2.7
Return Type: Object
Obtains the list of all banned players or IP addresses.

Examples:

command /banlist:
    trigger:
        send all the banned players

All Groups

🔗

Expression

Patterns:
  • all groups
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: Text
All the groups a player can have. This expression requires Vault and a compatible permissions plugin to be installed.

Examples:

command /group <text>:
    trigger:
        if argument is "list":
            send "%all groups%"

All Operators

🔗

Expression

Patterns:
  • [all [[of] the]|the] [server] [non(-| )]op[erator]s
Since: 2.7
Return Type: Offline Player
The list of operators on the server.

Examples:

set {_ops::*} to all operators

All Permissions

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] permissions (from|of) %players%
  • [(all [[of] the]|the)] %players%'[s] permissions
Since: 2.2-dev33
Return Type: Text
Returns all permissions of the defined player(s). Note that the modifications to resulting list do not actually change permissions.

Examples:

set {_permissions::*} to all permissions of the player

All Scripts

🔗

Expression

Patterns:
  • [all [of the]|the] scripts [without ([subdirectory] paths|parents)]
  • [all [of the]|the] (enabled|loaded) scripts [without ([subdirectory] paths|parents)]
  • [all [of the]|the] (disabled|unloaded) scripts [without ([subdirectory] paths|parents)]
Since: 2.5
Return Type: Text
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

All commands

🔗

Expression

Patterns:
  • [(all|the|all [of] the)] [registered] [script] commands
Since: 2.6
Return Type: Text
Returns all registered commands or all script commands.

Examples:

send "Number of all commands: %size of all commands%"
send "Number of all script commands: %size of all script commands%"

Alphabetical Sort

🔗

Expression

Patterns:
  • alphabetically sorted %texts%
Since: 2.2-dev18b
Return Type: Text
Sorts given strings in alphabetical order.

Examples:

set {_list::*} to alphabetically sorted {_strings::*}

Altitude

🔗

Expression

Patterns:
Since: 1.4.3
Return Type: Number
Effectively an alias of 'y-coordinate of …', it represents the height of some object above bedrock.

Examples:

on damage:
    altitude of the attacker is higher than the altitude of the victim
    set damage to damage * 1.2

Amount

🔗

Expression

Patterns:
  • [the] (amount|number|size) of %objects%
  • [the] recursive (amount|number|size) of %objects%
Since: 1.0
Return Type: long
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.

 {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:

message "There are %number of all players% players online!"

Amount of Items

🔗

Expression

Patterns:
Since: 2.0
Return Type: long
Counts how many of a particular item type are in a given inventory.

Examples:

message "You have %number of ores in the player's inventory% ores in your inventory."

Anvil Repair Cost

🔗

Expression

Patterns:
  • [the] [anvil] [item] [max[imum]] repair cost [of %inventories%]
  • %inventories%'[s] [anvil] [item] [max[imum]] repair cost
Since: 2.8.0
Return Type: integer
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

Anvil Text Input

🔗

Expression

Patterns:
  • [the] anvil [inventory] (rename|text) input of %inventories%
  • %inventories%'[s] anvil [inventory] (rename|text) input
Since: 2.7
Return Type: Text
An expression to get the name to be applied to an item in an anvil inventory.

Examples:

on inventory click:
    type of event-inventory is anvil inventory
    if the anvil text input of the event-inventory is "FREE OP":
        ban player

Applied Enchantments

🔗

Expression

Patterns:
  • [the] applied enchant[ment]s
Since: 2.5
Usable in events: enchant
Return Type: Enchantment Type
The applied enchantments in an enchant event. Deleting or removing the applied enchantments will prevent the item's enchantment.

Examples:

on enchant:
    set the applied enchantments to sharpness 10 and fire aspect 5

Argument

🔗

Expression

Patterns:
  • [the] last arg[ument]
  • [the] arg[ument](-| )<(\d+)>
  • [the] <(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th> arg[ument][s]
  • [(all [[of] the]|the)] arg[ument][s]
  • [the] %*type%( |-)arg[ument][( |-)<\d+>]
  • [the] arg[ument]( |-)%*type%[( |-)<\d+>]
Since: 1.0, 2.7 (support for command events)
Return Type: Object
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

🔗

Expression

Patterns:
Since: 1.4.2
Return Type: Object
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!"

Armour Slot

🔗

Expression

Patterns:
  • [the] (((boots|shoes)|leg[ging]s|chestplate[s]|helmet[s]) [(item|slot)]|armo[u]r[s]) of %living entities%
  • %living entities%'[s] (((boots|shoes)|leg[ging]s|chestplate[s]|helmet[s]) [(item|slot)]|armo[u]r[s])
Since: 1.0, 2.8.0 (Armour)
Return Type: Slot
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

Arrow Attached Block

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Block
Returns the attached block of an arrow.

Examples:

set hit block of last shot arrow to diamond block

Arrow Knockback Strength

🔗

Expression

Patterns:
Since: 2.5.1
Return Type: long
An arrow's knockback strength.

Examples:

on shoot:
    event-projectile is an arrow
    set arrow knockback strength of event-projectile to 10

Arrows Stuck

🔗

Expression

Patterns:
Since: 2.5
Return Type: long
The number of arrows stuck in a living entity.

Examples:

set arrows stuck in player to 5

Attack Cooldown

🔗

Expression

Patterns:
Since: 2.6.1
Requirements: Minecraft 1.15+
Return Type: float
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

Attacked

🔗

Expression

Patterns:
  • [the] (attacked|damaged|victim) [<(.+)>]
Since: 1.3, 2.6.1 (projectile hit event)
Usable in events: damage, death, projectile hit
Return Type: Entity
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

Attacker

🔗

Expression

Patterns:
  • [the] (attacker|damager)
Since: 1.3
Usable in events: damage, death, destroy
Return Type: Entity
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

Bed

🔗

Expression

Patterns:
  • [the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offline players%
  • %offline players%'[s] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]]
Since: 2.0, 2.7 (offlineplayers, safe bed)
Return Type: Location
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

Biome

🔗

Expression

Patterns:
Since: 1.4.4, 2.6.1 (3D biomes)
Return Type: Biome
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

Block

🔗

Expression

Patterns:
  • [the] [event-]block
Since: 1.0
Return Type: 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

Block

🔗

Expression

Patterns:
Since: 1.0
Return Type: 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

Block Break Speed

🔗

Expression

Patterns:
Since: 2.7
Requirements: 1.17+
Return Type: float
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

Block Data

🔗

Expression

Patterns:
Since: 2.5, 2.5.2 (set)
Requirements: Minecraft 1.13+
Return Type: Block Data
Get the block data associated with a block. This data can also be used to set blocks.

Examples:

set {data} to block data of target block
set block at player to {data}
set block data of target block to oak_stairs[facing=south;waterlogged=true]

Block Hardness

🔗

Expression

Patterns:
Since: 2.6
Requirements: Minecraft 1.13+
Return Type: Number
Obtains the block's hardness level (also known as "strength"). This number is used to calculate the time required to break each block.

Examples:

set {_hard} to block hardness of target block
if block hardness of target block > 5:

Block Sphere

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] blocks in radius %number% [(of|around) %location%]
  • [(all [[of] the]|the)] blocks around %location% in radius %number%
Since: 1.0
Return Type: Block
All blocks in a sphere around a center, mostly useful for looping.

Examples:

loop blocks in radius 5 around the player:
    set loop-block to air

Blocks

🔗

Expression

Patterns:
Since: 1.0, 2.5.1 (within/cuboid/chunk)
Return Type: Block
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

Blocks in Region

🔗

Expression

Patterns:
  • [(all|the)] blocks (in|of) [[the] region[s]] %regions%
Since: 2.1
Requirements: Supported regions plugin
Return Type: Block
All blocks in a region. This expression requires a supported regions plugin to be installed.

Examples:

loop all blocks in the region {arena.%{faction.%player%}%}:
    clear the loop-block

Book Author

🔗

Expression

Patterns:
  • [the] [book] (author|writer|publisher) of %item types%
  • %item types%'[s] [book] (author|writer|publisher)
Since: 2.2-dev31
Return Type: Text
The author of a book.

Examples:

on book sign:
    message "Book Title: %author of event-item%"

Book Pages

🔗

Expression

Patterns:
Since: 2.2-dev31, 2.7 (changers)
Return Type: Text
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"

Book Title

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: Text
The title of a book.

Examples:

on book sign:
    message "Book Title: %title of event-item%"

Burn/Cook Time

🔗

Expression

Patterns:
  • [the] burn[ing] time
  • [the] (burn|cook)[ing] time of %blocks%
  • %blocks%'[s] (burn|cook)[ing] time
Since: 2.3
Return Type: Timespan
The time a furnace takes to burn an item in a fuel burn event. Can also be used to change the burn/cook time of a placed furnace.

Examples:

on fuel burn:
    if fuel slot is coal:
        set burning time to 1 tick

Case Text

🔗

Expression

Patterns:
  • %texts% in (upper|lower)[ ]case
  • (upper|lower)[ ]case %texts%
  • capitali(s|z)ed %texts%
  • %texts% in [(lenient|strict) ](proper|title)[ ]case
  • [(lenient|strict) ](proper|title)[ ]case %texts%
  • %texts% in [(lenient|strict) ]camel[ ]case
  • [(lenient|strict) ]camel[ ]case %texts%
  • %texts% in [(lenient|strict) ]pascal[ ]case
  • [(lenient|strict) ]pascal[ ]case %texts%
  • %texts% in [(lower|upper|capital|screaming)[ ]]snake[ ]case
  • [(lower|upper|capital|screaming)[ ]]snake[ ]case %texts%
  • %texts% in [(lower|upper|capital)[ ]]kebab[ ]case
  • [(lower|upper|capital)[ ]]kebab[ ]case %texts%
Since: 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases)
Return Type: Text
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?

Character Codepoint

🔗

Expression

Patterns:
  • [the] [unicode|character] code([ ]point| position) of %texts%
  • %texts%'[s] [unicode|character] code([ ]point| position)
Since: 2.9.0
Return Type: integer
Returns the Unicode codepoint of a character

Examples:

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

Character from Codepoint

🔗

Expression

Patterns:
  • character (from|at|with) code([ ]point| position) %integer%
Since: 2.9.0
Return Type: Text
Returns the character at the specified codepoint

Examples:

function chars_between(lower: string, upper: string) :: strings:
    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::*}

Characters Between

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] [alphanumeric] characters (between|from) %text% (and|to) %text%
Since: 2.8.0
Return Type: Text
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"

Chat Format

🔗

Expression

Patterns:
  • [the] (message|chat) format[ting]
Since: 2.2-dev31
Return Type: Text
Can be used to get/retrieve the chat format. The sender of a message is represented by [player] or [sender], and the message by [message] or [msg].

Examples:

set the chat format to "&lt;yellow&gt;[player]&lt;light gray&gt;: &lt;green&gt;[message]"

Chat Recipients

🔗

Expression

Patterns:
  • [chat][( |-)]recipients
Since: 2.2-Fixes-v7, 2.2-dev35 (clearing recipients)
Return Type: Player
Recipients of chat events where this is called.

Examples:

chat recipients

Chunk

🔗

Expression

Patterns:
Since: 2.0, 2.8.0 (loaded chunks)
Return Type: Chunk
Returns the chunk of a block, location or entity is in, or a list of the loaded chunks of a world.

Examples:

add the chunk at the player to {protected chunks::*}
set {_chunks::*} to the loaded chunks of the player's world

Clicked Block/Entity/Inventory/Slot

🔗

Expression

Patterns:
  • [the] (clicked [enchant[ment]] (button|option)|clicked (block|%*item type/entity type%)|clicked slot|clicked inventory|click (type|action)|inventory action)
Since: 1.0, 2.2-dev35 (more clickable things)
Usable in events: click, inventory click
Return Type: Object
The clicked block, entity, inventory, inventory slot, inventory click type or inventory action.

Examples:

message "You clicked on a %type of clicked entity%!"
if the clicked block is a chest:
    show the inventory of the clicked block to the player

Color of

🔗

Expression

Patterns:
Since: 1.2
Return Type: Color
The color of an item, can also be used to color chat messages with "<%color of ...%>this text is colored!".

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

Colored / Uncolored

🔗

Expression

Patterns:
  • (colo[u]r-|colo[u]red )%texts%
  • (format-|formatted )%texts%
  • (un|non)[-](colo[u]r-|colo[u]red |format-|formatted )%texts%
Since: 2.0
Return Type: Text
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 &lt;player&gt;:
    trigger:
        set display name of the player-argument to uncolored display name of the player-argument
command /format &lt;text&gt;:
    trigger:
        message formatted text-argument # Safe, because we're sending to whoever used this command

Command

🔗

Expression

Patterns:
  • [the] (full|complete|whole) command
  • [the] command [(label|alias)]
Since: 2.0, 2.7 (support for script commands)
Usable in events: command
Return Type: Text
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

Command Info

🔗

Expression

Patterns:
  • [the] main command [label|name] [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] main command [label|name]
  • [the] description [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] description
  • [the] label [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] label
  • [the] usage [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] usage
  • [(all|the|all [of] the)] aliases [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] aliases
  • [the] permission [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] permission
  • [the] permission message [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] permission message
  • [the] plugin [owner] [of [[the] command[s] %texts%]]
  • command[s] %texts%'[s] plugin [owner]
Since: 2.6
Return Type: Text
Get information about a command.

Examples:

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%!"

Command Sender

🔗

Expression

Patterns:
  • [the] [command['s]] (sender|executor)
Since: 2.0
Usable in events: command
Return Type: Command Sender
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"

Compass Target

🔗

Expression

Patterns:
Since: 2.0
Return Type: Location
The location a player's compass is pointing at.

Examples:

# 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%}

Console

🔗

Expression

Patterns:
  • [the] (console|server)
Since: 1.3.1
Return Type: Command Sender
Represents the server's console which can receive messages and execute commands

Examples:

execute console command "/stop"
send "message to console" to the console

Cooldown Time/Remaining Time/Elapsed Time/Last Usage/Bypass Permission

🔗

Expression

Patterns:
  • [the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])
  • [the] last usage [date] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
Since: 2.2-dev33
Return Type: Object
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%}

Coordinate

🔗

Expression

Patterns:
  • [the] (x|y|z)(-| )(coord[inate]|pos[ition]|loc[ation])[s] of %locations%
  • %locations%'[s] (x|y|z)(-| )(coord[inate]|pos[ition]|loc[ation])[s]
Since: 1.4.3
Return Type: Number
Represents a given coordinate of a location.

Examples:

player's y-coordinate is smaller than 40:
    message "Watch out for lava!"

Creature/Entity/Player/Projectile/Villager/Powered Creeper/etc.

🔗

Expression

Patterns:
  • [the] [event-]<.+>
Since: 1.0
Return Type: Entity
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

Cursor Slot

🔗

Expression

Patterns:
Since: 2.2-dev17
Return Type: Slot
The item which the player has on their inventory cursor. This slot is always empty if player has no inventory open.

Examples:

cursor slot of player is dirt
set cursor slot of player to 64 diamonds

Custom Chest Inventory

🔗

Expression

Patterns:
  • [a] [new] chest inventory (named|with name) %text% [with %number% row[s]]
  • [a] [new] chest inventory with %number% row[s] [(named|with name) %text%]
Since: 2.2-dev34, 2.8.0 (chat format)
Requirements: Paper 1.16+ (chat format)
Return Type: Inventory
Returns a chest inventory with the given amount of rows and the name. Use the open inventory effect to open it.

Examples:

open chest inventory with 1 row named "test" to player

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

Custom Model Data

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.14+
Return Type: long
Get/set the CustomModelData tag for an item. (Value is an integer between 0 and 99999999)

Examples:

set custom model data of player's tool to 3
set {_model} to custom model data of player's tool

Damage

🔗

Expression

Patterns:
  • [the] damage
Since: 1.3.5, 2.8.0 (item damage event)
Usable in events: Damage, Vehicle Damage, Item Damage
Return Type: Number
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

Damage Cause

🔗

Expression

Patterns:
  • [the] damage (cause|type)
Since: 2.0
Return Type: Damage Cause
The damage cause of a damage event. Please click on the link for more information.

Examples:

damage cause is lava, fire or burning

Damage Value/Durability

🔗

Expression

Patterns:
Since: 1.2, 2.7 (durability reversed)
Return Type: integer
The damage value/durability of an item.

Examples:

set damage value of player's tool to 10
reset the durability of {_item}
set durability of player's held item to 0

Damaged Item

🔗

Expression

Patterns:
Since: 2.4
Return Type: Item Type
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

Date Ago/Later

🔗

Expression

Patterns:
Since: 2.2-dev33
Return Type: Date
A date the specified timespan before/after another date.

Examples:

set {_yesterday} to 1 day ago
set {_hourAfter} to 1 hour after {someOtherDate}
set {_hoursBefore} to 5 hours before {someOtherDate}

Default Value

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: Object
A shorthand expression for giving things a default value. If the first thing isn't set, the second thing will be returned.

Examples:

broadcast {score::%player's uuid%} otherwise "%player% has no score!"

Difference

🔗

Expression

Patterns:
Since: 1.4
Return Type: Object
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!"

Difficulty

🔗

Expression

Patterns:
  • [the] difficult(y|ies) of %worlds%
  • %worlds%'[s] difficult(y|ies)
Since: 2.3
Return Type: Difficulty
The difficulty of a world.

Examples:

set the difficulty of "world" to hard

Direction

🔗

Expression

Patterns:
  • [%number% [(block|met(er|re))[s]] [to the]] (north[[(-| )](east|west)][(ward[(s|ly)]|er[(n|ly)])] [of]|south[[(-| )](east|west)][(ward[(s|ly)]|er[(n|ly)])] [of]|(east|west)[(ward[(s|ly)]|er[(n|ly)])] [of]|above|over|(up|down)[ward[(s|ly)]]|below|under[neath]|beneath) [%direction%]
  • [%number% [(block|met(er|re))[s]]] in [the] (direction|horizontal direction|facing|horizontal facing) of %entity/block% [(of|from)]
  • [%number% [(block|met(er|re))[s]]] in %entity/block%'[s] (direction|horizontal direction|facing|horizontal facing) [(of|from)]
  • [%number% [(block|met(er|re))[s]]] (in[ ]front [of]|forward[s]|behind|backwards|[to the] (right|left) [of])
  • [%number% [(block|met(er|re))[s]]] horizontal[ly] (in[ ]front [of]|forward[s]|behind|backwards|to the (right|left) [of])
Since: 1.0 (basic), 2.0 (extended)
Return Type: Direction
A helper expression for the direction type.

Examples:

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

Distance

🔗

Expression

Patterns:
Since: 1.0
Return Type: Number
The distance between two points.

Examples:

if the distance between the player and {home::%uuid of player%} is smaller than 20:
    message "You're very close to your home!"

Drops

🔗

Expression

Patterns:
  • [the] drops
Since: 1.0
Usable in events: death
Return Type: Item Type
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.

Examples:

clear drops
remove 4 planks from the drops

Drops Of Block

🔗

Expression

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15+ ('as %entity%')
Return Type: Item Type
A list of the items that will drop when a block is broken.

Examples:

on break of block:
    give drops of block using player's tool to player

Elements

🔗

Expression

Patterns:
  • [the] (first|last) element [out] of %objects%
  • [the] (first|last) %integer% elements [out] of %objects%
  • [a] random element [out] of %objects%
  • [the] %integer%(st|nd|rd|th) [[to] last] element [out] of %objects%
  • [the] elements (from|between) %integer% (to|and) %integer% [out] of %objects%
Since: 2.0, 2.7 (relative to last element), 2.8.0 (range of elements)
Return Type: Object
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::*}

Enchant Item

🔗

Expression

Patterns:
  • [the] enchant[ed] item
Since: 2.5
Usable in events: enchant prepare, enchant
Return Type: Item Type
The enchant item in an enchant prepare event or enchant event. It can be modified, but enchantments will still be applied in the enchant event.

Examples:

on enchant:
    set the enchanted item to a diamond chestplate
on enchant prepare:
    set the enchant item to a wooden sword

Enchanting Experience Cost

🔗

Expression

Patterns:
  • [the] [displayed] ([e]xp[erience]|enchanting) cost
Since: 2.5
Usable in events: enchant
Return Type: long
The cost of enchanting in an enchant event. This is number that was displayed in the enchantment table, not the actual number of levels removed.

Examples:

on enchant:
    send "Cost: %the displayed enchanting cost%" to player

Enchantment Bonus

🔗

Expression

Patterns:
  • [the] enchantment bonus
Since: 2.5
Usable in events: enchant prepare
Return Type: long
The enchantment bonus in an enchant prepare event. This represents the number of bookshelves affecting/surrounding the enchantment table.

Examples:

on enchant:
    send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player

Enchantment Level

🔗

Expression

Patterns:
Since: 2.0
Return Type: long
The level of a particular enchantment on an item.

Examples:

player's tool is a sword of sharpness:
    message "You have a sword of sharpness %level of sharpness of the player's tool% equipped"

Enchantment Offer

🔗

Expression

Patterns:
  • [all [of]] [the] enchant[ment] offers
  • enchant[ment] offer[s] %numbers%
  • [the] %number%(st|nd|rd|th) enchant[ment] offer
Since: 2.5
Usable in events: enchant prepare
Requirements: 1.11 or newer
Return Type: Enchantment Offer
The enchantment offer in enchant prepare events.

Examples:

on enchant prepare:
    send "Your enchantment offers are: %the enchantment offers%" to player

Enchantment Offer Cost

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.11 or newer
Return Type: long
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.

Examples:

set cost of enchantment offer 1 to 50

Ender Chest

🔗

Expression

Patterns:
Since: 2.0
Return Type: Inventory
The ender chest of a player.

Examples:

open the player's ender chest to the player

Entities

🔗

Expression

Patterns:
Since: 1.2.1, 2.5 (chunks)
Return Type: Entity
All entities in all worlds, in a specific world, in a chunk or in a radius around a certain location, 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

Entity AI

🔗

Expression

Patterns:
Since: 2.5
Return Type: Boolean
Returns whether an entity has AI.

Examples:

set artificial intelligence of target entity to false

Entity Attribute

🔗

Expression

Patterns:
Since: 2.5, 2.6.1 (final attribute value)
Return Type: Number
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

Entity Fire Burn Duration

🔗

Expression

Patterns:
  • [the] (burn[ing]|fire) (time|duration) of %entities%
  • %entities%'[s] (burn[ing]|fire) (time|duration)
Since: 2.7
Return Type: Timespan
How much time an entity will be burning for.

Examples:

send "You will stop burning in %fire time of player%"

Entity Owner

🔗

Expression

Patterns:
Since: 2.5
Return Type: Offline Player
The owner of a tameable entity, such as a horse or wolf.

Examples:

set owner of target entity to player
delete owner of target entity
set {_t} to uuid of tamer of target entity

Exhaustion

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type: Number
The exhaustion of a player. This is mainly used to determine the rate of hunger depletion.

Examples:

set exhaustion of all players to 1

Experience

🔗

Expression

Patterns:
  • [the] [(spawned|dropped)] [e]xp[erience] [orb[s]]
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
How much experience was spawned in an experience spawn or block break event. Can be changed.

Examples:

on experience spawn:
    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

Exploded Blocks

🔗

Expression

Patterns:
  • [the] exploded blocks
Since: 2.5, 2.8.6 (modify blocks)
Usable in events: explode
Return Type: Block
Get all the blocks that were destroyed in an explode event. Supports add/remove/set/clear/delete blocks.

Examples:

on explode:
    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

Explosion Block Yield

🔗

Expression

Patterns:
  • [the] [explosion['s]] block (yield|amount)
  • [the] percentage of blocks dropped
Since: 2.5
Usable in events: explosion
Return Type: Number
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%

Explosion Yield

🔗

Expression

Patterns:
  • [the] explosion (yield|radius|size)
  • [the] (yield|radius|size) of [the] explosion
Since: 2.5
Usable in events: explosion prime
Return Type: Number
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

Explosive Yield

🔗

Expression

Patterns:
  • [the] explosive (yield|radius|size) of %entities%
  • %entities%'[s] explosive (yield|radius|size)
Since: 2.5
Requirements: Minecraft 1.12 or newer for creepers
Return Type: Number
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

Facing

🔗

Expression

Patterns:
Since: 1.4
Return Type: Direction
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

Fall Distance

🔗

Expression

Patterns:
  • [the] fall[en] (distance|height) of %entities%
  • %entities%'[s] fall[en] (distance|height)
Since: 2.5
Return Type: Number
The distance an entity has fallen for.

Examples:

set all entities' fall distance to 10
on damage:
    send "%victim's fall distance%" to victim

Fertilized Blocks

🔗

Expression

Patterns:
  • [all] [the] fertilized blocks
Since: 2.5
Usable in events: block fertilize
Requirements: Minecraft 1.13 or newer
Return Type: Block
The blocks fertilized in block fertilize events.

Examples:

the fertilized blocks

Filter

🔗

Expression

Patterns:
  • %objects% (where|that match) \[<.+>\]
Since: 2.2-dev36
Return Type: Object
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"]

Final Damage

🔗

Expression

Patterns:
  • [the] final damage
Since: 2.2-dev19
Usable in events: damage
Return Type: Number
How much damage is done in a damage event, considering all types of damage reduction. Can NOT be changed.

Examples:

send "%final damage%" to victim

Firework Effect

🔗

Expression

Patterns:
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors%
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors% fad(e|ing) [to] %colors%
Since: 2.4
Return Type: Firework Effect
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

Flight Mode

🔗

Expression

Patterns:
  • [the] fl(y[ing]|ight) (mode|state) of %players%
  • %players%'[s] fl(y[ing]|ight) (mode|state)
Since: 2.2-dev34
Return Type: Boolean
Whether the player(s) are allowed to fly. Use Make Fly effect to force player(s) to fly.

Examples:

set flight mode of player to true
send "%flying state of all players%"

Food Level

🔗

Expression

Patterns:
  • [the] (food|hunger)[[ ](level|met(er|re)|bar)] [of %players%]
  • %players%'[s] (food|hunger)[[ ](level|met(er|re)|bar)]
Since: 1.0
Return Type: Number
The food level of a player from 0 to 10. Has several aliases: food/hunger level/meter/bar.

Examples:

set the player's food level to 10

Formatted Date

🔗

Expression

Patterns:
  • %dates% formatted [human-readable] [(with|as) %text%]
  • [human-readable] formatted %dates% [(with|as) %text%]
Since: 2.2-dev31, 2.7 (support variables in format)
Return Type: Text
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

Former/Future State

🔗

Expression

Patterns:
  • [the] (former|past|old) [state] [of] %~objects%
  • %~objects% before [the event]
  • [the] (future|to-be|new) [state] [of] %~objects%
  • %~objects%(-to-be| after[(wards| the event)])
Since: 1.1
Return Type: Object
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

Free / Max / Total Memory

🔗

Expression

Patterns:
  • [the] [server] (free|max[imum]|total) (memory|ram)
Since: 2.8.0
Return Type: double
The free, max or total memory of the server in Megabytes.

Examples:

while player is online:
    send action bar "Memory left: %free memory%/%max memory%MB" to player
    wait 5 ticks

Freeze Time

🔗

Expression

Patterns:
Since: 2.7
Return Type: Timespan
How much time an entity has been in powdered snow for.

Examples:

player's freeze time is less than 3 seconds:
    send "you're about to freeze!" to the player

Furnace Slot

🔗

Expression

Patterns:
  • [the] (ore slot|fuel slot|result [slot])
  • [the] (ore|fuel|result) slot[s] of %blocks%
  • %blocks%'[s] (ore|fuel|result) slot[s]
Since: 1.0, 2.8.0 (syntax rework)
Usable in events: smelt, fuel burn
Return Type: Slot
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

Game Mode

🔗

Expression

Patterns:
Since: 1.0
Return Type: Game Mode
The gamemode of a player. (Gamemodes)

Examples:

player's gamemode is survival
set the player's gamemode to creative

Gamerule Value

🔗

Expression

Patterns:
Since: 2.5
Requirements: Minecraft 1.13+
Return Type: Gamerule Value
The gamerule value of a world.

Examples:

set the gamerule commandBlockOutput of world "world" to false

Gliding State

🔗

Expression

Patterns:
Since: 2.2-dev21
Return Type: Boolean
Sets of gets gliding state of player. It allows you to set gliding state of entity even if they do not have an Elytra equipped.

Examples:

set gliding of player to off

Glowing

🔗

Expression

Patterns:
Since: 2.2-dev18
Return Type: Boolean
Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.

Examples:

set glowing of player to true

Gravity

🔗

Expression

Patterns:
Since: 2.2-dev21
Return Type: Boolean
If entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag.

Examples:

set gravity of player off

Group

🔗

Expression

Patterns:
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: Text
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

Hanging Entity/Remover

🔗

Expression

Patterns:
  • [the] hanging (entity|remover)
Since: 2.6.2
Return Type: Entity
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

Hash

🔗

Expression

Patterns:
  • %texts% hash[ed] with (MD5|SHA-256)
Since: 2.0, 2.2-dev32 (SHA-256 algorithm)
Return Type: Text
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 &lt;text&gt;:
    trigger:
        set {password::%uuid of player%} to text-argument hashed with SHA-256
command /login &lt;text&gt;:
    trigger:
        if text-argument hashed with SHA-256 is {password::%uuid of player%}:
            message "Login successful."
        else:
            message "Wrong password!"

Hatching Entity Type

🔗

Expression

Patterns:
  • [the] hatching entity [type]
Since: 2.7
Usable in events: Egg Throw
Return Type: Entity Type
The type of the entity that will be hatched in a Player Egg Throw event.

Examples:

on player egg throw:
    set the hatching entity type to a primed tnt

Hatching Number

🔗

Expression

Patterns:
  • [the] hatching number
Since: 2.7
Usable in events: Egg Throw
Return Type: byte
The number of entities that will be hatched in a Player Egg Throw event. Please note that no more than 127 entities can be hatched at once.

Examples:

on player egg throw:
    set the hatching number to 10

Head location

🔗

Expression

Patterns:
Since: 2.0
Return Type: Location
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:

Heal Amount

🔗

Expression

Patterns:
  • [the] heal[ing] amount
Since: 2.5.1
Usable in events: heal
Return Type: double
The amount of health healed in a heal event.

Examples:

on player healing:
    increase the heal amount by 2
    remove 0.5 from the healing amount

Heal Reason

🔗

Expression

Patterns:
  • [the] (regen|health regain|heal[ing]) (reason|cause)
Since: 2.5
Usable in events: heal
Return Type: Heal Reason

Examples:

on heal:
    heal reason is satiated
    send "You ate enough food and gained full health back!"

Health

🔗

Expression

Patterns:
Since: 1.0
Usable in events: damage
Return Type: Number
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).

Examples:

message "You have %health% HP left."

Hidden Players

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] hidden players (of|for) %players%
  • [(all [[of] the]|the)] players hidden (from|for|by) %players%
Since: 2.3
Return Type: Player
The players hidden from a player that were hidden using the player visibility effect.

Examples:

message "&lt;light red&gt;You are currently hiding: &lt;light gray&gt;%hidden players of the player%"

Hostname

🔗

Expression

Patterns:
  • [the] (host|domain)[ ][name]
Since: 2.6.1
Return Type: Text
The hostname used by the connecting player to connect to the server in a connect event.

Examples:

on connect:
    hostname is "testers.example.com"
    send "Welcome back tester!"

Hotbar Button

🔗

Expression

Patterns:
  • [the] hotbar button
Since: 2.5
Return Type: long
The hotbar button clicked in an inventory click event.

Examples:

on inventory click:
    send "You clicked the hotbar button %hotbar button%!"

Hotbar Slot

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] hotbar slot[s] [of %players%]
  • %players%'[s] [([currently] selected|current)] hotbar slot[s]
Since: 2.2-dev36
Return Type: Slot
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

Hover List

🔗

Expression

Patterns:
  • [the] [custom] [player|server] (hover|sample) ([message] list|message)
  • [the] [custom] player [hover|sample] list
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: Text
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

Humidity

🔗

Expression

Patterns:
  • [the] humidit(y|ies) of %blocks%
  • %blocks%'[s] humidit(y|ies)
Since: 2.2-dev35
Return Type: Number
Humidity of given blocks.

Examples:

set {_humidity} to event-block's humidity

IP

🔗

Expression

Patterns:
  • IP[s][( |-)address[es]] of %players%
  • %players%'[s] IP[s][( |-)address[es]]
  • IP[( |-)address]
Since: 1.4, 2.2-dev26 (when used in connect event), 2.3 (when used in server list ping event)
Return Type: Text
The IP address of a player, or the connected player in a connect event, or the pinger in a server list ping event.

Examples:

ban the IP address of the player
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

Index Of

🔗

Expression

Patterns:
  • [the] [(first|last)] index of %text% in %text%
Since: 2.1
Return Type: long
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}

Indices of List

🔗

Expression

Patterns:
  • [(the|all [[of] the])] (indexes|indices) of %~objects%
  • %~objects%'[s] (indexes|indices)
  • [sorted] (indices|indexes) of %~objects% in (ascending|descending) order
  • [sorted] %~objects%'[s] (indices|indexes) in (ascending|descending) order
Since: 2.4 (indices), 2.6.1 (sorting)
Return Type: Text
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

Initiator Inventory

🔗

Expression

Patterns:
  • [the] [event-]initiator[( |-)inventory]
Since: 2.8.0
Usable in events: Inventory Item Move
Return Type: Inventory
Returns the initiator inventory in an on inventory item move event.

Examples:

on inventory item move:
    holder of event-initiator-inventory is a chest
    broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"

Input

🔗

Expression

Patterns:
  • input
  • %*type% input
  • input index
Since: 2.2-dev36, 2.9.0 (input index)
Return Type: Object
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

Inventory

🔗

Expression

Patterns:
  • [the] inventor(y|ies) of %inventoryholders/item types%
  • %inventoryholders/item types%'[s] inventor(y|ies)
Since: 1.0
Return Type: Object
The inventory of a block or player. You can usually omit this expression and can directly add or remove items to/from blocks or players.

Examples:

add a plank to the player's inventory
clear the player's inventory
remove 5 wool from the inventory of the clicked block

Inventory Action

🔗

Expression

Patterns:
  • [the] inventory action
Since: 2.2-dev16
Return Type: Inventory Action
The inventory action of an inventory event. Please click on the link for more information.

Examples:

inventory action is pickup all

Inventory Close Reason

🔗

Expression

Patterns:
  • [the] inventory clos(e|ing) (reason|cause)
Since: 2.8.0
Usable in events: Inventory Close
Requirements: Paper
Return Type: Inventory Close Reasons

Examples:

on inventory close:
    inventory close reason is teleport
    send "Your inventory closed due to teleporting!" to player

Inventory Holder/Viewers/Rows/Slots

🔗

Expression

Patterns:
  • (holder[s]|viewers|[amount of] rows|[amount of] slots) of %inventories%
  • %inventories%'[s] (holder[s]|viewers|[amount of] rows|[amount of] slots)
Since: 2.2-dev34, 2.5 (slots)
Return Type: Object
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

Inventory Slot

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: Slot
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

Item

🔗

Expression

Patterns:
  • [the] item
Since: unknown (before 2.1)
Return Type: Item
The item involved in an event, e.g. in a drop, dispense, pickup or craft event.

Examples:

on dispense:
    item is a clock
    set the time to 6:00

Item Amount

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: long
The amount of an item stack.

Examples:

send "You have got %item amount of player's tool% %player's tool% in your hand!" to player

Item Cooldown

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Timespan
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

Item Enchantments

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: Enchantment Type
All the enchantments an item type has.

Examples:

clear enchantments of event-item

Item of an Entity

🔗

Expression

Patterns:
Since: 2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles)
Requirements: Minecraft 1.15.2+ (throwable projectiles)
Return Type: Slot
An item associated with an entity. For dropped item entities, it gets, obviously, the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.),it gets the displayed item. Other entities do not have items associated with them.

Examples:

Missing examples.

Item with CustomModelData

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.14+
Return Type: Item Type
Get an item with a CustomModelData tag. (Value is an integer between 0 and 99999999)

Examples:

give player a diamond sword with custom model data 2
set slot 1 of inventory of player to wooden hoe with custom model data 357

Item with Lore

🔗

Expression

Patterns:
Since: 2.3
Return Type: Item Type
Returns the given item type with the specified lore added to it. If multiple strings are passed, each of them will be a separate line in the lore.

Examples:

set {_test} to stone with lore "line 1" and "line 2"
give {_test} to player

Items

🔗

Expression

Patterns:
  • [all [[of] the]|the] block[[ ]type]s
  • every block[[ ]type]
  • [all [[of] the]|the|every] block[s] of type[s] %item types%
  • [all [[of] the]|the|every] item[s] of type[s] %item types%
Since: 1.0 pre-5
Return Type: Item Type
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

Items In

🔗

Expression

Patterns:
  • [all [[of] the]] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
  • all [[of] the] %item types% ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
Since: 2.0, 2.8.0 (specific types of items)
Return Type: Slot
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

Join & Split

🔗

Expression

Patterns:
  • (concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]
  • split %text% (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • %text% split (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • regex split %text% (at|using|by) [[the] delimiter] %text%
  • regex %text% split (at|using|by) [[the] delimiter] %text%
Since: 2.1, 2.5.2 (regex support), 2.7 (case sensitivity)
Return Type: Text
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 ","

Language

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%
  • %players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]
Since: 2.3
Return Type: Text
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.

Examples:

message player's current language

Last Attacker

🔗

Expression

Patterns:
  • [the] last attacker of %entity%
  • %entity%'[s] last attacker
Since: 2.5.1
Return Type: Object
The last block or entity that attacked an entity.

Examples:

send "%last attacker of event-entity%"

Last Color

🔗

Expression

Patterns:
  • [the] last color[s] of %texts%
  • %texts%'[s] last color[s]
Since: 2.6
Return Type: Text
The colors used at the end of a string. The colors of the returned string will be formatted with their symbols.

Examples:

set {_color} to the last colors of "<red>hey<blue>yo"

Last Damage

🔗

Expression

Patterns:
Since: 2.5.1
Return Type: Number
The last damage that was done to an entity. Note that changing it doesn't deal more/less damage.

Examples:

set last damage of event-entity to 2

Last Damage Cause

🔗

Expression

Patterns:
Since: 2.2-Fixes-V10
Return Type: Damage Cause
Cause of last damage done to an entity

Examples:

set last damage cause of event-entity to fire tick

Last Loaded Server Icon

🔗

Expression

Patterns:
  • [the] [last[ly]] loaded server icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: Server Icon
Returns the last loaded server icon with the load server icon effect.

Examples:

set {server-icon} to the last loaded server icon

Last Resource Pack Response

🔗

Expression

Patterns:
  • [the] [last] resource pack response[s] of %players%
  • %players%'[s] [last] resource pack response[s]
Since: 2.4
Requirements: Paper 1.9 or newer
Return Type: Resource Pack State
Returns the last resource pack response received from a player.

Examples:

if player's last resource pack response is deny or download fail:

Last Spawned Entity

🔗

Expression

Patterns:
  • [the] [last[ly]] (spawned|shot) %*entity type%
  • [the] [last[ly]] dropped (item)
  • [the] [last[ly]] (created|struck) (lightning)
  • [the] [last[ly]] (launched|deployed) (firework)
Since: 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), 2.7 (struck lightning, firework)
Return Type: Entity
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

Last/First Login Time

🔗

Expression

Patterns:
Since: 2.5
Return Type: Date
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."

Leash Holder

🔗

Expression

Patterns:
Since: 2.3
Return Type: Entity
The leash holder of a living entity.

Examples:

set {_example} to the leash holder of the target mob

Length

🔗

Expression

Patterns:
Since: 2.1
Return Type: long
The length of a text, in number of characters.

Examples:

set {_l} to length of the string argument

Level

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Usable in events: level change
Return Type: long
The level of a player.

Examples:

reduce the victim's level by 1
set the player's level to 0

Level Progress

🔗

Expression

Patterns:
Since: 2.0
Usable in events: level change
Return Type: Number
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

Light Level

🔗

Expression

Patterns:
Since: 1.3.4
Return Type: byte
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

Loaded Plugins

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] [loaded] plugins
Since: 2.7
Return Type: Text
An expression to obtain a list of the names of the server's loaded plugins.

Examples:

if the loaded plugins contains "Vault":
    broadcast "This server uses Vault plugin!"

send "Plugins (%size of loaded plugins%): %plugins%" to player

Location

🔗

Expression

Patterns:
  • [the] [event-](location|position)
Since: 2.0
Return Type: Location
The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).

Examples:

drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'
set {_loc} to the location 1 meter above the player

Location

🔗

Expression

Patterns:
Since: 2.0
Return Type: Location
The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).

Examples:

drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'
set {_loc} to the location 1 meter above the player

Location

🔗

Expression

Patterns:
Since: Unknown
Return Type: Location
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%."

Location At

🔗

Expression

Patterns:
  • [the] (location|position) [at] [\(][x[ ][=[ ]]]%number%, [y[ ][=[ ]]]%number%, [and] [z[ ][=[ ]]]%number%[\)] [[(in|of) [[the] world]] %world%]
Since: 2.0
Return Type: Location
Allows to create a location from three coordinates and a world.

Examples:

set {_loc} to the location at arg-1, arg-2, arg-3 of the world arg-4
distance between the player and the location (0, 0, 0) is less than 200

Loop Iteration

🔗

Expression

Patterns:
  • [the] loop(-| )(counter|iteration)[-%*number%]
Since: 2.8.0
Return Type: long
Returns the loop's current iteration count (for both normal and while loops).

Examples:

while player is online:
    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%"

Loop value

🔗

Expression

Patterns:
  • [the] loop-<.+>
Since: 1.0, 2.8.0 (loop-counter)
Return Type: Object
Returns the currently looped value.

Examples:

# 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%"

Loot

🔗

Expression

Patterns:
  • [the] loot
Since: 2.7
Requirements: MC 1.16+
Return Type: Item
The loot that will be generated in a 'loot generate' event.

Examples:

on loot generate:
    chance of %10
    add 64 diamonds
    send "You hit the jackpot!!"

Lore

🔗

Expression

Patterns:
Since: 2.1
Return Type: Text
An item's lore.

Examples:

set the 1st line of the item's lore to "&lt;orange&gt;Excalibur 2.0"

Lowest/Highest Solid Block

🔗

Expression

Patterns:
  • [the] (highest|lowest) [solid] block (at|of) %locations%
  • %locations%'[s] (highest|lowest) [solid] block
Since: 2.2-dev34, 2.9.0 (lowest solid block, 'non-air' option removed, additional syntax option)
Return Type: Block
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

MOTD

🔗

Expression

Patterns:
  • [the] [(default)|(shown|displayed)] (MOTD|message of [the] day)
Since: 2.3
Return Type: Text
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.

Examples:

on server list ping:
    set the motd to "Join now!"

Max Durability

🔗

Expression

Patterns:
Since: 2.5, 2.9.0 (change)
Requirements: Minecraft 1.20.5+ (custom amount)
Return Type: integer
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

Max Health

🔗

Expression

Patterns:
Since: 2.0
Usable in events: damage, death
Return Type: Number
The maximum health of an entity, e.g. 10 for a player.

Examples:

on join:
    set the maximum health of the player to 100
spawn a giant
set the last spawned entity's max health to 1000

Max Item Use Time

🔗

Expression

Patterns:
  • [the] max[imum] [item] us(e|age) (time|duration) of %item stacks%
  • %item stacks%'[s] max[imum] [item] us(e|age) (time|duration)
Since: 2.8.0
Requirements: Paper
Return Type: Timespan
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

Max Minecart Speed

🔗

Expression

Patterns:
  • [the] max[imum] minecart (speed|velocity) of %entities%
  • %entities%'[s] max[imum] minecart (speed|velocity)
Since: 2.5.1
Return Type: Number
The maximum speed of a minecart.

Examples:

on right click on minecart:
    set max minecart speed of event-entity to 1

Max Players

🔗

Expression

Patterns:
  • [the] [(real|default)|(fake|shown|displayed)] max[imum] player[s] [count|amount|number|size]
  • [the] [(real|default)|(fake|shown|displayed)] max[imum] (count|amount|number|size) of players
Since: 2.3, 2.7 (modify max real players)
Requirements: Paper 1.16+ (modify max real players)
Return Type: integer
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)

Maximum Freeze Time

🔗

Expression

Patterns:
  • [the] max[imum] freeze time of %entities%
  • %entities%'[s] max[imum] freeze time
Since: 2.7
Return Type: Timespan
The maximum amount of time an entity can spend in powdered snow before taking damage.

Examples:

difference between player's freeze time and player's max freeze time is less than 1 second:
    send "you're about to freeze!" to the player

Maximum Stack Size

🔗

Expression

Patterns:
Since: 2.1
Return Type: long
The maximum stack size of the specified material, e.g. 64 for torches, 16 for buckets, and 1 for swords.

Examples:

send "You can only pick up %max stack size of player's tool% of %type of (player's tool)%" to player

Me

🔗

Expression

Patterns:
  • me
  • my[self]
Since: 2.1.1
Return Type: Player
A 'me' expression that can be used in players' effect commands only.

Examples:

!heal me
!kick myself
!give a diamond axe to me

Mending Repair Amount

🔗

Expression

Patterns:
  • [the] [mending] repair amount
Since: 2.5.1
Return Type: long
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

Message

🔗

Expression

Patterns:
  • [the] [chat( |-)]message
  • [the] (join|log[ ]in)( |-)message
  • [the] (quit|leave|log[ ]out|kick)( |-)message
  • [the] death( |-)message
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
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, or the death message on a death 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!"

Metadata

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: Object
Metadata is a way to store temporary data on entities, blocks and more that disappears after a server restart.

Examples:

set metadata value "healer" of player to true
broadcast "%metadata value ""healer"" of player%"
clear metadata value "healer" of player

Middle of Location

🔗

Expression

Patterns:
  • [the] (middle|center) [point] of %location%
  • %location%'[s] (middle|center) [point]
Since: 2.6.1
Return Type: Location
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."

Minecart Derailed / Flying Velocity

🔗

Expression

Patterns:
  • [the] [minecart] (derailed|flying) velocity of %entities%
  • %entities%'[s] [minecart] (derailed|flying) velocity
Since: 2.5.1
Return Type: Vector
The velocity of a minecart as soon as it has been derailed or as soon as it starts flying.

Examples:

on right click on minecart:
    set derailed velocity of event-entity to vector 2, 10, 2

Money

🔗

Expression

Patterns:
Since: 2.0, 2.5 (offline players)
Requirements: Vault, an economy plugin that supports Vault
Return Type: Money
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

Moon Phase

🔗

Expression

Patterns:
  • [the] (lunar|moon) phase[s] of %worlds%
  • %worlds%'[s] (lunar|moon) phase[s]
Since: 2.7
Requirements: Paper 1.16+
Return Type: Moon Phase
The current moon phase of a world.

Examples:

if moon phase of player's world is full moon:
    send "Watch for the wolves!"

Moved blocks

🔗

Expression

Patterns:
  • [the] moved blocks
Since: 2.2-dev27
Return Type: Block
Blocks which are moved in a piston event. Cannot be used outside of piston events.

Examples:

the moved blocks

Name / Display Name / Tab List Name

🔗

Expression

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
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 "&lt;red&gt;[admin] &lt;gold&gt;%name of player%"
    set the player's tab list name to "&lt;green&gt;%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
  • [the] ((player|tab)[ ]list name[s]) of %players%
  • %players%'[s] ((player|tab)[ ]list name[s])
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name), 2.7 (worlds)
Return Type: Text
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 "&lt;red&gt;[admin] &lt;gold&gt;%name of player%"
    set the player's tab list name to "&lt;green&gt;%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Named Item/Inventory

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev34 (inventories)
Return Type: Object
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 "&lt;gold&gt;Excalibur" to the player
set tool of player to the player's tool named "&lt;gold&gt;Wand"
set the name of the player's tool to "&lt;gold&gt;Wand"
open hopper inventory named "Magic Hopper" to player

Nearest Entity

🔗

Expression

Patterns:
Since: 2.7
Return Type: Entity
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

on click:
    kill nearest pig

New Line

🔗

Expression

Patterns:
  • nl
  • new[ ]line
  • line[ ]break
Since: 2.5
Return Type: Text
Returns a line break separator.

Examples:

send "Hello%nl%Goodbye!" to player

No Damage Ticks

🔗

Expression

Patterns:
  • [the] (invulnerability|invincibility|no damage) tick[s] of %living entities%
  • %living entities%'[s] (invulnerability|invincibility|no damage) tick[s]
Since: 2.5
Return Type: long
The number of ticks that an entity is invulnerable to damage for.

Examples:

on damage:
    set victim's invulnerability ticks to 20 #Victim will not take damage for the next second

Now

🔗

Expression

Patterns:
  • now
Since: 1.4
Return Type: Date
The current system time of the server. Use time to get the Minecraft time of a world.

Examples:

broadcast "Current server time: %now%"

Number of Characters

🔗

Expression

Patterns:
  • number of upper[ ]case char(acters|s) in %text%
  • number of lower[ ]case char(acters|s) in %text%
  • number of digit char(acters|s) in %text%
Since: 2.5
Return Type: long
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 "&lt;red&gt;Your message has to many caps!" to player

Numbers

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%
Since: 1.4.6 (integers & numbers), 2.5.1 (decimals)
Return Type: Number
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

Offline players

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] offline[ ]players
Since: 2.2-dev35
Return Type: Offline Player
All players that have ever joined the server. This includes the players currently online.

Examples:

send "Size of all players who have joined the server: %size of all offline players%"

Online Player Count

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)
  • [the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online players
Since: 2.3
Requirements: Paper (fake count)
Return Type: long
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)

Opened Inventory

🔗

Expression

Patterns:
  • [the] (current|open|top) inventory [of %players%]
  • %players%'[s] (current|open|top) inventory
Since: 2.2-dev24, 2.2-dev35 (Just 'current inventory' works in player events)
Return Type: Inventory
Return the currently opened inventory of a player. If no inventory is open, it returns the own player's crafting inventory.

Examples:

set slot 1 of player's current inventory to diamond sword

Parse

🔗

Expression

Patterns:
Since: 2.0
Return Type: Object
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

Parse Error

🔗

Expression

Patterns:
  • [the] [last] [parse] error
Since: 2.0
Return Type: Text
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 "&lt;red&gt;Line 1 is invalid: %last parse error%"
    else:
        message "&lt;red&gt;Please put an integer on line 1!"

Passenger

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)
Return Type: Entity
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

Percent of

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Number
Returns a percentage of one or more numbers.

Examples:

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

Pi

🔗

Expression

Patterns:
  • (pi|π)
Since: 2.7
Return Type: double
Returns the mathematical constant pi. (approx. 3.1415926535)

Examples:

set {_tau} to pi * 2

Pickup Delay

🔗

Expression

Patterns:
Since: 2.7
Return Type: Timespan
The amount of time before a dropped item can be picked up by an entity.

Examples:

drop diamond sword at {_location} without velocity
set pickup delay of last dropped item to 5 seconds

Ping

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: long
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%"

Plain Item

🔗

Expression

Patterns:
Since: 2.6
Return Type: Item Type
A plain item is an item with no modifications. It can be used to convert items to their default state or to match with other default items.

Examples:

if the player's tool is a plain diamond: # check if player's tool has no modifications
    send "You are holding a plain diamond!"

Player List Header and Footer

🔗

Expression

Patterns:
  • [the] (player|tab)[ ]list (header|footer) [(text|message)] of %players%
  • %players%'[s] (player|tab)[ ]list (header|footer) [(text|message)]
Since: 2.4
Requirements: Minecraft 1.13 or newer
Return Type: Text
The message above and below the player list in the tab menu.

Examples:

set all players' tab list header to "Welcome to the Server!"
send "%the player's tab list header%" to player
reset all players' tab list header

Player Protocol Version

🔗

Expression

Patterns:
Since: 2.6.2
Requirements: Paper 1.12.2 or newer
Return Type: integer
Player's protocol version. For more information and list of protocol versions visit wiki.vg.

Examples:

command /protocolversion &ltplayer&gt:
    trigger:
        send "Protocol version of %arg-1%: %protocol version of arg-1%"

Player Skull

🔗

Expression

Patterns:
Since: 2.0
Return Type: Item Type
Gets a skull item representing a player. Skulls for other entities are provided by the aliases.

Examples:

give the victim's skull to the attacker
set the block at the entity to the entity's skull

Player Weather

🔗

Expression

Patterns:
  • [the] [(client|custom)] weather of %players%
  • %players%'[s] [(client|custom)] weather
Since: 2.2-dev34
Return Type: Weather Type
The weather for a player.

Examples:

set weather of arg-player to rainy
reset player's weather
if arg-player's weather is rainy

Portal

🔗

Expression

Patterns:
  • [the] portal['s] blocks
  • [the] blocks of [the] portal
Since: 2.4
Usable in events: portal_create
Return Type: Block
The blocks associated with a portal in the portal creation event.

Examples:

on portal creation:
    loop portal blocks:
        broadcast "%loop-block% is part of a portal!"

Portal Cooldown

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Timespan
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

Potion Effect

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: Potion Effect
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

Potion Effect Tier

🔗

Expression

Patterns:
Since: 2.7
Return Type: integer
An expression to obtain the amplifier of a potion effect applied to an entity.

Examples:

if the amplifier of haste of player >= 3:

Potion Effects

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: Potion Effect
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

Prefix/Suffix

🔗

Expression

Patterns:
  • [the] [chat] (prefix|suffix) of %players%
  • %players%'[s] [chat] (prefix|suffix)
Since: 2.0
Requirements: Vault, a chat plugin that supports Vault
Return Type: Text
The prefix or suffix as defined in the server's chat plugin.

Examples:

on chat:
    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 "[&lt;red&gt;Admin<reset>] "

Projectile Critical State

🔗

Expression

Patterns:
  • [the] (projectile|arrow) critical (state|ability|mode) of %projectiles%
  • %projectiles%'[s] (projectile|arrow) critical (state|ability|mode)
Since: 2.5.1
Return Type: Boolean
A projectile's critical state. The only currently accepted projectiles are arrows and tridents.

Examples:

on shoot:
    event-projectile is an arrow
    set projectile critical mode of event-projectile to true

Protocol Version

🔗

Expression

Patterns:
  • [the] [server] [(sent|required|fake)] protocol version [number]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: long
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 "&lt;light green&gt;Version: &lt;orange&gt;%minecraft version%"
    set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always

Quit Reason

🔗

Expression

Patterns:
  • [the] (quit|disconnect) (cause|reason)
Since: 2.8.0
Requirements: Paper 1.16.5+
Return Type: Quit Reason
The quit reason as to why a player disconnected in a quit event.

Examples:

on quit:
    quit reason was kicked
    player is banned
    clear {server::player::%uuid of player%::*}

Random

🔗

Expression

Patterns:
Since: 1.4.9
Return Type: Object
Gets a random item out of a set, e.g. a random player out of all players online.

Examples:

give a diamond to a random player out of all players
give a random item out of all items to the player

Random Character

🔗

Expression

Patterns:
  • [a|%integer%] random [alphanumeric] character[s] (from|between) %text% (to|and) %text%
Since: 2.8.0
Return Type: Text
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"

Random Number

🔗

Expression

Patterns:
  • [a] random (integer|number) (from|between) %number% (to|and) %number%
Since: 1.4
Return Type: Number
A random number or integer 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

Random UUID

🔗

Expression

Patterns:
  • [a] random uuid
Since: 2.5.1
Return Type: Text
Returns a random UUID.

Examples:

set {_uuid} to random uuid

Raw Name

🔗

Expression

Patterns:
Since: unknown (2.2)
Return Type: Text
The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.

Examples:

raw name of tool of player

Raw String

🔗

Expression

Patterns:
Since: 2.7
Return Type: Text
Returns the string without formatting (colors etc.) and without stripping them from it, e.g. raw "&aHello There!" would output &aHello There!

Examples:

send raw "&aThis text is unformatted!" to all players

Readied Arrow/Bow

🔗

Expression

Patterns:
  • [the] (readied|selected|drawn) (arrow|bow)
Since: 2.8.0
Usable in events: ready arrow
Return Type: Item
The bow or arrow in a Ready Arrow event.

Examples:

on player ready arrow:
    selected bow's name is "Spectral Bow"
    if selected arrow is not a spectral arrow:
        cancel event

Redstone Block Power

🔗

Expression

Patterns:
  • [the] redstone power of %blocks%
  • %blocks%'[s] redstone power
Since: 2.5
Return Type: long
Power of a redstone block

Examples:

if redstone power of targeted block is 15:
    send "This block is very powerful!"

Region

🔗

Expression

Patterns:
  • [the] [event-]region
Since: 2.1
Requirements: Supported regions plugin
Return Type: Region
The region involved in an event. This expression requires a supported regions plugin to be installed.

Examples:

on region enter:
    region is {forbidden region}
    cancel the event

Region Members & Owners

🔗

Expression

Patterns:
  • [(all|the)] (members|owner[s]) of [[the] region[s]] %regions%
  • [[the] region[s]] %regions%'[s] (members|owner[s])
Since: 2.1
Requirements: Supported regions plugin
Return Type: Offline Player
A list of members or owners of a region. This expression requires a supported regions plugin to be installed.

Examples:

on entering of a region:
    message "You're entering %region% whose owners are %owners of region%"

Regions At

🔗

Expression

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Return Type: Region
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: &lt;gold&gt;%{_regions::*}%<r>."

Remaining Air

🔗

Expression

Patterns:
Since: 2.0
Return Type: Timespan
How much time a player has left underwater before starting to drown.

Examples:

if the player's remaining air is less than 3 seconds:
    send "hurry, get to the surface!" to the player

Repeat String

🔗

Expression

Patterns:
  • %texts% repeated %integer% time[s]
Since: 2.8.0
Return Type: Text
Repeats inputted strings a given amount of times.

Examples:

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

Resonating Time

🔗

Expression

Patterns:
  • [the] resonat(e|ing) time of %block%
  • %block%'[s] resonat(e|ing) time
Since: 2.9.0
Requirements: Spigot 1.19.4+
Return Type: Timespan
Returns the resonating time of a bell. A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.

Examples:

broadcast "The bell has been resonating for %resonating time of target block%"

Respawn Anchor Charges

🔗

Expression

Patterns:
  • [the] [max[imum]] charge[s] of %blocks%
  • %blocks%'[s] [max[imum]] charge[s]
Since: 2.7
Requirements: Minecraft 1.16+
Return Type: integer
The charges of a respawn anchor.

Examples:

set the charges of event-block to 3

Respawn location

🔗

Expression

Patterns:
  • [the] respawn location
Since: 2.2-dev35
Return Type: Location
The location that a player should respawn at. This is used within the respawn event.

Examples:

on respawn:
    set respawn location to {example::spawn}

Reversed List

🔗

Expression

Patterns:
Since: 2.4
Return Type: Object
Reverses given list.

Examples:

set {_list::*} to reversed {_list::*}

Ringing Time

🔗

Expression

Patterns:
  • [the] ring[ing] time of %block%
  • %block%'[s] ring[ing] time
Since: 2.9.0
Requirements: Spigot 1.19.4+
Return Type: Timespan
Returns the ringing time of a bell. A bell typically rings for 50 game ticks.

Examples:

broadcast "The bell has been ringing for %ringing time of target block%"

Rounding

🔗

Expression

Patterns:
  • [(a|the)] round[ed] down %number%
  • [(a|the)] round[ed] %number%
  • [(a|the)] round[ed] up %number%
Since: 2.0
Return Type: long
Rounds numbers normally, up (ceiling) or down (floor) respectively.

Examples:

set {var} to rounded health of player
set line 1 of the block to rounded "%(1.5 * player's level)%"
add rounded down argument to the player's health

Saturation

🔗

Expression

Patterns:
Since: 2.2-Fixes-v10, 2.2-dev35 (fully modifiable), 2.6.2 (syntax pattern changed)
Return Type: Number
The saturation of a player. If used in a player event, it can be omitted and will default to event-player.

Examples:

set saturation of player to 20

Scoreboard Tags

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] scoreboard tags of %entities%
  • %entities%'[s] scoreboard tags
Since: 2.3
Return Type: Text
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

Script Name

🔗

Expression

Patterns:
  • [the] script[['s] name]
  • name of [the] script
Since: 2.0
Usable in events: Script Load/Unload
Return Type: Text
Holds the current script's name (the file name without '.sk').

Examples:

on script load:
    set {running::%script%} to true
on script unload:
    set {running::%script%} to false

Sea Level

🔗

Expression

Patterns:
Since: 2.5.1
Return Type: long
Gets the sea level of a world.

Examples:

send "The sea level in your world is %sea level in player's world%"

Sea Pickles

🔗

Expression

Patterns:
  • [the] [(min|max)[imum]] [sea] pickle(s| (count|amount)) of %blocks%
  • %blocks%'[s] [(min|max)[imum]] [sea] pickle(s| (count|amount))
Since: 2.7
Return Type: integer
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!!"

Sent Command List

🔗

Expression

Patterns:
  • [the] [sent] [server] command[s] list
Since: 2.8.0
Usable in events: send command list
Return Type: Text
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

Server Icon

🔗

Expression

Patterns:
  • [the] [((default)|(shown|sent))] [server] icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: Server Icon
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

Sets

🔗

Expression

Patterns:
  • [all [[of] the]|the|every] %*type%
Since: 1.0 pre-5, 2.7 (classinfo)
Return Type: Object
Returns a list of all the values of a type. Useful for looping.

Examples:

loop all attribute types:
    set loop-value attribute of player to 10
    message "Set attribute %loop-value% to 10!"

Shooter

🔗

Expression

Patterns:
Since: 1.3.7
Return Type: Living Entity
The shooter of a projectile.

Examples:

shooter is a skeleton

Shuffled List

🔗

Expression

Patterns:
Since: 2.2-dev32
Return Type: Object
Shuffles given list randomly. This is done by replacing indices by random numbers in resulting list.

Examples:

set {_list::*} to shuffled {_list::*}

Sign Text

🔗

Expression

Patterns:
  • [the] line %number% [of %block%]
  • [the] (1st|first|2nd|second|3rd|third|4th|fourth) line [of %block%]
Since: 1.3
Return Type: Text
A line of text on a sign. Can be changed, but remember that there is a 16 character limit per line (including color codes that use 2 characters each).

Examples:

on rightclick on sign:
    line 2 of the clicked block is "[Heal]":
        heal the player
    set line 3 to "%player%"

Skull Owner

🔗

Expression

Patterns:
  • [the] (head|skull) owner of %blocks%
  • %blocks%'[s] (head|skull) owner
Since: 2.9.0
Return Type: Offline Player
The skull owner of a player skull.

Examples:

set {_owner} to the skull owner of event-block
set skull owner of {_block} to "Njol" parsed as offlineplayer

Slot Index

🔗

Expression

Patterns:
  • [the] [(raw|unique)] index of %slots%
  • %slots%'[s] [(raw|unique)] index
Since: 2.2-dev35, 2.8.0 (raw index)
Return Type: long
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

Sorted List

🔗

Expression

Patterns:
Since: 2.2-dev19
Return Type: Object
Sorts given list in natural order. All objects in list must be comparable; if they're not, this expression will return nothing.

Examples:

set {_sorted::*} to sorted {_players::*}

Source Block

🔗

Expression

Patterns:
  • [the] source block
Since: 2.7
Usable in events: Spread
Return Type: Block
The source block in a spread event.

Examples:

on spread:
    if the source block is a grass block:
        set the source block to a dirt block

Spawn

🔗

Expression

Patterns:
  • [the] spawn[s] [(point|location)[s]] [of %worlds%]
  • %worlds%'[s] spawn[s] [(point|location)[s]]
Since: 1.4.2
Return Type: Location
The spawn point of a world.

Examples:

teleport all players to spawn
set the spawn point of "world" to the player's location

Spawn Reason

🔗

Expression

Patterns:
  • [the] spawn[ing] reason
Since: 2.3
Return Type: Spawn Reason
The spawn reason in a spawn event.

Examples:

on spawn:
    spawn reason is reinforcements or breeding
    cancel event

Spawner Type

🔗

Expression

Patterns:
  • [the] (spawner|entity|creature) type[s] of %blocks%
  • %blocks%'[s] (spawner|entity|creature) type[s]
Since: 2.4, 2.9.2 (trial spawner)
Return Type: Entity Type
Retrieves, sets, or resets the spawner's entity type

Examples:

on right click:
    if event-block is spawner:
        send "Spawner's type is %target block's entity type%"

Special Number

🔗

Expression

Patterns:
  • (NaN|[(-|minus)](infinity|∞)) value
  • value of (NaN|[(-|minus)](infinity|∞))
Since: 2.2-dev32d
Return Type: Number
Special number values, namely NaN, Infinity and -Infinity

Examples:

if {_number} is infinity value:

Spectator Target

🔗

Expression

Patterns:
Since: 2.4-alpha4, 2.7 (Paper Spectator Event)
Requirements: Paper
Return Type: Entity
Grabs the spectator target entity of the players.

Examples:

on player start spectating of player:
    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

Speed

🔗

Expression

Patterns:
  • [the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%
  • %players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speed
Since: unknown (before 2.1)
Return Type: Number
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

Substring

🔗

Expression

Patterns:
  • [the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%
  • [the] (first|last) [%number%] character[s] of %texts%
  • [the] %number% (first|last) characters of %texts%
  • [the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%
Since: 2.1, 2.5.2 (character at, multiple strings support)
Return Type: Text
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

TPS (ticks per second)

🔗

Expression

Patterns:
  • tps from [the] last ([1] minute|1[ ]m[inute])
  • tps from [the] last 5[ ]m[inutes]
  • tps from [the] last 15[ ]m[inutes]
  • [the] tps
Since: 2.2-dev36
Return Type: Number
Returns the 3 most recent TPS readings, like the /tps command. This expression is only supported on some server software (PaperSpigot).

Examples:

broadcast "%tps%"

Tamer

🔗

Expression

Patterns:
  • [the] tamer
Since: 2.2-dev25
Return Type: Player
The tamer of an entity. Can only be used in entity tame events. You can use 'event-entity' to refer tamed entity itself.

Examples:

on tame:
    if the tamer is a player:
        send "someone tamed something!" to console

Target

🔗

Expression

Patterns:
Since: 1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks)
Return Type: Entity
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

Targeted Block

🔗

Expression

Patterns:
Since: 1.0, 2.9.0 (actual/exact)
Return Type: Block
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

Teleport Cause

🔗

Expression

Patterns:
  • [the] teleport (cause|reason|type)
Since: 2.2-dev35
Return Type: Teleport Cause
The teleport cause within a player teleport event.

Examples:

on teleport:
    teleport cause is nether portal, end portal or end gateway
    cancel event

Temperature

🔗

Expression

Patterns:
  • [the] temperature[s] of %blocks%
  • %blocks%'[s] temperature[s]
Since: 2.2-dev35
Return Type: Number
Temperature at given block.

Examples:

message "%temperature of the targeted block%"

Ternary

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: Object
A shorthand expression for returning something based on a condition.

Examples:

set {points} to 500 if {admin::%player's uuid%} is set else 100

The Egg

🔗

Expression

Patterns:
  • [the] [thrown] egg
Since: 2.7
Usable in events: Egg Throw
Return Type: Projectile
The egg thrown in a Player Egg Throw event.

Examples:

spawn an egg at the egg

Time

🔗

Expression

Patterns:
  • [the] time[s] [([with]in|of) %worlds%]
  • %worlds%'[s] time[s]
Since: 1.0
Return Type: Time
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

Time Played

🔗

Expression

Patterns:
Since: 2.5, 2.7 (offline players)
Requirements: MC 1.15+ (offline players)
Return Type: Timespan
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

set player's time played to 0 seconds

Time Since

🔗

Expression

Patterns:
  • [the] time since %dates%
Since: 2.5
Return Type: Timespan
The time that has passed since a date. If the given date is in the future, a value will not be returned.

Examples:

send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player

Timespan Details

🔗

Expression

Patterns:
  • [the] ((tick|second|minute|hour|day|week|month|year))s of %time spans%
  • %time spans%'[s] ((tick|second|minute|hour|day|week|month|year))s
Since: 2.9.0
Return Type: long
Retrieve specific information of a timespan such as hours/minutes/etc.

Examples:

set {_t} to difference between now and {Payouts::players::%uuid of player%::last-date}
send "It has been %days of {_t}% day(s) since last payout."

Tool

🔗

Expression

Patterns:
  • [the] ((tool|held item|weapon)|(off[ ]hand (tool|item))) [of %living entities%]
  • %living entities%'[s] ((tool|held item|weapon)|(off[ ]hand (tool|item)))
Since: 1.0
Return Type: Slot
The item an entity is holding in their main or off hand.

Examples:

player's tool is a pickaxe
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

Total Experience

🔗

Expression

Patterns:
Since: 2.7
Return Type: integer
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

Transform Reason

🔗

Expression

Patterns:
  • [the] transform[ing] (cause|reason|type)
Since: 2.8.0
Return Type: Transform Reason
The transform reason within an entity entity transform event.

Examples:

on entity transform:
    transform reason is infection, drowned or frozen

Type of

🔗

Expression

Patterns:
Since: 1.4, 2.5.2 (potion effect), 2.7 (block datas)
Return Type: Object
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%!"

UUID

🔗

Expression

Patterns:
Since: 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs)
Return Type: Text
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

Unbreakable Items

🔗

Expression

Patterns:
Since: 2.2-dev13b, 2.9.0 (breakable)
Return Type: Item Type
Creates breakable or unbreakable copies of given items.

Examples:

set {_item} to unbreakable iron sword
give breakable {_weapon} to all players

Unix Date

🔗

Expression

Patterns:
Since: 2.5
Return Type: Date
Converts given Unix timestamp to a date. The Unix timespan represents the number of seconds elapsed since 1 January 1970.

Examples:

unix date of 946684800 #1 January 2000 12:00 AM (UTC Time)

Unix Timestamp

🔗

Expression

Patterns:
  • [the] unix timestamp of %dates%
  • %dates%'[s] unix timestamp
Since: 2.2-dev31
Return Type: Number
Converts given date to Unix timestamp. This is roughly how many seconds have elapsed since 1 January 1970.

Examples:

unix timestamp of now

Value Within

🔗

Expression

Patterns:
Since: 2.7
Return Type: Object
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"

Vectors - Angle Between

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Number
Gets the angle between two vectors.

Examples:

send "%the angle between vector 1, 0, 0 and vector 0, 1, 1%"

Vectors - Create Location from Vector

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Location
Creates a location from a vector in a world.

Examples:

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

Vectors - Create from Direction

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Vector
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

Vectors - Create from XYZ

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Creates a vector from x, y and z values.

Examples:

set {_v} to vector 0, 1, 0

Vectors - Cross Product

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Gets the cross product between two vectors.

Examples:

send "%vector 1, 0, 0 cross vector 0, 1, 0%"

Vectors - Cylindrical Shape

🔗

Expression

Patterns:
  • [a] [new] cylindrical vector [from|with] [radius] %number%, [yaw] %number%(,[ and]| and) [height] %number%
Since: 2.2-dev28
Return Type: Vector
Forms a 'cylindrical shaped' vector using yaw to manipulate the current point.

Examples:

loop 360 times:
    set {_v} to cylindrical vector radius 1, yaw loop-value, height 2
set {_v} to cylindrical vector radius 1, yaw 90, height 2

Vectors - Dot Product

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Number
Gets the dot product between two vectors.

Examples:

set {_dot} to {_v1} dot {_v2}

Vectors - Length

🔗

Expression

Patterns:
  • [the] (vector|standard|normal) length[s] of %vectors%
  • %vectors%'[s] (vector|standard|normal) length[s]
Since: 2.2-dev28
Return Type: Number
Gets or sets the length of a vector.

Examples:

send "%standard length of vector 1, 2, 3%"
set {_v} to vector 1, 2, 3
set standard length of {_v} to 2
send "%standard length of {_v}%"

Vectors - Location Vector Offset

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Location
Returns the location offset by vectors.

Examples:

set {_loc} to {_loc} ~ {_v}

Vectors - Normalized

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Returns the same vector but with length 1.

Examples:

set {_v} to normalized {_v}

Vectors - Random Vector

🔗

Expression

Patterns:
  • [a] random vector
Since: 2.2-dev28, 2.7 (signed components)
Return Type: Vector
Creates a random unit vector.

Examples:

set {_v} to a random vector

Vectors - Spherical Shape

🔗

Expression

Patterns:
  • [a] [new] spherical vector [(from|with)] [radius] %number%, [yaw] %number%(,[ and]| and) [pitch] %number%
Since: 2.2-dev28
Return Type: Vector
Forms a 'spherical shaped' vector using yaw and pitch to manipulate the current point.

Examples:

loop 360 times:
    set {_v} to spherical vector radius 1, yaw loop-value, pitch loop-value
set {_v} to spherical vector radius 1, yaw 45, pitch 90

Vectors - Squared Length

🔗

Expression

Patterns:
  • [the] squared length[s] of %vectors%
  • %vectors%'[s] squared length[s]
Since: 2.2-dev28
Return Type: Number
Gets the squared length of a vector.

Examples:

send "%squared length of vector 1, 2, 3%"

Vectors - Vector Between Locations

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Creates a vector between two locations.

Examples:

set {_v} to vector between {_loc1} and {_loc2}

Vectors - Vector Projection

🔗

Expression

Patterns:
Since: 2.8.0
Return Type: Vector
An expression to get the vector projection of two vectors.

Examples:

set {_projection} to vector projection of vector(1, 2, 3) onto vector(4, 4, 4)

Vectors - Vector from Location

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Creates a vector from a location.

Examples:

set {_v} to vector of {_loc}

Vectors - Vector from Pitch and Yaw

🔗

Expression

Patterns:
  • [a] [new] vector (from|with) yaw %number% and pitch %number%
Since: 2.2-dev28
Return Type: Vector
Creates a vector from a yaw and pitch value.

Examples:

set {_v} to vector from yaw 45 and pitch 45

Vectors - Velocity

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: Vector
Gets or changes velocity of an entity.

Examples:

set player's velocity to {_v}

Vectors - XYZ Component

🔗

Expression

Patterns:
  • [the] [vector] (x|y|z) [component[s]] of %vectors%
  • %vectors%'[s] [vector] (x|y|z) [component[s]]
Since: 2.2-dev28
Return Type: Number
Gets or changes the x, y or z component of a vector.

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::*}%"

Vehicle

🔗

Expression

Patterns:
Since: 2.0
Return Type: Entity
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

Examples:

vehicle of the player is a minecart

Version

🔗

Expression

Patterns:
  • ([craft]bukkit|minecraft|skript)( |-)version
Since: 2.0
Return Type: Text
The version of Bukkit, Minecraft or Skript respectively.

Examples:

message "This server is running Minecraft %minecraft version% on Bukkit %bukkit version%"
message "This server is powered by Skript %skript version%"

Version String

🔗

Expression

Patterns:
  • [the] [shown|custom] version [string|text]
Since: 2.3
Usable in events: Server List Ping
Requirements: Paper 1.12.2+
Return Type: Text
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 "&lt;light green&gt;Version: &lt;orange&gt;%minecraft version%"

View Distance

🔗

Expression

Patterns:
Since: 2.4
Requirements: Paper
Return Type: integer
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

View Distance of Client

🔗

Expression

Patterns:
  • [the] client view distance[s] of %players%
  • %players%'[s] client view distance[s]
Since: 2.5
Requirements: 1.13.2+
Return Type: long
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

Weather

🔗

Expression

Patterns:
Since: 1.0
Usable in events: weather change
Return Type: Weather Type
The weather in the given or the current world.

Examples:

set weather to clear
weather in "world" is rainy

Whether

🔗

Expression

Patterns:
  • whether <.+>
Since: 2.9.0
Return Type: Boolean
A shorthand for returning the result of a condition (true or false). This is functionally identical to using `true if else false`.

Examples:

set {fly} to whether player can fly
broadcast "Flying: %whether player is flying%"

Whitelist

🔗

Expression

Patterns:
  • [the] white[ ]list
Since: 2.5.2, 2.9.0 (delete)
Return Type: Offline 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

With Fire Resistance

🔗

Expression

Patterns:
Since: 2.9.0
Requirements: Spigot 1.20.5+
Return Type: Item Type
Creates a copy of an item with (or without) fire resistance.

Examples:

set {_x} to diamond sword with fire resistance
equip player with netherite helmet without fire resistance
drop fire resistant stone at player

World

🔗

Expression

Patterns:
Since: 1.0
Return Type: World
The world the event occurred in.

Examples:

world is "world_nether"
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

World Environment

🔗

Expression

Patterns:
  • [the] [world] environment of %worlds%
  • %worlds%'[s] [world] environment
Since: 2.7
Return Type: World Environment
The environment of a world

Examples:

if environment of player's world is nether:
    apply fire resistance to player for 10 minutes

World Seed

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type: long
The seed of given world. Note that it will be returned as Minecraft internally treats seeds, not as you specified it in world configuration.

Examples:

broadcast "Seed: %seed of player's world%"

World from Name

🔗

Expression

Patterns:
  • [the] world [(named|with name)] %text%
Since: 2.6.1
Return Type: World
Returns the world from a string.

Examples:

world named {game::world-name}
the world "world"

Worlds

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] worlds
Since: 1.0
Return Type: World
All worlds of the server, useful for looping.

Examples:

loop all worlds:
    broadcast "You're in %loop-world%" to loop-world

X Times

🔗

Expression

Patterns:
Since: 1.4.6
Return Type: long
Integers between 1 and X, used in loops to loop X times.

Examples:

loop 20 times:
    broadcast "%21 - loop-number% seconds left.."
    wait 1 second

X of Item

🔗

Expression

Patterns:
Since: 1.2
Return Type: Object
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.

Examples:

give level of player of pickaxes to the player

Yaw / Pitch

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev28 (vector yaw/pitch), 2.9.0 (entity changers)
Requirements: Paper 1.19+ (player changers)
Return Type: float
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