| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | sponge absorb |
| Return Type: | Block |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Item |
Examples:
if victim's active tool is a bow:
interrupt player's active item use
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Timespan |
If an entity is not using any item, this will return 0 seconds.
Examples:
broadcast player's remaining item use time
wait 1 second
broadcast player's item use time
| Patterns: |
|
| Since: | 2.4 |
| Return Type: | Living Entity |
Examples:
loop affected entities:
if loop-value is a player:
send "WARNING: you've step on an area effect cloud!" to loop-value
| Patterns: | |
| Since: | 2.7 |
| Return Type: | integer |
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 age of targeted block to maximum age of targeted block
# Spawn a baby cow that will only need 1 minute to become an adult
spawn a baby cow at player
set age of last spawned entity to -1200 # in ticks = 60 seconds
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | Object |
Examples:
trigger:
send all the banned players
| Patterns: |
|
| Since: | 2.2-dev35 |
| Requirements: | Vault, a permission plugin that supports Vault |
| Return Type: | Text |
Examples:
trigger:
if argument is "list":
send "%all groups%"
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | Offline Player |
Examples:
| Patterns: | |
| Since: | 2.2-dev33 |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | Text |
Examples:
trigger:
send "All Scripts: %scripts%" to player
send "Loaded Scripts: %enabled scripts%" to player
send "Unloaded Scripts: %disabled scripts%" to player
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Script |
Examples:
trigger:
send "All Scripts: %scripts%" to player
send "Loaded Scripts: %enabled scripts%" to player
send "Unloaded Scripts: %disabled scripts%" to player
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Minecraft Tag |
`minecraft tag` will return only the vanilla tags, `datapack tag` will return only datapack-provided tags, `paper tag` will return only Paper's custom tags (if you are running Paper), and `custom tag` will look in the "skript" namespace for custom tags you've registered.
You can also filter by tag types using "item", "block", or "entity".
Examples:
send paper entity tags
broadcast all block tags
| Patterns: |
|
| Since: | 2.6 |
| Return Type: | Text |
Examples:
send "Number of all script commands: %size of all script commands%"
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Timespan |
Resetting the cooldown time will set the cooldown time to the same amount of time after an allay has duplicated.
Examples:
add 5 seconds to the duplication cool down time of last spawned allay
remove 3 seconds from the duplicating cooldown time of last spawned allay
clear the clone cool down of last spawned allay
reset the cloning cool down time of last spawned allay
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Location |
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | integer |
Alpha represents opacity.
Examples:
set {_red} to red's red value + 10
| Patterns: | |
| Since: | 1.4.3 |
| Return Type: | Number |
Examples:
altitude of the attacker is higher than the altitude of the victim
set damage to damage * 1.2
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | Number |
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. Examples:
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | Timespan |
Infinite timespans generally follow the rules of infinity, where most math operations do nothing. However, operations that would return NaN with numbers will instead return a timespan of 0 seconds.
Note that an eternity will often be treated as the longest duration something supports, rather than a true eternity.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Number |
If radians is specified, converts the passed value to degrees. This conversion may not be entirely accurate, due to floating point precision.
Examples:
{_angle} is 90 # true
180 degrees is pi # true
pi radians is 180 degrees # true
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | integer |
The default value of max cost set by vanilla Minecraft is 40.
Examples:
if {AnvilRepairSaleActive} = true:
wait a tick # recommended, to avoid client bugs
set anvil repair cost to anvil repair cost * 50%
send "Anvil repair sale is ON!" to player
on inventory click:
player have permission "anvil.repair.max.bypass"
set max repair cost of event-inventory to 99999
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | Text |
Examples:
type of event-inventory is anvil inventory
if the anvil text input of the event-inventory is "FREE OP":
ban player
| Patterns: |
|
| Since: | Unknown |
| Return Type: | Object |
Useful when doing comparisons with variable lists.
Examples:
if any of {teamA::*} are within location(0, 0, 0) and location(10, 10, 10):
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Beacon Effect |
| Return Type: | Potion Effect Type |
Examples:
if the applied effect is primary beacon effect:
broadcast "Is Primary"
else if applied effect = secondary effect:
broadcast "Is Secondary"
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | enchant |
| Return Type: | Enchantment Type |
Deleting or removing the applied enchantments will prevent the item's enchantment.
Examples:
set the applied enchantments to sharpness 10 and fire aspect 5
| Patterns: | |
| Since: | 1.0, 2.7 (support for command events) |
| Return Type: | Object |
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:
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument
| Patterns: |
|
| Since: | 1.4.2 |
| Return Type: | Object |
Examples:
loop (argument + 2) / 5 times:
message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"
| Patterns: |
|
| Since: | 2.11 |
| Usable in events: | Armor Change |
| Return Type: | Item |
Examples:
broadcast the old armor item
| Patterns: |
|
| Since: | 1.0, 2.8.0 (armor), 2.10 (body armor), 2.12 (saddle) 2.12.1 (happy ghast) |
| Return Type: | Slot |
Body armor is a special slot that can only be used for:
- Horses: Horse armour (doesn't work on zombie or skeleton horses)
- Wolves: Wolf Armor
- Llamas (regular or trader): Carpet
- Happy Ghasts: Harness
Saddle is a special slot that can only be used for: pigs, striders and horse types (horse, camel, llama, mule, donkey).
Examples:
helmet of player is neither tag values of tag "paper:helmets" nor air # player is wearing a block, e.g. from another plugin
| Patterns: |
|
| Since: | 2.8.0, 2.12 (multiple blocks) |
| Requirements: | Minecraft 1.21.4+ (multiple blocks) |
| Return Type: | Block |
If running Paper 1.21.4+, the plural version of the expression should be used as it is more reliable compared to the single version.
Examples:
on projectile hit:
wait 1 tick
break attached blocks of event-projectile
kill event-projectile
| Patterns: |
|
| Since: | 2.5.1 |
| Return Type: | long |
Examples:
event-projectile is an arrow
set arrow knockback strength of event-projectile to 10
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | long |
Examples:
| Patterns: | |
| Since: | 2.6.1 |
| Requirements: | Minecraft 1.15+ |
| Return Type: | float |
NOTE: Currently this can not be set to anything.
Examples:
if attack cooldown of attacker < 1:
set damage to 0
send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker
| Patterns: |
|
| Since: | 1.3, 2.6.1 (projectile hit event) |
| Usable in events: | damage, death, projectile hit |
| Return Type: | Entity |
Examples:
victim is a creeper
damage the attacked by 1 heart
| Patterns: |
|
| Since: | 1.3 |
| Usable in events: | damage, death, destroy |
| Return Type: | Entity |
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:
attacker is a player
health of attacker is less than or equal to 2
damage victim by 1 heart
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Banner Pattern |
Examples:
add {_pattern} to banner patterns of {_banneritem}
remove {_pattern} from banner patterns of {_banneritem}
set the 1st banner pattern of block at location(0,0,0) to {_pattern}
clear the 1st banner pattern of block at location(0,0,0)
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Item Type |
Note that not all banner pattern types have an item.
Examples:
set {_item} to snout banner pattern item
set {_item} to thing banner pattern item
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Banner Pattern |
In order to set a specific position of a banner, there needs to be that many patterns already on the banner.
This expression will add filler patterns to the banner to allow the specified position to be set.
For Example, setting the 3rd banner pattern of a banner that has no patterns on it, will internally add 3 base patterns, allowing the 3rd banner pattern to be set.
Examples:
broadcast 1st banner pattern of block at location(0,0,0)
clear banner patterns of {_banneritem}
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Item Type |
Examples:
if the bartering drops contain a jack o lantern:
remove jack o lantern from bartering output
broadcast "it's not halloween yet!"
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Item Type |
Examples:
if the bartering input is a gold ingot:
broadcast "my precious..."
| Patterns: | |
| Since: | 2.10 |
| Usable in events: | Beacon Effect, Beacon Toggle, Beacon Change Effect |
| Return Type: | Potion Effect Type |
The secondary effect can be set to anything, but the icon in the GUI will not display correctly.
The secondary effect can only be set when the beacon is at max tier.
The primary and secondary effect can not be the same, primary will always retain the potion type and secondary will be cleared.
Examples:
set secondary effect of {_block} to resistance
| Patterns: |
|
| Since: | 2.0, 2.7 (offlineplayers, safe bed) |
| Return Type: | Location |
safe bed location.NOTE: Offline players can not have their bed location changed, only online players.
Examples:
teleport player the the player's bed
else:
teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location
set the safe bed location of player to spawn location of world("world") # safe/valid bed location
| Patterns: | |
| Since: | 1.4.4, 2.6.1 (3D biomes) |
| Return Type: | Biome |
(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:
every real minute:
loop all players:
biome at loop-player is desert
damage the loop-player by 1
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Equippable Components |
Examples:
set the camera overlay to "custom_overlay"
set the allowed entities to a zombie and a skeleton
set the equip sound to "block.note_block.pling"
set the equipped model id to "custom_model"
set the shear sound to "ui.toast.in"
set the equipment slot to chest slot
allow event-equippable component to be damage when hurt
allow event-equippable component to be dispensed
allow event-equippable component to be equipped onto entities
allow event-equippable component to be sheared off
allow event-equippable component to swap equipment
set the equippable component of {_item} to {_component}
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | Block |
Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
loop-block is obsidian
set loop-block to water
block is a chest:
clear the inventory of the block
| Patterns: | |
| Since: | 1.0 |
| Return Type: | Block |
Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
Examples:
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
loop-block is obsidian
set loop-block to water
block is a chest:
clear the inventory of the block
| Patterns: | |
| Since: | 2.7 |
| Requirements: | 1.17+ |
| Return Type: | float |
Examples:
event-block is set
send "Break Speed: %break speed for player%" to player
| Patterns: | |
| Since: | 2.5, 2.5.2 (set), 2.10 (block displays) |
| Return Type: | Block Data |
This data can also be used to set blocks.
Examples:
set block at player to {_data}
set block data of target block to oak_stairs[facing=south;waterlogged=true]
| Patterns: |
|
| Since: | 2.6 |
| Requirements: | Minecraft 1.13+ |
| Return Type: | Number |
Examples:
if block hardness of target block > 5:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Text |
This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
Examples:
set {_sounds::*} to place sounds of dirt, grass block, blue wool and stone
| Patterns: | |
| Since: | 1.0 |
| Return Type: | Block |
Examples:
set loop-block to air
| Patterns: |
|
| Since: | 1.0, 2.5.1 (within/cuboid/chunk) |
| Return Type: | Block |
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 between the block below the player and the targeted block:
set the blocks below the player, the victim and the targeted block to air
set all blocks within {loc1} and {loc2} to stone
set all blocks within chunk at player to air
| Patterns: |
|
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
| Return Type: | Block |
This expression requires a supported regions plugin to be installed.
Examples:
clear the loop-block
| Patterns: |
|
| Since: | 2.2-dev31 |
| Return Type: | Text |
Examples:
message "Book Title: %author of event-item%"
| Patterns: |
|
| Since: | 2.2-dev31, 2.7 (changers) |
| Return Type: | Text |
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:
message "Book Pages: %pages of event-item%"
message "Book Page 1: %page 1 of event-item%"
set page 1 of player's held item to "Book writing"
| Patterns: |
|
| Since: | 2.2-dev31 |
| Return Type: | Text |
Examples:
message "Book Title: %title of event-item%"
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Living Entity |
Examples:
send "When a %breeding mother% and %breeding father% love each other very much, they make a %bred offspring%" to breeder
| Patterns: |
|
| Since: | 2.13 |
| Usable in events: | Brewing Complete |
| Return Type: | Item |
Examples:
set {_results::*} to the brewing results
| Patterns: | |
| Since: | 2.13 |
| Return Type: | integer |
Examples:
clear the brewing stand fuel level of {_block}
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | Slot |
Examples:
clear the brewing stand second bottle slot of {_block}
| Patterns: | |
| Since: | 2.12 |
| Requirements: | Minecraft 1.20+ |
| Return Type: | Item |
The only blocks that can currently be "dusted" are Suspicious Gravel and Suspicious Sand.
Examples:
set {_gravel}'s brushable item to emerald
| Patterns: |
|
| Since: | 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases) |
| Return Type: | Text |
Examples:
"oops!" in uppercase # OOPS!
"hellO i'm steve!" in proper case # HellO I'm Steve!
"hellO i'm steve!" in strict proper case # Hello I'm Steve!
"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()
"spAwn neW boSs ()" in strict camel case # spawnNewBoss()
"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()
"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()
"Hello Player!" in snake case # Hello_Player!
"Hello Player!" in lower snake case # hello_player!
"Hello Player!" in upper snake case # HELLO_PLAYER!
"What is your name?" in kebab case # What-is-your-name?
"What is your name?" in lower kebab case # what-is-your-name?
"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Location |
Examples:
| Patterns: | |
| Since: | 2.9.0 |
| Return Type: | integer |
Examples:
loop {_letters::*}:
set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if:
{_previous-codepoint} is set
# if the codepoint of the current character is not
# 1 more than the codepoint of the previous character
# then the letters are not in order
{_codepoint} - {_previous-codepoint} is not 1
then:
return false
set {_previous-codepoint} to {_codepoint}
return true
| Patterns: |
|
| Since: | 2.9.0 |
| Return Type: | Text |
Examples:
set {_lower} to codepoint of {_lower}
return {_none} if {_lower} is not set
set {_upper} to codepoint of {_upper}
return {_none} if {_upper} is not set
loop integers between {_lower} and {_upper}:
add character from codepoint loop-value to {_chars::*}
return {_chars::*}
| Patterns: | |
| Since: | 2.8.0 |
| Return Type: | Text |
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:
broadcast "%loop-value%"
# 0123456789:;<=>?@ABC... ...uvwxyz
send characters between "0" and "z"
# 0123456789ABC... ...uvwxyz
send alphanumeric characters between "0" and "z"
| Patterns: |
|
| Since: | 2.2-dev31 |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.2-Fixes-v7, 2.2-dev35 (clearing recipients) |
| Return Type: | Player |
Examples:
| Patterns: |
|
| Since: | 2.0, 2.8.0 (loaded chunks) |
| Return Type: | Chunk |
Examples:
set {_chunks::*} to the loaded chunks of the player's world
| Patterns: |
|
| Since: | 1.0, 2.2-dev35 (more clickable things) |
| Usable in events: | click, inventory click |
| Return Type: | Object |
Examples:
if the clicked block is a chest:
show the inventory of the clicked block to the player
| Patterns: |
|
| Since: | 1.2, 2.10 (displays) |
| Return Type: | Color |
This can also be used to color chat messages with "<%color of ...%>this text is colored!".
Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
Examples:
if event-block is tagged with minecraft tag "wool":
message "This wool block is <%color of block%>%color of block%<reset>!"
set the color of the block to black
| Patterns: | |
| Since: | 2.0 |
| Return Type: | Text |
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:
set message to colored message # Safe; only colors get parsed
command /fade <player>:
trigger:
set display name of the player-argument to uncolored display name of the player-argument
command /format <text>:
trigger:
message formatted text-argument # Safe, because we're sending to whoever used this command
| Patterns: |
|
| Since: | 2.0, 2.7 (support for script commands) |
| Usable in events: | command |
| Return Type: | Text |
Examples:
on command:
if {game::%player%::playing} is true:
if the command is not "exit":
message "You're not allowed to use commands during the game"
cancel the event
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Text |
Examples:
set command of {_cmdMinecart} to "say asdf"
| Patterns: |
|
| Since: | 2.6 |
| Return Type: | Text |
Examples:
description of command "help"
label of command "pl"
usage of command "help"
aliases of command "bukkit:help"
permission of command "/op"
command "op"'s permission message
command "sk"'s plugin owner
command /greet <player>:
usage: /greet <target>
trigger:
if arg-1 is sender:
send "&cYou can't greet yourself! Usage: %the usage%"
stop
send "%sender% greets you!" to arg-1
send "You greeted %arg-1%!"
| Patterns: |
|
| Since: | 2.0 |
| Usable in events: | command |
| Return Type: | Command Sender |
If the command sender is a command block, its location can be retrieved by using %block's location%
Examples:
on command:
log "%executor% used command /%command% %arguments%" to "commands.log"
| Patterns: | |
| Since: | 2.0 |
| Return Type: | Location |
As of Minecraft 1.21.4, the compass is controlled by the resource pack and by default will not point to this compass target when used outside of the overworld dimension.
Examples:
every 5 seconds:
loop all players:
set the loop-player's compass target to location of {compass::target::%%loop-player%}
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Config |
This can be reloaded, or navigated to retrieve options.
Examples:
if text value of {_node} is "french":
broadcast "Bonjour!"
| Patterns: |
|
| Since: | 1.3.1 |
| Return Type: | Command Sender |
Examples:
send "message to console" to the console
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Item |
Examples:
if the consumed item is an arrow:
cancel event
send "You're now allowed to shoot your arrows." to shooter
on player consume:
if the consumed item is cooked porkchop:
send "Well aren't you just a little piggy wiggly!" to player
if player has scoreboard tag "vegetarian":
set the consumed item to a carrot
| Patterns: |
|
| Since: | 2.2-dev33 |
| Return Type: | Object |
the last usage date, or the cooldown bypass permission.
Examples:
cooldown: 10 seconds
cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
trigger:
teleport player to {home::%player%}
| Patterns: | |
| Since: | 1.4.3 |
| Return Type: | Number |
Examples:
message "Watch out for lava!"
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Loot Context |
Examples:
set {_context} to a loot context at player:
set loot luck value to 10
set looter to {_player}
set looted entity to last spawned pig
give player loot items of loot table "minecraft:entities/iron_golem" with loot context {_context}
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | World Border |
Borders assigned to worlds apply to all players in that world.
Borders assigned to players apply only to those players, and different players can have different borders.
Examples:
set {_location} to location of player
set worldborder of player to a virtual worldborder:
set worldborder radius to 25
set world border center of event-worldborder to {_location}
on load:
set worldborder of world "world" to a worldborder:
set worldborder radius of event-worldborder to 200
set worldborder center of event-worldborder to location(0, 64, 0)
set worldborder warning distance of event-worldborder to 5
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Damage Source |
Examples:
set the damage type of the created damage source to magic
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | Entity |
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:
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow
| Patterns: | |
| Since: | 2.2-dev34, 2.8.0 (chat format) |
| Return Type: | Inventory |
Examples:
set {_inventory} to a chest inventory with 1 row
set slot 4 of {_inventory} to a diamond named "example"
open {_inventory} to player
open chest inventory named "<#00ff00>hex coloured title!" with 6 rows to player
| Patterns: |
|
| Since: | 2.5 2.12 (floats/flags/strings/colours/full model data) |
| Requirements: | Minecraft 1.21.4+ (floats/flags/strings/colours/full model data) |
| Return Type: | Object |
Since 1.21.4, custom model data instead consists of a list of numbers (floats), a list of booleans (flags), a list of strings, and a list of colours. Accessing and modifying these lists can be done type-by-type, or all at once with `complete custom model data`. This is the more accurate and recommended method of using custom model data.
Examples:
set {_model} to custom model data of player's tool
set custom model data colours of {_flag} to red, white, and blue
add 10.5 to the model data floats of {_flag}
set the full custom model data of {_item} to 10, "sword", and rgb(100, 200, 30)
| Patterns: |
|
| Since: | 1.3.5, 2.8.0 (item damage event) |
| Usable in events: | Damage, Vehicle Damage, Item Damage |
| Return Type: | Number |
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:
event-item is any tool
clear damage # unbreakable tools as the damage will be 0
on damage:
increase the damage by 2
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | double |
Players only take damage when outside of the world's world border, and the damage value cannot be less than 0.
Examples:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | double |
Players only take damage when outside of the world's world border, and the damage buffer distance cannot be less than 0.
Examples:
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Damage Cause |
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Damage Source |
When setting a 'causing entity' you must also set a 'direct entity'.
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
Examples:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
damage all players by 5 using {_source}
on damage:
if the damage type of event-damage source is magic:
set the damage to damage * 2
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Entity |
The causing entity is the entity that ultimately caused the damage. (e.g. the entity that shot an arrow)
When setting a 'causing entity' you must also set a 'direct entity'.
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
Examples:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
on damage:
set {_causing} to the causing entity of event-damage source
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Location |
The 'damage location' on vanilla damage sources will be set if an entity did not cause the damage.
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
Examples:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
on death:
set {_location} to the damage location of event-damage source
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Damage Type |
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
Examples:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
damage all players by 5 using {_source}
on death:
set {_type} to the damage type of event-damage source
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Entity |
The direct entity is the entity that directly caused the damage. (e.g. the arrow that was shot)
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
Examples:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
damage all players by 5 using {_source}
on death:
set {_direct} to the direct entity of event-damage source
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | float |
Examples:
if the food exhaustion of event-damage source is 10:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20.4+ |
| Return Type: | Location |
The 'source location' for vanilla damage sources will retrieve the 'damage location' if set. If 'damage location' is not set, will attempt to grab the location of the 'causing entity', otherwise, null.
Examples:
set {_location} to the source location of event-damage source
| Patterns: |
|
| Since: | 1.2, 2.7 (durability reversed) |
| Return Type: | integer |
Examples:
reset the durability of {_item}
set durability of player's held item to 0
| Patterns: | |
| Since: | 2.4 |
| Return Type: | Item Type |
Examples:
set player's tool to diamond hoe damaged by 250
give player diamond sword with damage 700 named "BROKEN SWORD"
set {_item} to diamond hoe with damage value 50 named "SAD HOE"
| Patterns: | |
| Since: | 2.2-dev33 |
| Return Type: | Date |
Examples:
set {_hourAfter} to 1 hour after {someOtherDate}
set {_hoursBefore} to 5 hours before {someOtherDate}
| Patterns: | |
| Since: | 2.10 (experimental) |
| Return Type: | Object |
using queues experimental feature flag to be enabled.Unrolls a queue into a regular list of values, which can be stored in a list variable. The order of the list will be the same as the order of the elements in the queue. If a list variable is set to this, it will use numerical indices. The original queue will not be changed.
Examples:
add "hello" and "there" to {queue}
set {list::*} to dequeued {queue}
| Patterns: | |
| Since: | 2.13 |
| Return Type: | Text |
Examples:
| Patterns: | |
| Since: | 1.4 |
| Return Type: | Object |
Examples:
message "You have to wait a minute before using this command again!"
| Patterns: | |
| Since: | 2.3 |
| Return Type: | Difficulty |
Examples:
| Patterns: |
|
| Since: | 1.0 (basic), 2.0 (extended) |
| Return Type: | Direction |
Examples:
set the block behind the player to water
loop blocks above the player:
set {_rand} to a random integer between 1 and 10
set the block {_rand} meters south east of the loop-block to stone
block in horizontal facing of the clicked entity from the player is air
spawn a creeper 1.5 meters horizontally behind the player
spawn a TNT 5 meters above and 2 meters horizontally behind the player
thrust the last spawned TNT in the horizontal direction of the player with speed 0.2
push the player upwards and horizontally forward at speed 0.5
push the clicked entity in in the direction of the player at speed -0.5
open the inventory of the block 2 blocks below the player to the player
teleport the clicked entity behind the player
grow a regular tree 2 meters horizontally behind the player
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Display Billboard |
This describes the axes/points around which the display can pivot.
Displays spawn with the 'fixed' billboard by default. Resetting this expression will also set it to 'fixed'.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | integer |
Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override.
Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option.
NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
Examples:
subtract 3 from the block light level override of the last spawned text display
if sky light level override of {_display} is 5:
clear brightness override of {_display}
| Patterns: | |
| Since: | 2.10 |
| Return Type: | float |
The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it).
If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Timespan |
Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state.
Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate.
Resetting either value will return that value to 0.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Requirements: | Spigot 1.20.4+ |
| Return Type: | Timespan |
0 means that updates are applied immediately.
1 means that the display entity will move from current position to the updated one over one tick.
Higher values spread the movement over multiple ticks. Max of 59 ticks.
Examples:
teleport last spawned text display to {_location}
wait 2 ticks
message "display entity has arrived at %{_location}%"
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Quaternion |
The left rotation is applied first, with the right rotation then being applied based on the rotated axis.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | float |
Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range.
For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
Examples:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | UUID |
Examples:
if the uuid of the dropped item owner of last dropped item is uuid of player:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | UUID |
Examples:
if the uuid of the dropped item thrower of {_dropped item} is uuid of player:
clear the item thrower of {_dropped item}
| Patterns: |
|
| Since: | 1.0 |
| Usable in events: | death |
| Return Type: | Item Type |
In a death event, will hold 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:
remove 4 planks from the drops
| Patterns: | |
| Since: | 2.5.1 |
| Requirements: | Minecraft 1.15+ ('as %entity%') |
| Return Type: | Item Type |
Examples:
give drops of block using player's tool to player
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.20+ |
| Return Type: | integer |
The only blocks that can currently be "dusted" are Suspicious Gravel and Suspicious Sand.
Examples:
set {_sand}'s dusted stage to 2
| Patterns: |
|
| Since: | 2.0, 2.7 (relative to last element), 2.8.0 (range of elements) |
| Return Type: | Object |
Asking for elements from a queue will also remove them from the queue, see the new queue expression for more information.
See also: random expression
Examples:
set {_last} to last element of {top players::*}
set {_random player} to random element out of all players
send 2nd last element of {top players::*} to player
set {page2::*} to elements from 11 to 20 of {top players::*}
broadcast the 1st element in {queue}
broadcast the first 3 elements in {queue}
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | enchant prepare, enchant |
| Return Type: | Item Type |
It can be modified, but enchantments will still be applied in the enchant event.
Examples:
set the enchanted item to a diamond chestplate
on enchant prepare:
set the enchant item to a wooden sword
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | enchant |
| Return Type: | long |
This is number that was displayed in the enchantment table, not the actual number of levels removed.
Examples:
send "Cost: %the displayed enchanting cost%" to player
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | enchant prepare |
| Return Type: | long |
Examples:
send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | long |
Examples:
message "You have a sword of sharpness %level of sharpness of the player's tool% equipped"
| Patterns: | |
| Since: | 2.5 |
| Usable in events: | enchant prepare |
| Requirements: | 1.11 or newer |
| Return Type: | Enchantment Offer |
Examples:
send "Your enchantment offers are: %the enchantment offers%" to player
| Patterns: |
|
| Since: | 2.5 |
| Requirements: | 1.11 or newer |
| Return Type: | long |
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:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Block Data |
Custom attributes such as NBT or names do not transfer over.
Blocks, blockdatas and items are acceptable objects to change the carrying block.
Examples:
set the carried block of last spawned enderman to an oak log
set the carrying block data of {_enderman} to oak stairs[facing=north]
set the carried blockdata of {_enderman} to {_item}
clear the carried blockdata of {_enderman}
| Patterns: |
|
| Since: | 1.2.1, 2.5 (chunks), 2.10 (within) |
| Return Type: | Entity |
all players, all creepers in the player's world, or players in radius 100 of the player. Examples:
send "Psst!" to all players within 100 meters of the player
give a diamond to all ops
heal all tamed wolves in radius 2000 around {town center}
delete all monsters in chunk at player
size of all players within {_corner::1} and {_corner::2}}
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | Boolean |
Examples:
| Patterns: |
|
| Since: | 2.5, 2.6.1 (final attribute value) |
| Return Type: | Number |
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:
send "You are wounded!" to victim
set victim's attack speed attribute to 2
| Patterns: | |
| Since: | 2.7, 2.10 (maximum) |
| Return Type: | Timespan |
Examples:
send the max burn time of target
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | Offline Player |
Examples:
if the owner of last spawned wolf is player:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | integer |
When changing the size of a slime, its health is fully resorted and will have changes done to its max health, movement speed and attack damage.
The default minecraft size of a slime is anywhere between 0 and 2, with a maximum of 126.
The default minecraft size of a phantom is 0 with a maximum size of 64.
Examples:
set entity size of event-entity to 5
set name of event-entity to "King Slime Jorg"
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.20.2+ |
| Return Type: | Entity Snapshot |
Individual attributes of a snapshot cannot be modified or retrieved.
Examples:
set the max health of entity to 20
set the health of entity to 20
set {_snapshot} to the entity snapshot of entity
clear entity
spawn {_snapshot} at location(0, 0, 0)
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Spigot 1.19.2+ |
| Return Type: | Text |
Examples:
set {_sounds::*} to death sounds of (all mobs in radius 10 of player)
| Patterns: | |
| Since: | 2.11 |
| Return Type: | integer |
The maximum amount of entities an entity block storage can hold.
Examples:
set the maximum entity count of {_beehive} to 20
| Patterns: | |
| Since: | 2.11 |
| Return Type: | Object |
Unloaded entities or players that are offline (when using 'player from %uuid%') will return nothing.
Examples:
set {_offline player} to offline player from {_some uuid}
set {_entity} to entity from {_some uuid}
set {_world} to world from {_some uuid}
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Equippable Components |
Examples:
set the equipment slot of {_component} to helmet slot
clear the equippable component of {_item}
reset the equippable component of {_item}
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Entity Type |
Examples:
set {_component} to the equippable component of {_item}
clear the allowed entities of {_component}
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Text |
Examples:
set {_component} to the equippable component of {_item}
set the camera overlay of {_component} to "custom_overlay"
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Text |
Examples:
set {_component} to the equippable component of {_item}
set the equip sound of {_component} to "block.note_block.pling"
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Equipment Slot |
Examples:
set {_component} to the equippable component of {_item}
set the equipment slot of {_component} to boots slot
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Text |
Examples:
set {_component} to the equippable component of {_item}
set the equipped model id of {_component} to "custom_model"
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.6+ |
| Return Type: | Text |
Examples:
set {_component} to the equippable component of {_item}
set the shear sound of {_component} to "block.note_block.pling"
| Patterns: | |
| Since: | 2.12 |
| Return Type: | Item |
Examples:
| Patterns: | |
| Since: | 2.12 |
| Return Type: | Object |
Examples:
hide entity from all players except {_player}
set {_items::*} to a copper ingot, an iron ingot and a gold ingot
set {_except::*} to {_items::*} excluding copper ingot
| Patterns: |
|
| Since: | 2.1, 2.5.3 (block break event), 2.7 (experience change event), 2.10 (breeding, fishing) |
| Usable in events: | experience spawn, break / mine, experience change, entity breeding |
| Return Type: | Experience |
Examples:
add 5 to the spawned experience
on break of coal ore:
clear dropped experience
on break of diamond ore:
if tool of player = diamond pickaxe:
add 100 to dropped experience
on breed:
breeding father is a cow
set dropped experience to 10
on fish catch:
add 70 to dropped experience
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Experience Cooldown Change Reason |
Examples:
if xp cooldown change reason is plugin:
#Changed by a plugin
else if xp cooldown change reason is orb pickup:
#Changed by picking up xp orb
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Timespan |
Experience cooldown is how long until a player can pick up another orb of experience.
The cooldown of a player must be 0 to pick up another orb of experience.
Examples:
set the xp pickup cooldown of player to 1 hour
if exp collection cooldown of player >= 10 minutes:
clear the experience pickup cooldown of player
| Patterns: |
|
| Since: | 2.5, 2.8.6 (modify blocks) |
| Usable in events: | explode |
| Return Type: | Block |
Examples:
loop exploded blocks:
add loop-block to {exploded::blocks::*}
on explode:
loop exploded blocks:
if loop-block is grass:
remove loop-block from exploded blocks
on explode:
clear exploded blocks
on explode:
set exploded blocks to blocks in radius 10 around event-entity
on explode:
add blocks above event-entity to exploded blocks
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | explosion |
| Return Type: | Number |
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:
set the explosion's block yield to 10%
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | explosion prime |
| Return Type: | Number |
When changing the yield, values less than 0 will be ignored.
Read this wiki page for more information
Examples:
set the yield of the explosion to 10
| Patterns: | |
| Since: | 2.5, 2.11 (ghasts) |
| Return Type: | Number |
Read this wiki page for more information.
The yield of ghasts can only be set to between 0 and 127.
Examples:
set the explosive yield of the event-entity to 10
| Patterns: |
|
| Since: | 1.4 |
| Return Type: | Direction |
Examples:
loop blocks from the block below the player in the horizontal facing of the player:
set loop-block to cobblestone
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | block fertilize |
| Requirements: | Minecraft 1.13 or newer |
| Return Type: | Block |
Examples:
| Patterns: | |
| Since: | 2.2-dev36, 2.10 (parenthesis pattern) |
| Return Type: | Object |
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:
loop (all blocks in radius 5 of player) where [block input is not air]:
| Patterns: |
|
| Since: | 2.4 |
| Return Type: | Firework Effect |
Examples:
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | Slot |
Examples:
if the first empty slot in player's inventory is not set:
message "No empty slot available in your inventory!" to player
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
| Return Type: | float |
The angle is in degrees, with 0 being positive Z, 90 being negative X, 180 being negative Z, and 270 being positive X.
By default, returns a value between 0 and 360 degrees.
Examples:
if any:
maximum fishing approach angle is bigger than 300.5 degrees
min fishing approach angle is smaller than 59.5 degrees
then:
cancel event
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
| Requirements: | Minecraft 1.20.6 |
| Return Type: | Timespan |
May return a timespan of 0 seconds. If modifying the value, it should be at least 1 tick.
Examples:
set fishing bite time to 5 seconds
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
| Return Type: | Entity |
Examples:
wait a second
teleport player to fishing hook
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
| Return Type: | Timespan |
Default minimum value is 5 seconds and maximum is 30 seconds, before lure is applied.
Examples:
set min fish waiting time to 10 seconds
set max fishing waiting time to 20 seconds
| Patterns: | |
| Since: | 2.2-dev31, 2.7 (support variables in format) |
| Return Type: | Text |
Examples:
trigger:
send "Full date: %now formatted human-readable%" to sender
send "Short date: %now formatted as "yyyy-MM-dd"%" to sender
| Patterns: | |
| Since: | 1.1 |
| Return Type: | Object |
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:
former world was "world_nether" # or 'world was'
world will be "world" # or 'world after the event is'
on tool change:
past tool is an axe
the tool after the event will be air
on weather change:
set {weather::%world%::old} to past weather
set {weather::%world%::current} to the new weather
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | double |
Examples:
send action bar "Memory left: %free memory%/%max memory%MB" to player
wait 5 ticks
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Function |
Examples:
run {_function} with arguments 13 and true
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | smelt, fuel burn, smelting start, furnace extract |
| Return Type: | Item |
Only 'smelting item' can be changed.
Examples:
broadcast smelted item
# Or 'result'
on furnace extract:
broadcast extracted item
on fuel burn:
broadcast burned fuel
on smelting start:
broadcast smelting item
clear smelting item
| Patterns: | |
| Since: | 1.0, 2.8.0 (syntax rework) |
| Usable in events: | smelt, fuel burn |
| Return Type: | Slot |
Examples:
set the block's ore slot to 64 iron ore
clear the result slot of the block
on smelt:
if the fuel slot is charcoal:
add 5 seconds to the burn time
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Timespan |
- cook time: The amount of time an item has been smelting for.
- total cook time: The amount of time required to finish smelting an item.
- burn time: The amount of time left for the current fuel until consumption of another fuel item.
Examples:
set the total cooking time of {_block} to 50
set the fuel burning time of {_block} to 100
on smelt:
if the fuel slot is charcoal:
add 5 seconds to the fuel burn time
| Patterns: | |
| Since: | 2.5 |
| Return Type: | Gamerule Value |
Examples:
| Patterns: |
|
| Since: | 2.2-dev21 |
| Return Type: | Boolean |
Examples:
| Patterns: |
|
| Since: | 2.2-dev35 |
| Requirements: | Vault, a permission plugin that supports Vault |
| Return Type: | Text |
If you have LuckPerms, ensure you have vault integration enabled in the luck perms configurations.
Examples:
broadcast "%group of player%" # this is the player's primary group
broadcast "%groups of player%" # this is all of the player's groups
| Patterns: |
|
| Since: | 2.6.2 |
| Return Type: | Entity |
Examples:
if item of hanging entity is diamond pickaxe:
cancel event
if hanging remover is a player:
send "You can't break that item frame!" to hanging remover
| Patterns: |
|
| Since: | 2.0, 2.2-dev32 (SHA-256 algorithm), 2.12 (SHA-384, SHA-512) |
| Return Type: | Text |
These hashing algorithms are not suitable for hashing passwords.
If handling passwords, use a hashing algorithm specifically designed for passwords.
MD5 is deprecated and may be removed in a future release. It is provided mostly for backwards compatibility, as it is outdated and not secure.
SHA is more secure, but is not suitable for hashing passwords (even with salting).
When hashing data, you must specify algorithms that will be used for security reasons!
Please note that a hash cannot be reversed under normal circumstances. You will not be able to get original value from a hash with Skript.
Examples:
| Patterns: |
|
| Since: | 2.7 |
| Usable in events: | Egg Throw |
| Return Type: | Entity Type |
Examples:
set the hatching entity type to a primed tnt
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Location |
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 in front of the player's eyes to glass
loop blocks in front of the player's head:
| Patterns: |
|
| Since: | 2.5.1 |
| Usable in events: | heal |
| Return Type: | double |
Examples:
increase the heal amount by 2
remove 0.5 from the healing amount
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | heal |
| Return Type: | Heal Reason |
Examples:
heal reason is satiated
send "You ate enough food and gained full health back!"
| Patterns: |
|
| Since: | 1.0 |
| Usable in events: | damage |
| Return Type: | Number |
Examples:
| Patterns: | |
| Since: | 2.3 |
| Return Type: | Player |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | integer |
The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse).
The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
Examples:
add {_i} to domestication level of {_horse}
if domestication level of {_horse} >= max domestication level of {_horse}:
tame {_horse}
set tamer of {_horse} to {_p}
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | long |
Examples:
send "You clicked the hotbar button %hotbar button%!"
| Patterns: | |
| Since: | 2.2-dev36 |
| Return Type: | 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:
set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left
on item held change:
if the selected hotbar slot was a diamond:
set the currently selected hotbar slot to slot 5 of player
| Patterns: |
|
| Since: | 2.3 |
| Usable in events: | server list ping |
| Return Type: | Text |
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:
clear the hover list
add "&aWelcome to the &6Minecraft &aserver!" to the hover list
add "" to the hover list # A blank line
add "&cThere are &6%online players count% &conline players!" to the hover list
| Patterns: | |
| Since: | 1.4, 2.2-dev26 (when used in connect event), 2.3 (when used in server list ping event) |
| Return Type: | Text |
Examples:
broadcast "Banned the IP %IP of player%"
on connect:
log "[%now%] %player% (%ip%) is connected to the server."
on server list ping:
send "%IP-address%" to the console
| Patterns: | |
| Since: | 2.4 (indices), 2.6.1 (sorting) |
| Return Type: | Text |
To sort the indices, all objects in the list must be comparable;
Otherwise, this expression will just return the unsorted indices.
Examples:
broadcast "%indices of {l::*}%" # result is 1, 2 and 3", "
set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first
| Patterns: | |
| Since: | 2.1, 2.12 (indices, positions of list) |
| Return Type: | Object |
Using 'indices/positions of %objects% in %objects%', you can get the indices or positions of a list where the value at that index is the provided value. Indices are only supported for keyed expressions (e.g. variable lists) and will return the string indices of the given value. Positions can be used with any list and will return the numerical position of the value in the list, counting up from 1. Additionally, nothing is returned if the value is not found in the list.
Whether string comparison is case-sensitive or not can be configured in Skript's config file.
Examples:
if {_s} contains "abc":
set {_s} to the first (position of "abc" in {_s} + 3) characters of {_s}
# removes everything after the first "abc" from {_s}
set {_list::*} to 1, 2, 3, 1, 2, 3
set {_indices::*} to indices of the value 1 in {_list::*}
# {_indices::*} is now "1" and "4"
set {_indices::*} to all indices of the value 2 in {_list::*}
# {_indices::*} is now "2" and "5"
set {_positions::*} to all positions of the value 3 in {_list::*}
# {_positions::*} is now 3 and 6
set {_otherlist::bar} to 100
set {_otherlist::hello} to "hi"
set {_otherlist::burb} to 100
set {_otherlist::tud} to "hi"
set {_otherlist::foo} to 100
set {_indices::*} to the first index of the value 100 in {_otherlist::*}
# {_indices::*} is now "bar"
set {_indices::*} to the last index of the value 100 in {_otherlist::*}
# {_indices::*} is now "foo"
set {_positions::*} to all positions of the value 100 in {_otherlist::*}
# {_positions::*} is now 1, 3 and 5
set {_positions::*} to all positions of the value "hi" in {_otherlist::*}
# {_positions::*} is now 2 and 4
| Patterns: |
|
| Since: | 2.2-dev32d |
| Return Type: | double |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
| Usable in events: | Inventory Item Move |
| Return Type: | Inventory |
Examples:
holder of event-initiator-inventory is a chest
broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
| Patterns: |
|
| Since: | 2.2-dev36, 2.9.0 (input index) |
| Return Type: | Object |
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:
sort {_list::*} based on length of input index
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | Object |
Examples:
clear the player's inventory
remove 5 wool from the inventory of the clicked block
| Patterns: |
|
| Since: | 2.2-dev16 |
| Return Type: | Inventory Action |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
| Usable in events: | Inventory Close |
| Return Type: | Inventory Close Reasons |
Examples:
inventory close reason is teleport
send "Your inventory closed due to teleporting!" to player
| Patterns: |
|
| Since: | 2.2-dev34, 2.5 (slots) |
| Return Type: | Object |
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
Examples:
holder of player's top inventory
{_inventory}'s viewers
| Patterns: | |
| Since: | 2.2-dev24 |
| Return Type: | Slot |
Examples:
set slot 0 of player to 2 stones
remove 1 stone from slot 0 of player
add 2 stones to slot 0 of player
clear slot 1 of player
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | Boolean |
Examples:
| Patterns: |
|
| Since: | unknown (before 2.1) |
| Return Type: | Item |
Examples:
item is a clock
set the time to 6:00
| Patterns: |
|
| Since: | 2.2-dev24 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
| Return Type: | Item Component |
Examples:
| Patterns: |
|
| Since: | 2.8.0 2.12 (cooldown group) |
| Requirements: | MC 1.21.2 (cooldown group) |
| Return Type: | Timespan |
Examples:
set item cooldown of player's tool for player to 1 minute
set item cooldown of stone and grass for all players to 20 seconds
reset item cooldown of cobblestone and dirt for all players
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Item Display Transforms |
Examples:
set the item transform of the last spawned item display to no transform # Reset to default
| Patterns: |
|
| Since: | 2.2-dev36 |
| Return Type: | Enchantment Type |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Item Flag |
Examples:
add hide potion effects to item flags of player's held item
remove hide enchants from item flags of {legendary sword}
| Patterns: | |
| Since: | 2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles), 2.10 (item displays) |
| Return Type: | Slot |
For item frames, the item inside the frame is returned.
For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item.
Other entities do not have items associated with them.
Examples:
set the item inside of event-entity to a diamond sword named "Example"
| Patterns: |
|
| Since: | 2.5 2.12 (boolean/string/color support) |
| Requirements: | Minecraft 1.21.4+ (boolean/string/color support) |
| Return Type: | Item Type |
Examples:
set slot 1 of inventory of player to wooden hoe with custom model data 357
give player a diamond hoe with custom model data 2, true, true, "scythe", and rgb(0,0,100)
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Spigot 1.20.5+ |
| Return Type: | Item Type |
Examples:
set {_item without glint} to diamond without enchantment glint
| Patterns: |
|
| Since: | 2.10, 2.11 (all itemflags) |
| Return Type: | Item Type |
Examples:
set {_item} to player's tool with item flag hide additional tooltip
give player torch with hide placed on item flag
set {_item} to diamond sword with all item flags
| Patterns: | |
| Since: | 2.3 |
| Return Type: | Item Type |
If multiple strings are passed, each of them will be a separate line in the lore.
Examples:
give {_test} to player
| Patterns: |
|
| Since: | 2.11 |
| Requirements: | Minecraft 1.20.5+ |
| Return Type: | Item Type |
If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it.
If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
set {_item without entire tooltip} to diamond without entire tooltip
| Patterns: |
|
| Since: | 1.0 pre-5 |
| Return Type: | Item Type |
Examples:
block contains loop-item
message "Theres at least one %loop-item% in this block"
drop all blocks at the player # drops one of every block at the player
| Patterns: |
|
| Since: | 2.0, 2.8.0 (specific types of items) |
| Return Type: | Slot |
Please note that the positions of the items in the inventory are not saved, only their order is preserved.
Examples:
loop-item is enchanted
remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory
| Patterns: |
|
| Since: | 2.1, 2.5.2 (regex support), 2.7 (case sensitivity), 2.10 (without trailing string) |
| Return Type: | Text |
Examples:
set {_s::*} to the string argument split at ","
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | Object |
For example, when setting a list variable or passing an expression to a function.
Examples:
set {_first::bar} to "value2"
set {_second::*} to keyed {_first::*}
# {_second::foo} is "value1" and {_second::bar} is "value2"
function indices(objects: objects) returns strings:
return indices of {_objects::*}
on load:
set {_list::foo} to "value1"
set {_list::bar} to "value2"
set {_list::baz} to "value3"
broadcast indices({_list::*}) # "1", "2", "3"
broadcast indices(keyed {_list::*}) # "foo", "bar", "baz"
function plusOne(numbers: numbers) returns numbers:
loop {_numbers::*}:
set {_numbers::%loop-index%} to loop-value + 1
return {_numbers::*}
on load:
set {_numbers::foo} to 1
set {_numbers::bar} to 2
set {_numbers::baz} to 3
set {_result::*} to keyed plusOne(keyed {_numbers::*})
# {_result::foo} is 2, {_result::bar} is 3, {_result::baz} is 4
| Patterns: | |
| Since: | 2.3 |
| Return Type: | Text |
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:
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | Text |
Examples:
set worldborder center of {_border} to location(0, 0, NaN value)
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
| Patterns: |
|
| Since: | 2.5.1 |
| Return Type: | Number |
Examples:
| Patterns: |
|
| Since: | 2.2-Fixes-V10 |
| Return Type: | Damage Cause |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Location |
Can also be set, reset, and deleted if the player is online.
Examples:
teleport player to last death location of (random element out of all players)
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | Server Icon |
Examples:
| Patterns: | |
| Since: | 2.4 |
| Return Type: | Resource Pack State |
Examples:
| Patterns: |
|
| Since: | 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), 2.7 (struck lightning, firework) |
| Return Type: | Entity |
Examples:
set {healer::%spawned priest%} to true
shoot an arrow from the last spawned entity
ignite the shot projectile
drop a diamond sword
push last dropped item upwards
teleport player to last struck lightning
delete last launched firework
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | Date |
Examples:
trigger:
send "You have been online for %difference between player's last login and now%."
send "You first joined the server %difference between player's first login and now% ago."
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | Entity |
Examples:
| Patterns: | |
| Since: | unknown (before 2.1) |
| Usable in events: | level change |
| Return Type: | long |
Examples:
set the player's level to 0
| Patterns: | |
| Since: | 2.0 |
| Usable in events: | level change |
| Return Type: | Number |
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:
on rightclick with a blaze rod:
player's level progress is larger than 0.2
shoot a fireball from the player
reduce the player's level progress by 0.2
every 2 seconds:
loop all players:
level progress of loop-player is smaller than 0.9:
increase level progress of the loop-player by 0.1
else:
set level progress of the loop-player to 0.99
on xp spawn:
cancel event
| Patterns: | |
| Since: | 1.3.4 |
| Return Type: | byte |
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:
every 5 seconds:
loop all players:
{vampire::%uuid of loop-player%} is true
sunlight level at the loop-player is greater than 10
ignite the loop-player for 5 seconds
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | Text |
Examples:
broadcast "This server uses Vault plugin!"
send "Plugins (%size of loaded plugins%): %plugins%" to player
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Location |
Examples:
set {_loc} to the location 1 meter above the player
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Location |
Examples:
set {_loc} to the location 1 meter above the player
| Patterns: | |
| Since: | Unknown |
| Return Type: | Location |
Please note that the location of an entity is at it's feet, use head location to get the location of the head.
Examples:
message "You home was set to %player's location% in %player's world%."
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | long |
Examples:
give player 1 stone
wait 5 ticks
if loop-counter > 30:
stop loop
loop {top-balances::*}:
if loop-iteration <= 10:
broadcast "#%loop-iteration% %loop-index% has $%loop-value%"
| Patterns: |
|
| Since: | 1.0, 2.8.0 (loop-counter), 2.10 (previous, next) |
| Return Type: | Object |
Examples:
loop 10 times:
message "%11 - loop-number%"
wait a second
# Generate a 10x10 floor made of randomly colored wool below the player
loop blocks from the block below the player to the block 10 east of the block below the player:
loop blocks from the loop-block to the block 10 north of the loop-block:
set loop-block-2 to any wool
loop {top-balances::*}:
loop-iteration <= 10
send "#%loop-iteration% %loop-index% has $%loop-value%"
loop shuffled (integers between 0 and 8):
if all:
previous loop-value = 1
loop-value = 4
next loop-value = 8
then:
kill all players
| Patterns: |
|
| Since: | 2.7 |
| Requirements: | MC 1.16+ |
| Return Type: | Item |
Examples:
chance of %10
add 64 diamonds to loot
send "You hit the jackpot!!"
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Loot Context |
Examples:
broadcast loot context
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Location |
Examples:
set {_context} to a loot context at player:
if {_player} is in "world_nether":
set loot location to location of last spawned pig
send loot location of {_context} to player
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Loot Table |
Setting the loot table of a block will update the block state, and once opened will generate loot of the specified loot table. Please note that doing so may cause warnings in the console due to over-filling the chest.
Please note that resetting/deleting the loot table of an ENTITY will reset the entity's loot table to its default.
Examples:
# this will set the loot table of the entity to a ghast's loot table, thus dropping ghast tears and gunpowder
set loot table of event-block to "minecraft:chests/simple_dungeon"
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Loot Table |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Item |
Examples:
# this will set {_items::*} to the items that would be dropped from the simple dungeon loot table with the given loot context
give player loot items of entity's loot table with loot context {_context}
# this will give the player the items that the entity would drop with the given loot context
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Entity |
Examples:
set {_context} to a loot context at player:
set loot luck value to 10
set looter to player
set looted entity to last spawned pig
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Player |
Examples:
set {_context} to a loot context at player:
set loot luck value to 10
set looter to player
set looted entity to last spawned pig
| Patterns: |
|
| Since: | 2.1 |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Timespan |
Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
Examples:
send "%event-entity% has been in love for %love time of event-entity% more than you!" to player
| Patterns: | |
| Since: | 2.2-dev34, 2.9.0 (lowest solid block, 'non-air' option removed, additional syntax option) |
| Return Type: | Block |
Note that the y-coordinate of the location is not taken into account for this expression.
Examples:
set the highest solid block at the player's location to the lowest solid block at the player's location
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | float |
Examples:
set {_context} to a loot context at player:
set loot luck value to 10
set looter to player
set looted entity to last spawned pig
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | Text |
'default MOTD' returns the default MOTD always and can't be changed.
Examples:
set the motd to "Join now!"
| Patterns: |
|
| Since: | 2.5, 2.9.0 (change) |
| Requirements: | Minecraft 1.20.5+ (custom amount) |
| Return Type: | integer |
Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
Examples:
if max durability of player's tool is not 0: # Item is damageable
set max durability of player's tool to 5000
add 5 to max durability of player's tool
reset max durability of player's tool
delete max durability of player's tool
| Patterns: |
|
| Since: | 2.0 |
| Usable in events: | damage, death |
| Return Type: | Number |
Examples:
set the maximum health of the player to 100
spawn a giant
set the last spawned entity's max health to 1000
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Timespan |
Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
Examples:
broadcast max usage duration of player's tool
| Patterns: |
|
| Since: | 2.3, 2.7 (modify max real players) |
| Return Type: | integer |
'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
Examples:
set the max players count to (online players count + 1)
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | double |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | float |
Examples:
| Patterns: | |
| Since: | 2.7 |
| Return Type: | Timespan |
Examples:
send "you're about to freeze!" to the player
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | integer |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.1, 2.10 (changeable, inventories) |
| Requirements: | Spigot 1.20.5+ (changeable) |
| Return Type: | integer |
In 1.20.5+, the maximum stack size of items can be changed to any integer from 1 to 99, and stacked up to the maximum stack size of the inventory they're in.
Examples:
set the maximum stack size of inventory of all players to 16
add 8 to the maximum stack size of player's tool
reset the maximum stack size of {_gui}
| Patterns: |
|
| Since: | 2.1.1 |
| Return Type: | Player |
Examples:
!kick myself
!give a diamond axe to me
| Patterns: |
|
| Since: | 2.5.1 |
| Return Type: | long |
Modifying the repair amount will affect how much experience is given to the player after mending.
Examples:
set the mending repair amount to 100
| Patterns: |
|
| Since: | 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message), 2.9.0 (clear message), 2.10 (broadcasted message) |
| Usable in events: | chat, join, quit, death, broadcast |
| Return Type: | Text |
Examples:
player has permission "admin"
set message to "&c%message%"
on first join:
set join message to "Welcome %player% to our awesome server!"
on join:
player has played before
set join message to "Welcome back, %player%!"
on quit:
if {vanish::%player's uuid%} is set:
clear quit message
else:
set quit message to "%player% left this awesome server!"
on death:
set the death message to "%player% died!"
on broadcast:
set broadcast message to "&a[BROADCAST] %broadcast message%"
| Patterns: |
|
| Since: | 2.2-dev36, 2.10 (add, remove) |
| Return Type: | Object |
Examples:
broadcast "%metadata value ""healer"" of player%"
clear metadata value "healer" of player
| Patterns: | |
| Since: | 2.6.1 |
| Return Type: | Location |
Examples:
executable by: players
trigger:
teleport player to the center of player's location
send "You're no longer stuck."
| Patterns: | |
| Since: | 2.13 |
| Return Type: | Object |
Examples:
set {_centerBlock} to the block at {_center}
set {_midpoint} to the mid-point of vector(20, 10, 5) and vector(3, 6, 9)
| Patterns: | |
| Since: | 2.5.1 |
| Return Type: | Vector |
Examples:
set derailed velocity of event-entity to vector 2, 10, 2
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | double |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | float |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | integer |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.0, 2.5 (offline players) |
| Requirements: | Vault, an economy plugin that supports Vault |
| Return Type: | Money |
Examples:
remove 20$ from the player's balance # replace '$' by whatever currency you use
add 200 to the player's account # or omit the currency altogether
| Patterns: | |
| Since: | 2.7 |
| Return Type: | Moon Phase |
Examples:
send "Watch for the wolves!"
| Patterns: |
|
| Since: | 2.2-dev27 |
| Return Type: | Block |
Examples:
| Patterns: |
|
| Since: | 2.2-dev32d |
| Return Type: | double |
NaN is deliberately not equal to any other number, including itself.
Examples:
if isNaN({_number}) is true:
| Patterns: |
|
| Since: | before 2.1 2.2-dev20 (inventory name) 2.4 (non-living entity support, changeable inventory name) 2.7 (worlds) |
| Return Type: | Text |
Players:
Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
Entities:
Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
Items:
Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories:
Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
Gamerules:
Name: The name of the gamerule. Cannot be changed.
Worlds:
Name: The name of the world. Cannot be changed.
Scripts:
Name: The name of a script, excluding its file extension.
Examples:
player has permission "name.red"
set the player's display name to "<red>[admin] <gold>%name of player%"
set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"
| Patterns: |
|
| Since: | 2.0, 2.2-dev34 (inventories) |
| Return Type: | Object |
set name of <item/inventory> to <text>. Examples:
set tool of player to the player's tool named "<gold>Wand"
set the name of the player's tool to "<gold>Wand"
open hopper inventory named "Magic Hopper" to player
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | Entity |
Examples:
teleport player to the nearest cow relative to player
teleport player to the nearest entity relative to player
on click:
kill nearest pig
| Patterns: |
|
| Since: | 2.2-dev32d |
| Return Type: | double |
Examples:
| Patterns: |
|
| Since: | 2.5 |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.5, 2.11 (deprecated) |
| Return Type: | long |
Examples:
set victim's invulnerability ticks to 20 #Victim will not take damage for the next second
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Timespan |
Examples:
set victim's invulnerability time to 20 ticks #Victim will not take damage for the next second
if the no damage timespan of {_entity} is 0 seconds:
set the invincibility time span of {_entity} to 1 minute
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Node |
Nodes in Skript configs are written in the format `key: value`.
Section nodes can contain other nodes.
Examples:
if text value of {_node} is "french":
broadcast "Bonjour!"
set {_script} to the current script
loop nodes of the current script:
broadcast name of loop-value
| Patterns: |
|
| Since: | 1.4 |
| Return Type: | Date |
Examples:
| Patterns: | |
| Since: | 2.5 |
| Return Type: | long |
Examples:
on chat:
if number of uppercase chars in message / length of message > 0.5
cancel event
send "<red>Your message has to many caps!" to player
| Patterns: | |
| Since: | 1.4.6 (integers & numbers), 2.5.1 (decimals) |
| Return Type: | Number |
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 integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5
loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4
| Patterns: |
|
| Since: | 2.2-dev35 |
| Return Type: | Offline Player |
Examples:
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | long |
real online player count always return the real count of online players and can't be changed. Examples:
# This will make the max players count 5 if there are 4 players online.
set the fake max players count to (online player count + 1)
| Patterns: | |
| Since: | 2.2-dev24, 2.2-dev35 (Just 'current inventory' works in player events) |
| Return Type: | Inventory |
If no inventory is open, it returns the own player's crafting inventory.
Examples:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Gene |
Examples:
set the main gene of last spawned panda to playful
| Patterns: | |
| Since: | 2.0 |
| Return Type: | Object |
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:
on chat:
set {var::*} to message parsed as "buying %items% for %money%"
if parse error is set:
message "%parse error%"
else if {var::*} is set:
cancel event
remove {var::2} from the player's balance
give {var::1::*} to the player
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Text |
Examples:
if {var} is not set:
parse error is set:
message "<red>Line 1 is invalid: %last parse error%"
else:
message "<red>Please put an integer on line 1!"
| Patterns: | |
| Since: | 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+) |
| Return Type: | Entity |
For 1.11.2 and above, it returns a list of passengers and you can use all changers in it.
See also: vehicle
Examples:
passenger of the minecart is a creeper or a cow
the saddled pig's passenger is a player
#for 1.11.2+
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat
| Patterns: | |
| Since: | 2.8.0 |
| Return Type: | Number |
Examples:
set damage to 125 percent of damage
set {_result} to {_percent} percent of 999
set {_result::*} to 10% of {_numbers::*}
set experience to 50% of player's total experience
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | double |
Examples:
| Patterns: | |
| Since: | 2.2-dev36 |
| Return Type: | long |
Examples:
trigger:
send "%arg-1%'s ping is %arg-1's ping%"
| Patterns: |
|
| Since: | 2.6 |
| Return Type: | Item Type |
Examples:
send "You are holding a plain diamond!"
| Patterns: | |
| Since: | 2.10 |
| Requirements: | Spigot 1.19+ |
| Return Type: | Text |
This expression will not return anything due to Bukkit limitations.
Examples:
remove "text" from {_p}'s chat completions
clear player's chat completions
| Patterns: | |
| Since: | 2.6.2 |
| Return Type: | integer |
Examples:
trigger:
send "Protocol version of %arg-1%: %protocol version of arg-1%"
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Item Type |
Examples:
set the block at the entity to the entity's skull
| Patterns: |
|
| Since: | 2.4 |
| Usable in events: | portal_create |
| Return Type: | Block |
Examples:
loop portal blocks:
broadcast "%loop-block% is part of a portal!"
| Patterns: | |
| Since: | 2.8.0 |
| Return Type: | Timespan |
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:
wait 1 tick
set portal cooldown of event-entity to 5 seconds
| Patterns: |
|
| Since: | 2.5.2 |
| Return Type: | Potion Effect |
to tipped arrows/lingering potions, Minecraft reduces the timespan.
Examples:
add {_p} to potion effects of player's tool
add {_p} to potion effects of target entity
add potion effect of speed 1 to potion effects of player
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | integer |
Examples:
| Patterns: |
|
| Since: | 2.5.2 |
| Return Type: | Potion Effect |
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:
clear all the potion effects of player
clear all the potion effects of player's tool
add potion effects of player to potion effects of player's tool
add speed to potion effects of target entity
remove speed and night vision from potion effects of player
| Patterns: | |
| Since: | 2.0, 2.10 (delete) |
| Requirements: | Vault, a chat plugin that supports Vault |
| Return Type: | Text |
Examples:
cancel event
broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world
set the player's prefix to "[<red>Admin<reset>] "
clear player's prefix
| Patterns: |
|
| Since: | 2.5.1 |
| Return Type: | Boolean |
Examples:
event-projectile is an arrow
set projectile critical mode of event-projectile to true
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | float |
Examples:
set the velocity of shooter to vector(0,1,0) * projectile force
| Patterns: |
|
| Since: | 2.3 |
| Usable in events: | server list ping |
| Return Type: | long |
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:
set the version string to "<light green>Version: <orange>%minecraft version%"
set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always
| Patterns: |
|
| Since: | 2.10 (experimental) |
| Return Type: | Queue |
using queues experimental feature flag to be enabled.Creates a new queue. A queue is a set of elements that can have things removed from the start and added to the end.
Any value can be added to a queue. Adding a non-existent value (e.g. `{variable that isn't set}`) will have no effect. This means that removing an element from the queue will always return a value unless the queue is empty.
Requesting an element from a queue (e.g. `the 1st element of {queue}`) also removes it from the queue.
Examples:
add "hello" and "there" to {queue}
broadcast the first element of {queue} # hello
broadcast the first element of {queue} # there
# queue is now empty
set {queue} to a new queue of "hello" and "there"
broadcast the last element of {queue} # removes 'there'
add "world" to {queue}
broadcast the first 2 elements of {queue} # removes 'hello', 'world'
| Patterns: | |
| Since: | 2.10 (experimental) |
| Return Type: | Object |
using queues experimental feature flag to be enabled.The first or last element in a queue. Asking for this does not remove the element from the queue.
This is designed for use with the add changer: to add or remove elements from the start or the end of the queue.
Examples:
add "hello" to {queue}
add "foo" to the start of {queue}
broadcast the first element of {queue} # foo
broadcast the first element of {queue} # hello
# queue is now empty
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Quit Reason |
Examples:
quit reason was kicked
player is banned
clear {server::player::%uuid of player%::*}
| Patterns: | |
| Since: | 2.8.0 |
| Return Type: | Text |
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:
send 3 random alphanumeric characters between "0" and "z"
| Patterns: | |
| Since: | 1.4, 2.10 (Multiple random numbers) |
| Return Type: | Number |
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:
send "You rolled a %random integer from 1 to 6%!" to the player
set {_chances::*} to 5 random integers between 5 and 96
set {_decimals::*} to 3 random numbers between 2.7 and -1.5
| Patterns: |
|
| Since: | 2.5.1, 2.11 (return UUIDs) |
| Return Type: | UUID |
Examples:
| Patterns: |
|
| Since: | unknown (2.2) |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
| Usable in events: | ready arrow |
| Return Type: | Item |
Examples:
selected bow's name is "Spectral Bow"
if selected arrow is not a spectral arrow:
cancel event
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | long |
Returns the recursive size of the list with sublists included, e.g.
{list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6
Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list)
Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!
Examples:
| Patterns: | |
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
| Return Type: | Offline Player |
This expression requires a supported regions plugin to be installed.
Examples:
message "You're entering %region% whose owners are %owners of region%"
| Patterns: | |
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
| Return Type: | Region |
This expression requires a supported regions plugin to be installed.
Examples:
line 1 of the clicked block is "[region info]"
set {_regions::*} to regions at the clicked block
if {_regions::*} is empty:
message "No regions exist at this sign."
else:
message "Regions containing this sign: <gold>%{_regions::*}%<r>."
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Timespan |
Examples:
send "hurry, get to the surface!" to the player
| Patterns: | |
| Since: | 2.9.0 |
| Return Type: | Timespan |
A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
Examples:
| Patterns: |
|
| Since: | 2.2-dev35 |
| Return Type: | Location |
Examples:
set respawn location to {example::spawn}
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Object |
If the thing is expected to return multiple values, use 'results' instead of 'result'.
Examples:
set {_result} to the result of {_function}
set {_list::*} to the results of {_function}
set {_result} to the result of {_function} with arguments 13 and true
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Object |
Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis.
Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once.
Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis.
The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
set {_new} to {_vector} rotated around vector(1, 1, 1) by 45
set {_new} to {_quaternion} rotated by x 45, y 90, z 135
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Object |
All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
Examples:
send rotation axis of {_quaternion} # 1, 2, 3
send rotation angle of {_quaternion} # 45
set rotation angle of {_quaternion} to 135
set rotation axis of {_quaternion} to vector(0, 1, 0)
| Patterns: | |
| Since: | 2.0 |
| Return Type: | long |
Examples:
set line 1 of the block to rounded "%(1.5 * player's level)%"
add rounded down argument to the player's health
| Patterns: | |
| Since: | 2.2-Fixes-v10, 2.2-dev35 (fully modifiable), 2.6.2 (syntax pattern changed) |
| Return Type: | Number |
Examples:
| Patterns: | |
| Since: | 2.3 |
| Return Type: | Text |
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:
if the spawn reason is mob spawner:
add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster:
if the attacker is a player:
if the victim doesn't have the scoreboard tag "spawned by a spawner":
add 1$ to attacker's balance
| Patterns: | |
| Since: | 2.0 |
| Return Type: | Script |
If the script is enabled or disabled (or reloaded) this reference will become invalid.
Therefore, it is recommended to obtain a script reference when needed.
Examples:
broadcast "Loaded %the current script%"
on script load:
set {running::%script%} to true
on script unload:
set {running::%script%} to false
set {script} to the script named "weather.sk"
loop the scripts in directory "quests/":
enable loop-value
| Patterns: | |
| Since: | 2.7 |
| Return Type: | integer |
Examples:
type of block is sea pickle
send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!"
send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!"
send "It had to have contained at least %event-block's minimum sea pickle count% pickles!"
cancel event
set event-block's sea pickle count to event-block's maximum sea pickle count
send "This bad boy is going to hold so many pickles now!!"
| Patterns: | |
| Since: | 2.10 |
| Return Type: | long |
Examples:
set loot table seed of entity to 123456789
| Patterns: |
|
| Since: | 2.8.0 |
| Usable in events: | send command list |
| Return Type: | Text |
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:
set command list to command list where [input does not contain ":"]
remove "help" from command list
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | Server Icon |
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:
set {server-icons::default} to the default server icon
| Patterns: |
|
| Since: | 1.3.7, 2.11 (entity shoot bow event) |
| Return Type: | Living Entity |
Examples:
| Patterns: | |
| Since: | 1.3 |
| Return Type: | Text |
Examples:
line 2 of the clicked block is "[Heal]":
heal the player
set line 3 to "%player%"
| Patterns: | |
| Since: | 2.11 |
| Return Type: | integer |
Simulation distance is the minimum distance in chunks for entities to tick.
Simulation distance is capped to the current view distance of the world or player.
The view distance is capped between 2 and 32 chunks.
Examples:
add 50 to the simulation distance of world "world"
reset the simulation distance of player
clear the simulation distance of world "world"
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | double |
The size can not be smaller than 1.
Examples:
| Patterns: |
|
| Since: | 2.9.0, 2.10 (of items) |
| Return Type: | Offline Player |
Examples:
set skull owner of {_block} to "Njol" parsed as offlineplayer
set head owner of player's tool to {_player}
| Patterns: | |
| Since: | 2.2-dev35, 2.8.0 (raw index) |
| Return Type: | long |
Raw index of slot is unique for the view, see Minecraft Wiki
Examples:
send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory
if raw index of event-slot > 27: # outside custom inventory
cancel event
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.20.2+, Minecraft 1.20.5+ (comparisons) |
| Return Type: | Entity Snapshot |
Examples:
broadcast the spawn egg entity of {_item}
spawn a pig at location(0,0,0):
set the max health of entity to 20
set the health of entity to 20
set {_snapshot} to the entity snapshot of entity
clear entity
set the spawn egg entity of {_item} to {_snapshot}
if the spawn egg entity of {_item} is {_snapshot}: # Minecraft 1.20.5+
set the spawn egg entity of {_item} to (random element out of all entities)
set the spawn egg entity of {_item} to a zombie
| Patterns: |
|
| Since: | 2.3 |
| Return Type: | Spawn Reason |
Examples:
spawn reason is reinforcements or breeding
cancel event
| Patterns: | |
| Since: | 2.4, 2.9.2 (trial spawner), 2.12 (delete) |
| Requirements: | Minecraft 1.20.0+ (delete) |
| Return Type: | Entity Type |
Examples:
if event-block is a spawner:
send "Spawner's type if %spawner type of event-block%" to player
set the creature type of {_spawner} to a trader llama
reset {_spawner}'s entity type # Pig
clear the spawner type of {_spawner} # Minecraft 1.20.0+
| Patterns: | |
| Since: | 2.4-alpha4, 2.7 (Paper Spectator Event) |
| Return Type: | Entity |
Examples:
message "&c%spectator target% currently has %{game::kills::%spectator target%}% kills!" to the player
on player stop spectating:
past spectator target was a zombie
set spectator target to the nearest skeleton
| Patterns: | |
| Since: | unknown (before 2.1) |
| Return Type: | Number |
Please note that changing a player's speed will change their FOV just like potions do.
Examples:
increase the argument's fly speed by 0.1
| Patterns: | |
| Since: | 2.11 |
| Return Type: | Object |
The retrieved color codes of the string will be formatted with the color symbol.
Examples:
set {_color} to the first string color code of "&aGoodbye!"
send "%{_color}%Howdy!" to all players
| Patterns: |
|
| Since: | 2.1, 2.5.2 (character at, multiple strings support) |
| Return Type: | Text |
Examples:
message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console
set {_characters::*} to characters at 1, 2 and 7 in player's display name
send the last character of all players' names
| Patterns: |
|
| Since: | 2.2-dev36 |
| Return Type: | Number |
Examples:
| Patterns: | |
| Since: | before 2.1 |
| Return Type: | Text |
Examples:
player has permission "name.red"
set the player's tab list name to "<green>%player's name%"
| Patterns: | |
| Since: | 2.13 |
| Return Type: | Player |
`delete` will remove all the online players from the tab list.
`reset` will reset the tab list to the default state, which makes all players visible again.
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Minecraft Tag |
Tags are composed of a value and an optional namespace: "minecraft:oak_logs".
If you omit the namespace, one will be provided for you, depending on what kind of tag you're using. For example, `tag "doors"` will be the tag "minecraft:doors", while `paper tag "doors"` will be "paper:doors".
`minecraft tag` will search through the vanilla tags, `datapack tag` will search for datapack-provided tags (a namespace is required here!), `paper tag` will search for Paper's custom tags if you are running Paper, and `custom tag` will look in the "skript" namespace for custom tags you've registered.
You can also filter by tag types using "item", "block", or "entity".
Examples:
paper tag "doors" # paper:doors
tag "skript:custom_dirt" # skript:custom_dirt
custom tag "dirt" # skript:dirt
datapack block tag "dirt" # minecraft:dirt
datapack tag "my_pack:custom_dirt" # my_pack:custom_dirt
tag "minecraft:mineable/pickaxe" # minecraft:mineable/pickaxe
custom item tag "blood_magic_sk/can_sacrifice_with" # skript:blood_magic_sk/can_sacrifice_with
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Text |
Examples:
if the key of {_my-tag} is "minecraft:stone":
return true
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Object |
For item and block tags, this will return items. For entity tags, it will return entity datas (a creeper, a zombie).
Examples:
broadcast (first element of player's tool's block tags)'s tag contents
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Minecraft Tag |
`minecraft tag` will return only the vanilla tags, `datapack tag` will return only datapack-provided tags, `paper tag` will return only Paper's custom tags (if you are running Paper), and `custom tag` will look in the "skript" namespace for custom tags you've registered.
You can also filter by tag types using "item", "block", or "entity".
Examples:
send true if paper item tags of target block contains paper tag "doors"
broadcast the block tags of player's tool
| Patterns: |
|
| Since: | 2.2-dev25 |
| Return Type: | Player |
Examples:
if the tamer is a player:
send "someone tamed something!" to console
| Patterns: |
|
| Since: | 1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks, ray size) |
| Return Type: | Entity |
For mobs and experience orbs this is the entity they are attacking/following (if any).
The 'ray size' and 'ignoring blocks' options are only valid for players' targets.
The 'ray size' option effectively increases the area around the crosshair an entity can be in. It does so by expanding the hitboxes of entities by the given amount. Display entities have a hit box of 0, so using the 'ray size' option can be helpful when targeting them.
May grab entities in unloaded chunks.
Examples:
if entity's target is a player:
send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-less
delete targeted entity of player # for players it will delete the target
delete target of last spawned zombie # for entities it will make them target-less
| Patterns: |
|
| Since: | 1.0, 2.9.0 (actual/exact) |
| Return Type: | Block |
The actual target block will regard the actual hit box of the block.
Examples:
set target block of player to oak_stairs[waterlogged=true]
break target block of player using player's tool
give player 1 of type of target block
teleport player to location above target block
kill all entities in radius 3 around target block of player
set {_block} to actual target block of player
break actual target block of player
| Patterns: |
|
| Since: | 2.2-dev35 |
| Return Type: | Teleport Cause |
Examples:
teleport cause is nether portal, end portal or end gateway
cancel event
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Display Text Alignment |
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | integer |
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | byte |
Values are between -127 and 127. The value of 127 represents it being completely opaque.
Examples:
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Text |
Note that currently you can only use Skript chat codes when running Paper.
Examples:
| Patterns: |
|
| Since: | 2.7 |
| Usable in events: | Egg Throw |
| Return Type: | Projectile |
Examples:
| Patterns: | |
| Since: | 1.0 |
| Return Type: | Time |
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:
add 2 minecraft hours to time of world "world"
add 54 real seconds to time of world "world" # approximately 1 minecraft hour
| Patterns: | |
| Since: | 2.13 |
| Return Type: | Timespan |
Examples:
on right click on entity:
send "%entity% has lived for %time lived of entity%" to player
| Patterns: |
|
| Since: | 2.5, 2.7 (offline players) |
| Requirements: | MC 1.15+ (offline players) |
| Return Type: | Timespan |
Using this expression on offline players on Minecraft 1.14 and below will return nothing
<none>. Examples:
if player's time played is greater than 10 minutes:
give player a diamond sword
set player's time played to 0 seconds
set player's playtime to 0 seconds
| Patterns: | |
| Since: | 2.5, 2.10 (time until) |
| Return Type: | Timespan |
This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
Examples:
send "%time until {countdown::end}% until the game begins!" to player
| Patterns: |
|
| Since: | 2.9.0 |
| Return Type: | long |
Examples:
send "It has been %days of {_t}% day(s) since last payout."
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | Slot |
Examples:
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow
| Patterns: | |
| Since: | 2.7 |
| Return Type: | integer |
Adding to a player's experience will trigger Mending, but setting their experience will not.
Examples:
add 100 to player's experience
if player's total experience is greater than 100:
set player's total experience to 0
give player 1 diamond
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Transform Reason |
Examples:
transform reason is infection, drowned or frozen
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Object |
If the given expression returns a single value, the indices of the list will not change. If the expression returns multiple values, then then indices will be reset as a single index cannot contain multiple values.
Examples:
# {_a::*} is now 1, 2, 3, 4, 5, and 6
# get a list of the sizes of all clans without manually looping
set {_clan-sizes::*} to keyed {clans::*} transformed using [{clans::%input index%::size}]
# using the 'keyed' expression retains the indices of the clans list
| Patterns: |
|
| Since: | 1.4, 2.5.2 (potion effect), 2.7 (block datas), 2.10 (enchantment type) |
| Return Type: | Object |
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.
Types of enchantment types are enchantments.
Examples:
message "This is a %type of clicked entity%!"
| Patterns: |
|
| Since: | 2.1.2, 2.2 (offline players' uuids), 2.2-dev24 (other entities' uuids) |
| Return Type: | UUID |
Examples:
# who has played on this server at least once since this script has been added
on login:
if {uuid::%name of player%} exists:
{uuid::%name of player%} is not uuid of player
kick player due to "Someone with your name has played on this server before"
else:
set {uuid::%name of player%} to uuid of player
command /what-is-my-uuid:
trigger:
set {_uuid} to uuid of player
send "Your UUID is '%string within {_uuid}%'"
| Patterns: |
|
| Since: | 2.2-dev13b, 2.9.0 (breakable) |
| Return Type: | Item Type |
Examples:
give breakable {_weapon} to all players
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Unleash |
| Return Type: | Unleash Reason |
Examples:
broadcast "The leash was snapped in half."
| Patterns: |
|
| Since: | 2.10 (Nodes), 2.10 (Any) |
| Return Type: | Object |
The value is automatically converted to the specified type (e.g. text, number) where possible.
Examples:
broadcast the text value of {_node}
set {_node} to node "update check interval" in the skript config
broadcast text value of {_node}
# text value of {_node} = "12 hours" (text)
wait for {_node}'s timespan value
# timespan value of {_node} = 12 hours (duration)
| Patterns: | |
| Since: | 2.7 |
| Return Type: | Object |
Examples:
delete entity within {_entity} # This deletes the entity itself and not the value stored in the variable
set {_list::*} to "something", 10, "test" and a zombie
broadcast the strings within {_list::*} # "something", "test"
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Object |
The value is automatically converted to the specified type (e.g. text, number) where possible.
Examples:
broadcast the text value of {_node}
| Patterns: |
|
| Since: | 2.2-dev28, 2.10 (quaternions) |
| Return Type: | Number |
You cannot use the W component with vectors; it is for quaternions only.
Examples:
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
| Patterns: | |
| Since: | 2.2-dev28 |
| Return Type: | Location |
Examples:
set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90
set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Vector |
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 in direction of player
set {_v} to vector in horizontal direction of player
set {_v} to vector from facing of player
set {_v::*} to vectors from north, south, east, and west
| Patterns: | |
| Since: | 2.2-dev28 |
| Return Type: | Vector |
Examples:
set {_v} to cylindrical vector radius 1, yaw loop-value, height 2
set {_v} to cylindrical vector radius 1, yaw 90, height 2
| Patterns: | |
| Since: | 2.2-dev28 |
| Return Type: | Number |
Examples:
set {_v} to vector 1, 2, 3
set standard length of {_v} to 2
send "%standard length of {_v}%"
| Patterns: |
|
| Since: | 2.2-dev28, 2.7 (signed components) |
| Return Type: | Vector |
Examples:
| Patterns: | |
| Since: | 2.2-dev28 |
| Return Type: | Vector |
Examples:
set {_v} to spherical vector radius 1, yaw loop-value, pitch loop-value
set {_v} to spherical vector radius 1, yaw 45, pitch 90
| Patterns: | |
| Since: | 2.0 |
| Return Type: | Entity |
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:
give {game::players::*} a carrot on a stick
on vehicle enter:
vehicle is a horse
add 1 to {statistics::horseMounting::%uuid of player%}
| Patterns: |
|
| Since: | 2.0 |
| Return Type: | Text |
Examples:
message "This server is powered by Skript %skript version%"
| Patterns: |
|
| Since: | 2.3 |
| Usable in events: | Server List Ping |
| Return Type: | Text |
This can only be set in a server list ping event.
Examples:
set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
set the version string to "<light green>Version: <orange>%minecraft version%"
| Patterns: | |
| Since: | 2.4, 2.11 (worlds) |
| Return Type: | integer |
The view distance of a player is the distance in chunks sent by the server to the player. This has nothing to do with client side view distance settings.
View distance is capped between 2 to 32 chunks.
Examples:
add 50 to the view distance of world "world"
reset the view distance of player
clear the view distance of world "world"
| Patterns: | |
| Since: | 2.5 |
| Requirements: | 1.13.2+ |
| Return Type: | long |
Examples:
set view distance of player to client view distance of player
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Number |
The level will determine which trades are available to players (value between 1 and 5, defaults to 1).
When a villager's level is 1, they may lose their profession if they don't have a workstation.
Experience works along with the leveling system, determining which level the villager will move to.
Experience must be greater than or equal to 0.
Learn more about villager levels on Minecraft Wiki
Examples:
set villager level of last spawned villager to 2
add 1 to villager level of target entity
remove 1 from villager level of event-entity
reset villager level of event-entity
set villager experience of last spawned entity to 100
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Villager Profession |
Examples:
villager profession of event-entity = nitwit profession
set villager profession of {_villager} to librarian profession
delete villager profession of event-entity
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Villager Type |
Examples:
villager type of {_villager} = plains
set villager type of event-entity to plains
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | integer |
A warden can be angry towards multiple entities with different anger levels.
If an entity reaches an anger level of 80+, the warden will pursue it.
Anger level maxes out at 150.
Examples:
clear the last spawned warden's anger level towards player
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Living Entity |
A warden can be angry towards multiple entities with different anger levels.
Examples:
set the most angered entity of last spawned warden to player
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | integer |
Players only see a red tint when approaching a world's worldborder and the warning distance has to be an integer greater than or equal to 0.
Examples:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Timespan |
Examples:
| Patterns: | |
| Since: | 1.0 |
| Usable in events: | weather change |
| Return Type: | Weather Type |
Clearing or resetting the weather of a player will make the player's weather match the weather of the world.
Clearing or resetting the weather of a world will make the weather clear.
Examples:
weather in "world" is rainy
reset custom weather of player
set weather of player to clear
| Patterns: |
|
| Since: | 2.9.0 |
| Return Type: | Boolean |
Examples:
broadcast "Flying: %whether player is flying%"
| Patterns: |
|
| Since: | 2.5.2, 2.9.0 (delete) |
| Return Type: | Offline Player |
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:
add all players to whitelist
reset the whitelist
| Patterns: | |
| Since: | 2.9.0 |
| Requirements: | Spigot 1.20.5+ |
| Return Type: | Item Type |
Examples:
equip player with netherite helmet without fire resistance
drop fire resistant stone at player
| Patterns: | |
| Since: | 1.0 |
| Return Type: | World |
Examples:
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk
| Patterns: | |
| Since: | 2.11 |
| Return Type: | World Border |
A player's world border is not persistent. Restarts, quitting, death or changing worlds will reset the border.
Examples:
| Patterns: | |
| Since: | 2.7 |
| Return Type: | World Environment |
Examples:
apply fire resistance to player for 10 minutes
| Patterns: |
|
| Since: | 1.0 |
| Return Type: | World |
Examples:
broadcast "You're in %loop-world%" to loop-world
| Patterns: |
|
| Since: | 1.2 |
| Return Type: | Object |
Examples:
| Patterns: | |
| Since: | 2.0, 2.2-dev28 (vector yaw/pitch), 2.9.0 (entity changers) |
| Return Type: | float |
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:
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