All Elements
Examples:
aliases:
βblacklisted items = TNT, bedrock, obsidian, mob spawner, lava, lava bucket
βshiny swords = golden sword, iron sword, diamond sword
| Patterns: |
|
| Required Entries: | |
| Optional Entries: | recipients, permission |
| Since: | 2.13 |
available optional nodes: βrecipients: The players to send reload messages to. Defaults to console. βpermission: The permission required to receive reload messages. 'recipients' will override this node.
Examples:
auto reload:
βrecipients: "SkriptDev", "61699b2e-d327-4a01-9f1e-0ea8c3f06bc6" and "Njol"
βpermission: "skript.reloadnotify"
| Patterns: |
|
| Since: | 1.0 2.17 (subcommands, suggestions, etc.) |
Examples:
βaliases: /bc
βexecutable by: players and console
βusage: A command for broadcasting a message to all players.
βpermission: skript.command.broadcast
βcooldown: 15 seconds
βcooldown message: You last broadcast a message %elapsed time% ago. You can broadcast another message in %remaining time%.
βcooldown bypass: skript.command.broadcast.admin
βcooldown storage: {cooldown::%player%}
βtrigger:
βbroadcast the argument
command /home:
βsubcommand set <name: text>:
βtrigger:
βset {homes::%player%::%{_name}%} to the player's location
βsubcommand <name: text>:
βsuggestions:
βloop {homes::%player%::*}:
βadd formatted "<ttp:'Location: %loop-value%'>%loop-index%" to the suggestions for the text argument
βtrigger:
βteleport the player to {homes::%player%::%{_name}%}
| Patterns: |
|
| Since: | 1.0 2.6 (per-event priority) 2.9 (listening to cancellable events) |
Optionally allows specifying whether to listen to events that have been cancelled, and allows specifying with which priority to listen to events. Events are called in the following order of priorities.
``` lowest -> low -> normal -> high -> highest -> monitor ```
Modifying event-values or cancelling events is not supported when using the 'monitor' priority. It should only be used for monitoring the outcome of an event.
Examples:
βbroadcast "loading!"
on join:
βif {first-join::%player's uuid%} is not set:
βset {first-join::%player's uuid%} to now
cancelled block break:
βsend "<red>You can't break that here" to player
on join with priority lowest:
β# called first
on join:
β# called second
on join with priority highest:
β# called last
| Patterns: |
|
| Since: | 2.2, 2.7 (local functions) |
They can also return a value to the trigger that is executing the function.
Note that local functions come before global functions execution
Examples:
βbroadcast {_message} # our message argument is available in '{_message}'
local function giveApple(amount: number) :: item:
βreturn {_amount} of apple
function getPoints(p: player) returns number:
βreturn {points::%{_p}%}
| Patterns: |
|
| Since: | 1.0 |
For example, an option may represent a message that appears in multiple locations.
Take a look at the example below that showcases this.
Examples:
βno_permission: You're missing the required permission to execute this command!
command /ping:
βpermission: command.ping
βpermission message: {@no_permission}
βtrigger:
βmessage "Pong!"
command /pong:
βpermission: command.pong
βpermission message: {@no_permission}
βtrigger:
βmessage "Ping!"
| Patterns: |
|
| Since: | 2.9.0 |
Experimental features may change behavior in Skript and may contain bugs. Use at your own discretion.
A list of the available experimental features can be found in the changelog for your version of Skript.
Examples:
using the experiment my-cool-addon-feature
| Patterns: |
|
| Since: | 1.0 |
This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Examples:
β{joins} = 0
β{balance::%player%} = 0
on join:
βadd 1 to {joins}
βmessage "Your balance is %{balance::%player%}%"
| 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.6 |
| Return Type: | Text |
Examples:
send "Number of all script commands: %size of all script commands%"
| 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.15 |
| Return Type: | Text |
Examples:
if size of {_keys::*} > 0:
broadcast "The tool has the following persistent data keys: %{_keys::*}%"
else:
broadcast "The tool has no persistent data keys."
for each {_key} in persistent data keys of player's tool:
broadcast "Persistent data tag %{_key}%: %data tag {_key} of player's tool%"
| 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.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 2.13 (amounts of) |
| Return Type: | Object |
Examples:
if amount of player's tool > 5:
if amounts of player's tool and player's offhand tool > 5:
| 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: | 2.11 |
| 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 |
Examples:
βset the applied enchantments to sharpness 10 and fire aspect 5
| Patterns: | |
| Since: | 1.0 2.7 (support for command events) |
| Return Type: | Object |
Examples:
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument
| Patterns: |
|
| Since: | 1.4.2 |
| Return Type: | Object |
Examples:
loop (argument + 2) / 5 times:
βmessage "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"
| Patterns: |
|
| Since: | 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, attempt attack |
| Return Type: | Entity |
Examples:
βvictim is a creeper
βdamage the attacked by 1 heart
| Patterns: |
|
| Since: | 1.3 |
| Usable in events: | damage, death, vehicle destroy, attempt attack |
| Return Type: | Entity |
Examples:
βattacker is a player
βhealth of attacker is less than or equal to 2
βdamage victim by 1 heart
| Patterns: |
|
| Since: | 2.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 Component |
Examples:
βbroadcast "A new book has been created by %author of event-item%"
| Patterns: |
|
| Since: | 2.2-dev31, 2.7 (changers) |
| Return Type: | Text Component |
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:
βif the number of pages of event-item is greater than 1:
βmessage "The second page of the authored book is: %page 2 of event-item%"
set page 1 of the player's held item to "This page was written with Skript!"
| Patterns: |
|
| Since: | 2.2-dev31 |
| Return Type: | Text Component |
Examples:
βmessage "You finished your book titled %title of event-item%"
| Patterns: |
|
| Since: | 2.16 |
| Return Type: | keyedbossbar |
Examples:
set title of event-bossbar to "My Test Title"
set color of event-bossbar to red
set progress of event-bossbar to 86%
set style of event-bossbar to 6 notches
// some structure later on and you need to access it
set the title of the boss bar with the key "example" to "My Updated Test Title"
| 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.10 |
| Usable in events: | broadcast |
| Return Type: | Text Component |
Examples:
βset broadcast message to "<light green>[BROADCAST] %broadcast message%"
| Patterns: |
|
| Since: | 2.12 |
| Return Type: | integer |
Examples:
on player change block:
βif dusting progress of future event-blockdata > 1:
βcancel event
# draw particles when dusting is complete!
on player change block:
βif brushing progress of event-block is max brushing stage of event-block:
βdraw 20 totem of undying particles at event-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 |
| Usable in events: | chat |
| Return Type: | Text Component |
Examples:
| Patterns: |
|
| Since: | 1.4.6, 2.15 (support for reset) |
| Usable in events: | chat |
| Return Type: | Text Component |
Examples:
βplayer has permission "admin"
βset the message to "<light red>%message%"
| Patterns: |
|
| Since: | 2.17 |
| Return Type: | Text |
Examples:
βtrigger:
βif the choice argument is "restart":
βbroadcast "<red>The server is restarting in 5 minutes!"
βelse: # must be giveaway
βbroadcast "<aqua>A giveaway is starting soon at spawn!"
| 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: | 2.14 |
| Return Type: | Color |
Examples:
send color from hex code "FFBBA7"
send color from hex code "#AAFFBBA7"
| Patterns: |
|
| Since: | 1.2, 2.10 (displays), 2.16 (boss bars) |
| 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 2.15 ('uncolored' vs 'unformatted' distinction) |
| Return Type: | Object |
Examples:
βset message to colored message # only safe tags, such as colors, will be parsed
command /fade <player>:
βtrigger:
βset the display name of the player-argument to the uncolored display name of the player-argument
command /format <text>:
βtrigger:
βmessage formatted text-argument # parses all tags, but this is okay as the output is sent back to the executor
| 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.17 |
| Return Type: | Entity |
Examples:
β# This works if you do "/execute as <player> run balance"
β# It will send the output to the command sender, but it will be as if "<player>" was the thing executing it.
βsend "Your balance is %{balance::%uuid of the executor%}%" to the sender
| 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 "sk"'s plugin owner
command /greet <player>:
βusage: /greet <target>
βtrigger:
βif arg-1 is sender:
βsend "&cYou can't greet yourself! Usage: %the usage%"
βstop
βsend "%sender% greets you!" to arg-1
βsend "You greeted %arg-1%!"
| Patterns: |
|
| Since: | 2.0 |
| Usable in events: | command |
| Return Type: | Command Sender |
Examples:
on command:
βlog "%sender% 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.16 |
| Return Type: | BossBar |
Examples:
βset {_bar} to a boss bar:
βset color of event-bossbar to white
βset title of event-bossbar to "<green>Welcome %player%!"
βset progress of event-bossbar to 50%
βset style of event-bossbar to 6 notches
βmake event-bossbar darken the sky
βadd player to viewers of {_bar}
βwait 5 seconds
βremove player from viewers of {_bar}
command /createkeyedbar:
βtrigger:
βset {_bar} to a keyed red bossbar with title "<red>My persistent red bar":
βset progress of event-bossbar to 14%
βset style of event-bossbar to 20 notches
βloop all operators:
βadd loop-value to viewers of {_bar}
| 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 |
| Return Type: | Damage Source |
Examples:
βset the damage type of the created damage source to magic
| Patterns: |
|
| Since: | 2.14 |
| Return Type: | skriptpotioneffect |
Examples:
βhide the effect's icon
βhide the effect's particles
| 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 |
Use the open inventory effect to open it.
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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| Return Type: | float |
Examples:
βif the food exhaustion of event-damage source is 10:
| Patterns: |
|
| Since: | 2.12 |
| 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.0 |
| Usable in events: | death |
| Return Type: | Text Component |
Examples:
βset the death message to "%player% died!"
| 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: | before 2.1 2.2-dev20 (inventory name) 2.4 (non-living entity support, changeable inventory name) |
| Return Type: | Object |
Players: 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: 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: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories: 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.
Examples:
βplayer has permission "name.red"
βset the player's display name to "<red>[admin] <gold>%name of player%"
| 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.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 |
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: | integer |
Examples:
βsend "Cost: %the displayed enchanting cost%" to player
| Patterns: |
|
| Since: | 2.5 |
| Usable in events: | enchant prepare |
| Return Type: | integer |
Examples:
βsend "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player
| Patterns: |
|
| Since: | 2.16 |
| Usable in events: | enchant |
| Return Type: | Enchantment |
Examples:
βsend "You got at least %the enchantment hint%!"
| 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 |
| Return Type: | Enchantment Offer |
Examples:
βsend "Your enchantment offers are: %the enchantment offers%" to player
| Patterns: |
|
| Since: | 2.5 |
| 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 breed |
| 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: | explode |
| 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 |
| 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, start smelt, furnace item 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.14 |
| Return Type: | Game Effect |
Examples:
| 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.14 |
| Return Type: | Text |
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 player 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: | 2.14 |
| Return Type: | Number |
Examples:
set interaction width of last spawned interaction to 2
| 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.17 |
| Return Type: | Text |
Examples:
set the item model of {_item} to "minecraft:dirt"
| Patterns: |
|
| Since: | 2.17 |
| Return Type: | Item Rarity |
Examples:
set the item rarity of {_item} to uncommon
set {_rarity} to item rarity of player's held item
| Patterns: | |
| Since: | 2.17 |
| Return Type: | Item Type |
Examples:
give {_item} to player
| Patterns: | |
| Since: | 2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles), 2.10 (item displays), 2.14.1 (arrows) |
| 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.
For arrows, it gets the item that will be picked up when retrieving the arrow. Note that setting the item may not change the displayed model, and that setting a spectral arrow to a non-spectral arrow or vice-versa will not affect the effects of the projectile.
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 |
| 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 passing multiple components, each with be a line of lore.
Examples:
give {_item} 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: | 1.4.9 |
| Usable in events: | join |
| Return Type: | Text Component |
Examples:
βset the join message to "Welcome %player% to our awesome server!"
on join:
βplayer has played before
βset the join message to "Welcome back, %player%!"
| 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.0 beta 9 |
| Usable in events: | kick |
| Return Type: | Text Component |
Examples:
βset the kick message to "%player% was booted from the server! They won't be missed..."
| 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.14 |
| Return Type: | Date |
Examples:
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Offline Player |
Examples:
feed the last player who interacted with {_i}
| 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: | unknown (before 2.1), 2.13.2 (allow player default) |
| Usable in events: | level change |
| Return Type: | long |
Examples:
set the player's level to 0
on level change:
βset {_diff} to future xp level - past exp level
βbroadcast "%player%'s level changed by %{_diff}%!"
| 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 |
| 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 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 Component |
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.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: | 2.3 |
| Usable in events: | server list ping |
| Return Type: | Text Component |
This can be changed in a server list ping event only.
Use 'default MOTD' to obtain the default MOTD set through the server configuration. This cannot be changed.
Examples:
βset the motd to "<red>Join our server today!"
| 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.16 |
| Return Type: | integer |
The minimum starting level is 1 for all existing enchantments as of 26.1.2.
Examples:
if the level of sharpness of the player's tool is greater than {_maximum}:
βsend "<gold>Your tool's sharpness level was capped out at the maximum allowed level.</gold>"
βset the level of sharpness of the player's tool to {_maximum}
set {_min} to the minimum enchantment level of sharpness
set {_max} to the maximum enchantment level of sharpness
loop integers between {_min} and {_max}:
βset slot loop-counter of {_gui} to enchanted book named "Sharpness %loop-value%" with lore "<reset>Click to enchant!"
| 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: | Object |
Players: The Minecraft account name of the player. Can't be changed.
Entities: 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'.
Items: The custom name of the item (not the Minecraft locale name). Can be changed.
Inventories: 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: The name of the gamerule. Cannot be changed.
Worlds: The name of the world. Cannot be changed.
Scripts: 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 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 2.14 (syntax changes, infinite duration support) |
| Return Type: | skriptpotioneffect |
Examples:
βhide the effect's icon
βhide the effect's particles
add strength 5 to the potion effects of the player's tool
apply invisibility to the player for 5 minutes:
βhide the effect's particles
add a potion effect of speed 1 to the potion effects of the player
# creates a potion effect with the properties of an existing potion effect
set {_potion} to a potion effect of slowness based on the player's speed effect
| Patterns: |
|
| Since: | 2.5.2 2.14 (syntax changes, infinite duration support) |
| Return Type: | skriptpotioneffect |
Examples:
βhide the effect's icon
βhide the effect's particles
add strength 5 to the potion effects of the player's tool
apply invisibility to the player for 5 minutes:
βhide the effect's particles
add a potion effect of speed 1 to the potion effects of the player
# creates a potion effect with the properties of an existing potion effect
set {_potion} to a potion effect of slowness based on the player's speed effect
| 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: | 1.0 2.13 (numbers of) |
| Return Type: | Object |
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.12 |
| Usable in events: | kick |
| Return Type: | Text Component |
Examples:
βset the on-screen kick message to "You've been booted!"
| 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.14 |
| Return Type: | Number |
This means that setting the particle count may change how your particle behaves. Be careful!
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Vector |
Particles will be randomly drawn based on these values, clustering towards the center. 68% of particles will be within 1 standard deviation, 95% within 2, and 99.7% within three. The area the particles will spawn in can be roughly estimated as being within 2 times the standard deviation in each axis.
For example, a distribution of 1, 2, and 1 would spawn particles within roughly 2 blocks on the x and z axes, and within 4 blocks on the y axis.
Please note that distributions only take effect if the particle count is greater than 0! Particles with counts of 0 do not have distributions. If the particle count is 0, the offset is treated differently depending on the particle.
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Vector |
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Number |
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
set the particle speed of {_my-flame-particle} to 0
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Particle |
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
draw 12 red dust particles with a distribution of vector(1,2,1) at player's head location
| Patterns: | |
| Since: | 2.14 |
| Return Type: | Particle |
More detailed information on particle behavior can be found at Paper's particle documentation.
Examples:
draw 12 red dust particles with an extra value of 0.4 at player's head location
| Patterns: |
|
| Since: | 2.14 |
| Return Type: | Particle |
Examples:
draw 3 blue trail particles moving to player's target over 3 seconds at player
| 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:
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.16 |
| Usable in events: | pathfind |
| Return Type: | Entity |
Examples:
βif the pathfinding target entity is a villager:
β broadcast "I suspect a zombie is going towards a villager right now.."
| Patterns: |
|
| Since: | 2.16 |
| Usable in events: | pathfind |
| Return Type: | Location |
Examples:
βif the pathfinding target location is within radius 5 of {mylocation}:
β broadcast "A mob tried to pathfind near a forbidden location!"
β cancel event
| 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.15 |
| Return Type: | Object |
The names of tags must be valid namespaced keys, i.e. a-z, 0-9, '_', '.', '/', and '-' are the allowed characters. If no namespace is provided, it will default to 'minecraft'.
Examples:
on jump:
βif data tag "boost" of player's boots is set:
βpush player upwards
on shoot:
βset {_strength} to number data tag "strength" of shooter's tool
βif {_strength} is set:
βset number data tag "damage" of projectile to {_strength}
on damage:
βset {_damage} to data tag "damage" of projectile
βif {_damage} is set:
βset damage to {_damage}
set {_pet-uuids::*} to list data tag "pets" of player
| Patterns: |
|
| Since: | 2.7 |
| Return Type: | double |
Examples:
| Patterns: |
|
| Since: | 2.15 |
| Requirements: | 1.21.5+ |
| Return Type: | Object |
Examples:
βsend "You picked %the picked item%!" to the player
| 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: | Before 2.1 |
| Return Type: | Text Component |
Examples:
βplayer has permission "name.red"
βset the player's tab list name to "<red>%player's name%"
| Patterns: | |
| Since: | 2.16 |
| Return Type: | integer |
Examples:
βplayer has permission "group.mod"
βset the player's tab list priority to 5
| 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.7 2.14 (support for potion effect objects, changing) |
| Return Type: | integer |
Examples:
add 10 to the amplifier of the player's speed effect
| Patterns: |
|
| Since: | 2.14 |
| Return Type: | Timespan |
Examples:
add 10 seconds to the duration of the player's speed effect
| Patterns: |
|
| Since: | 2.14 |
| Requirements: | Minecraft 1.21+ |
| Return Type: | Potion Effect Type Category |
That is, whether the potion effect type is beneficial, harmful, or neutral.
Examples:
βif the potion effect type category is harmful:
β message "You have been afflicted with %potion effect type%"
| Patterns: |
|
| Since: | 2.14 |
| Requirements: | Paper 1.20.4+ for hidden effects |
| Return Type: | skriptpotioneffect |
When an entity is affected by a potion effect but already has a weaker version of that effect type, the weaker version becomes hidden. If the weaker version has a longer duration, it returns after the stronger version expires.
NOTE: Hidden effects are not able to be changed.
Examples:
add 10 seconds to the player's slowness effect
clear the player's hidden strength effects
reset the player's weakness effects
delete the player's active jump boost effect
| Patterns: |
|
| Since: | 2.5.2, 2.14 (active/hidden support, more change modes) |
| Requirements: | Paper 1.20.4+ for hidden effects |
| Return Type: | skriptpotioneffect |
When an entity is affected by a potion effect but already has a weaker version of that effect type, the weaker version becomes hidden. If the weaker version has a longer duration, it returns after the stronger version expires.
NOTE: Hidden effects are not able to be changed.
NOTE: Clearing the base potion effects of a potion item is not possible. If you wish to do so, just set the item to a water bottle.
Examples:
clear the player's hidden potion effects
add the potion effects of the player to the potion effects of the player's tool
reset the potion effects of the player's tool
remove speed and night vision from the potion effects of the 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: | 1.4.9 |
| Usable in events: | quit |
| Return Type: | Text Component |
Examples:
βif {vanish::%player's uuid%} is set:
βclear the quit message
βelse:
βset the quit message to "%player% left this server... they will be missed!"
| 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: | 2.14 |
| Return Type: | Object |
Examples:
βset {_data::a::b::c} to "value1"
βset {_data::a::b::d} to "value2"
βset {_data::a::e} to "value3"
βset {_data::f} to "value4"
βbroadcast recursive {_data::*}
β# broadcasts "value1", "value2", "value3", "value4"
βbroadcast recursive indices of {_data::*}
β# broadcasts "a::b::c", "a::b::d", "a::e", "f"
| 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.15 |
| Return Type: | Object |
The reduce expression takes each element and combines it with an accumulator value.
Use 'reduced value' to access the current accumulated value and 'input' for the current element.
Examples:
set {_product} to {_values::*} reduced with [reduced value * input]
set {_concatenated} to {_strings::*} reduced with ["%reduced value%%input%"]
| Patterns: |
|
| Since: | 2.15 |
| Return Type: | Object |
This represents the result of all previous reduction operations.
Can only be used inside the reduce expression's operation block.
Examples:
set {_max} to {_values::*} reduced with [reduced value if reduced value > input else input]
set {_combined} to {_items::*} reduced with ("%reduced value%, %input%")
| 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.16 |
| Return Type: | Text Component |
Examples:
| 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.14 |
| Return Type: | Respawn Reason |
Examples:
βif respawn reason is end portal:
βbroadcast "%player% took the end portal to the overworld!"
| 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.14 |
| Return Type: | Object |
For example, the scale of a display entity would be a vector containing multipliers on its size in the x, y, and z axis.
For a particle effect like the sweeping edge particle, scale is a number determining how large the particle should be.
Examples:
set the scale of {_particle} to 1.5
| 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.2-dev33 |
| Return Type: | Object |
Examples:
βcooldown: 10 seconds
βcooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
βtrigger:
βteleport player to {home::%player%}
| Patterns: |
|
| Since: | 2.17 |
| Return Type: | Object |
Examples:
βsuggestions:
βplayer argument is set # they are writing the text argument
βif the current input contains "frick":
βset the suggestions for the text argument to "Keep your messages nice please!"
βdisable filtering for the text argument's suggestions
βtrigger:
βsend "<grey><italic>%player% -> You: %text argument%" to player argument
βsend "<grey><italic>You -> %player argument%: %text argument%" to player
| Patterns: | |
| Since: | 2.17 |
| Return Type: | Text Component |
Examples:
βsuggestions:
βif arg-1 is not set:
βset arg-1's suggestions to "Appetizers", "Entrees", and "Desserts"
βelse if arg-1 is "Appetizers":
βset arg-2's suggestions to "Salads", "Breads", and "Fried Delights"
βelse if arg-1 is "Entrees":
βset arg-2's suggestions to "Pastas", "Handhelds", and "Pizzas"
βelse if arg-1 is "Desserts":
βset arg-2's suggestions to "Cakes", "Ice Creams", and "Pies"
βtrigger:
βsend "Yum!"
command /home:
βsubcommand set <name: text>:
βtrigger:
βset {homes::%player%::%{_name}%} to the player's location
βsubcommand <name: text>:
βsuggestions:
βloop {homes::%player%::*}:
βadd formatted "<ttp:'Location: %loop-value%'>%loop-index%" to the suggestions for the text argument
βtrigger:
βteleport the player to {homes::%player%::%{_name}%}
| 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 2.17 (sign side support) |
| Return Type: | Text Component |
Examples:
βclicked block is tagged as "minecraft:all_signs"
βif line 2 of the clicked block is "[Heal]":
βheal the player
on sign change:
βany of the lines contain "bad word"
βcancel the event
βsend "<red>You may not write profanity on signs!" to the 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: | 1.0 2.13 (sizes of) |
| Return Type: | Object |
Examples:
| 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.16 |
| Return Type: | Text |
Examples:
| 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.2-dev19, 2.14 (retain indices when looping) |
| Return Type: | Object |
Examples:
command /leaderboard:
βtrigger:
βloop reversed sorted {most-kills::*}:
βsend "%loop-counter%. %loop-index% with %loop-value% kills" to sender
| 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.16 |
| Return Type: | Enchantment Type |
minecraft:stored_enchantments data component. Note that for example resetting the stored enchantments of an enchanted book of Sharpness III removes the sharpness enchantment, since it is impossible to know what the original enchantments of the item were. Note also that only one entry can exist per enchantment type; adding Sharpness III to a book with Sharpness V will convert it to a book of Sharpness III. Examples:
βtrigger:
βset {_item} to minecraft:enchanted_book
βadd mending to stored enchants of {_item} # adds mending 1
βadd knockback 12 to stored enchants of {_item}
βadd fire aspect 3 to stored enchants of {_item}
βgive {_item} to player
| 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: | 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, 2.14 (0-255) |
| Return Type: | integer |
Examples:
set text opacity of all text displays to 255 # fully opaque
set text opacity of all text displays to 128 # semi-transparent
set text opacity of all text displays to 4 # fully transparent
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Text Component |
Note that currently you can only use Skript chat codes when running Paper.
Examples:
| Patterns: | |
| Since: | 2.16 |
| Return Type: | Text |
Examples:
# Function for sanitizing user inputs
# Strips the input of any non-alphanumeric characters using regex
function sanitizeInput(input: string) :: string:
βreturn {_input} where regex pattern "\W" is replaced with ""
# Function to convert &# hex color codes to <# > (mini message format)
function colorFormat(input: string) :: string:
βreturn {_input} where all instances of regex pattern "&#([a-fA-F0-9]{6})" are replaced with "<#$1>"
# Very simple chat censor
on chat:
βset message to message where all instances of "idiot", "noob" are replaced with "****"
βset message to message where regex "\b(idiot|noob)\b" is replaced with "****" # Regex version using word boundaries for better results
| 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
| 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: | 2.16 |
| Return Type: | Object |
Examples:
on inventory click:
βif type of event-item is written book:
βset title of event-item to formatted "<obf>%random uuid%"
βsend "Your book's title is now forever forgotten.." to player
| 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.17 |
| Usable in events: | unknown command execution |
| Return Type: | Text Component |
Examples:
βadd 1 to {-command_fails::%player%}
βwait 30 seconds:
βremove 1 from {-command_fails::%player%}
βif {-command_fails::%player%} is greater than or equal to 5:
βpush the player upwards
βset the unknown command message to "<red>You are executing too many unknown commands too fast!"
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Leash / Unleash |
| Return Type: | Unleash Reason |
Examples:
βbroadcast "The leash was snapped in half."
| Patterns: | |
| Since: | 2.10 |
| Return Type: | Object |
The value is automatically converted to the specified type (e.g. text, number) where possible.
Examples:
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 |
| 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.14 (local axes) |
| Return Type: | Location |
Examples:
# spawn a tnt 5 blocks in front of player
set {_l} to player's location offset by vector(0, 1, 5) using local axes
spawn tnt at {_l}
| 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.2-dev31 |
| Return Type: | Vector |
Setting the velocity of a particle will remove its random dispersion and force it to be a single particle.
Examples:
set the velocity of {_particle} to vector(0, 1, 0)
if the vector length of the player's velocity is greater than 5:
send "You're moving fast!" to the 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.16 |
| Return Type: | Object |
Examples:
on inventory open:
βset {_mylist::*} to viewers of event-inventory
βsend "%size of {_list::*}% other players are viewing this inventory!"
| 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.2-dev28, 2.10 (quaternions) |
| Return Type: | Object |
The W axis is only used for quaternions, currently.
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}%"
set {_x} to x of player
set {_z} to z of player
if:
β{_x} is between 0 and 100
β{_z} is between 0 and 100
then:
βset y component of player's velocity to 10
| 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 2.17 (changing) |
| Return Type: | Boolean |
Examples:
broadcast "Flying: %whether player is flying%"
set whether the player can fly to true
toggle whether the player can pick up items
| 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
| Patterns: |
|
| Since: | 2.11 |
This is not the same as breeding allays.
Examples:
prevent all allays from duplicating
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Leash / Unleash |
Examples:
βif player is not set:
βprevent the leash from dropping
βelse if player is op:
βallow the leash to drop
| Patterns: |
|
| Since: | 2.10 |
Examples:
βallow aging of entity
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
Examples:
βapply lure enchantment bonus
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
Examples:
βapply lure enchantment bonus
| Patterns: |
|
| Since: | 2.0 2.14 (syntax rework) |
Examples:
command /strengthboost:
βtrigger:
βapply strength 10 to the player for 5 minutes
apply the potion effects of the player's tool to the player
| Patterns: |
|
| Since: | 1.4, 2.1.1 (ban reason), 2.5 (timespan), 2.9.0 (kick) |
If a reason is given, it will be shown to the player when they try to join the server while banned.
A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead.
We recommend that you test your scripts so that no accidental permanent bans are applied.
Note that banning people does not kick them from the server.
You can optionally use 'and kick' or consider using the kick effect after applying a ban.
Examples:
ban "127.0.0.1"
IP-ban the player because "he is an idiot"
ban player due to "inappropriate language" for 2 days
ban and kick player due to "inappropriate language" for 2 days
| Patterns: | |
| Since: | 2.16 |
Examples:
make {_bossbar} create fog
wait 30 seconds
broadcast "The fog has subsided... for now"
make {_bossbar} no longer create fog
| Patterns: | |
| Since: | 2.4 |
You can add a tool, which will spawn items based on how that tool would break the block
(ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)
Examples:
βbreak clicked block naturally
loop blocks in radius 10 around player:
βbreak loop-block using player's tool
loop blocks in radius 10 around player:
βbreak loop-block naturally using diamond pickaxe
| Patterns: |
|
| Since: | 2.8.0 |
For example, interrupting eating, or drawing back a bow.
Examples:
βif the victim's active tool is a bow:
βinterrupt the usage of the player's active item
| Patterns: |
|
| Since: | 2.2-dev34 |
Examples:
βexecutable by: players
βcooldown: 10 seconds
βtrigger:
βif length of arg-1 is more than 16:
β# Makes it so that invalid arguments don't make you wait for the cooldown again
βcancel the cooldown
βsend "Your nickname may be at most 16 characters."
βstop
βset the player's display name to arg-1
| Patterns: |
|
| Since: | 2.4, 2.12 (harvest event) |
| Usable in events: | death, break / mine, block drop, harvest block |
| Requirements: | 1.12.2 or newer (cancelling item drops of blocks) |
The dropped experience can be cancelled in a death and block break events.
Please note that using this in a death event doesn't keep items or experience of a dead player. If you want to do that, use the Keep Inventory / Experience effect.
Examples:
βif name of the entity is "&cSpecial":
βcancel drops of items
on break of a coal ore:
βcancel the experience drops
on player block harvest:
βcancel the item drops
| Patterns: |
|
| Since: | 1.0 |
Examples:
βvictim is a player
βvictim has the permission "skript.god"
βcancel the event
| Patterns: | |
| Since: | 1.0 (set, add, remove, delete), 2.0 (remove all) |
Some expressions can only be set and/or deleted, while others can also have things added to or removed from them.
Examples:
set the block above the victim to lava
add 2 to the player's health # preferably use '<a href='#EffHealth'>heal</a>' for this
add argument to {blacklist::*}
give a diamond pickaxe of efficiency 5 to the player
increase the data value of the clicked block by 1
remove 2 pickaxes from the victim
subtract 2.5 from {points::%uuid of player%}
remove every iron tool from the player
remove all minecarts from {entitylist::*}
delete the block below the player
clear drops
delete {variable}
reset walk speed of player
reset chunk at the targeted block
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.0, 2.2-dev26 (maps and potions) |
(red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect. Examples:
color the player's tool red
| Patterns: |
|
| Since: | 1.0, 2.8.0 (BungeeCord command) |
Examples:
execute console command "/say Hello everyone!"
execute player bungeecord command "/alert &6Testing Announcement!"
| Patterns: |
|
| Since: | 2.10 |
Examples:
make command block {_block} unconditional if {_block} is conditional
| Patterns: | |
| Since: | 2.3, 2.10 (transfer) |
If the server is running Minecraft 1.20.5 or above, you may specify an IP and Port to transfer a player over to that server.
When transferring players using an IP, the transfer will not complete if the `accepts-transfers` option isn't enabled in `server.properties` for the server specified.
If the port is not provided, it will default to `25565`.
Examples:
transfer player to server "my.server.com"
transfer player to server "localhost" on port 25566
| Patterns: |
|
| Since: | 2.10 |
Examples:
βif the used firework will be consumed:
βprevent the used firework from being consume
| Patterns: |
|
| Since: | 2.13 |
| Usable in events: | Brewing Fuel |
Examples:
βprevent the brewing stand from consuming the fuel
| Patterns: |
|
| Since: | 2.2-dev37, 2.7 (while loops), 2.8.0 (outer loops) |
Examples:
loop all players:
βif loop-value does not have permission "moderator":
βcontinue # filter out non moderators
βbroadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter
set {_counter} to 11
while {_counter} > 0:
βremove 1 from {_counter}
βwait a second
βif {_counter} != 1, 2, 3, 5 or 10:
βcontinue # only print when counter is 1, 2, 3, 5 or 10
βbroadcast "Game starting in %{_counter}% second(s)"
| Patterns: | |
| Since: | 2.8.0 |
Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::sublist::foobar} to "hey"
copy {_foo::*} to {_copy::*}
broadcast indices of {_copy::*} # bar, sublist
broadcast {_copy::bar} # 1
broadcast {_copy::sublist::foobar} # "hey!"
| Patterns: |
|
| Since: | 1.0, 2.10 (damage cause) |
| Requirements: | Spigot 1.20.4+ (for damage cause) |
Servers running Spigot 1.20.4+ can optionally choose to specify a fake damage cause.
Examples:
damage player by 3 hearts with fake cause fall
heal the player
repair tool of player
| Patterns: |
|
| Since: | 2.11 |
Providing a location only applies to allays. They will check to see if the the block at the location is a jukebox and playing music. If it isn't, they will stop dancing. If no location is provided, the allay will dance indefinitely.
Providing a timespan only applies for piglins. It determines the length of time they will dance for. If no timespan is provided, they will dance indefinitely.
Examples:
βmake last spawned allay start dancing
if block at location(0, 0, 0) is a jukebox:
βmake all allays dance at location(0, 0, 0)
make last spawned piglin start dancing
make all piglins dance for 5 hours
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.3 |
Examples:
βgive a diamond to the player if the player has permission "rank.vip"
| Patterns: |
|
| Since: | 1.0 |
Examples:
βdrop 1 TNT
| Patterns: | |
| Since: | 2.4, 2.10 (unloading) |
Disabling a script unloads it and prepends - to its name so it will not be loaded the next time the server restarts. If the script reflection experiment is enabled: unloading a script terminates it and removes it from memory, but does not alter the file.
Examples:
enable script file "testing"
unload script file "script.sk"
set {_script} to the script "MyScript.sk"
reload {_script}
| Patterns: |
|
| Since: | 2.0, 2.13 (at level) |
Examples:
enchant the player's tool at level 30
disenchant the player's tool
| Patterns: |
|
| Since: | 2.11 |
| Requirements: | Minecraft 1.20.1+ |
Teleporting towards an entity teleports in the direction to the entity and not to them.
Examples:
loop 10 times:
βmake all endermen teleport towards player
| Patterns: |
|
| Since: | 2.9.0 |
| Requirements: | MC 1.17+ |
All non-whitelisted players will be kicked upon enforcing the whitelist.
Examples:
unenforce the whitelist
| Patterns: |
|
| Since: | 2.11 |
Setting a custom name on a living entity automatically makes it not despawnable.
More information on what and when entities despawn can be found at reference.
Examples:
spawn zombie at location(0, 0, 0):
βforce event-entity to not despawn when far away
| Patterns: | |
| Since: | 2.3, 2.10 (entities) |
| Requirements: | Minecraft 1.19+ (entities) |
If no players are given, will hide the entities from all online players.
When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.
Note: all previously hidden entities (including players) will be visible when a player leaves and rejoins.
Examples:
βif event-entity is a chicken:
βhide event-entity
reveal hidden players of players
| Patterns: |
|
| Since: | 1.0 2.7 (multiple entities, unequip) |
This effect will replace any armor that the entity is already wearing.
Examples:
equip player with diamond leggings, diamond chestplate, and diamond boots
unequip diamond chestplate from player
unequip player's armor
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
set {_component} to the equippable component of {_item}
prevent {_component} from being dispensed
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.5+ |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
set {_component} to the equippable component of {_item}
if {_component} will lose durability when injured:
βmake {_component} lose durability on injury
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.6+ |
Examples:
set {_component} to the equippable component of {_item}
if {_component} can be sheared off of entities:
βprevent {_component} from being sheared off of entities
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
set {_component} to the equippable component of {_item}
prevent {_component} from swapping equipment on right click
| Patterns: |
|
| Since: | unknown (before 2.1) |
Examples:
βloop-block is not air:
βexit 2 sections
βset loop-block to water
| Patterns: |
|
| Since: | 2.11 |
Using `by` adds/subtracts from the current size of the world border.
Using `to` sets to the specified size.
Examples:
shrink world border of world "world" to 100 over 10 seconds
| Patterns: |
|
| Since: | 2.5 |
Examples:
stop ignition of the last spawned creeper
| Patterns: |
|
| Since: | 1.0 |
Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0.
Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.
Examples:
create an explosion of force 0 at the victim
| Patterns: |
|
| Since: | 2.17 |
Examples:
βtrigger:
βif the number argument is greater than the player's balance:
βfail the command execution with the error message "Your balance is less than $%number argument%!"
| Patterns: |
|
| Since: | 2.5.1, 2.13 (multiple, amount) |
| Requirements: | Minecraft 1.15.2+ |
Using 'attack' will make the attacker use the item in their main hand and will apply extra data from the item, including enchantments and attributes.
Using 'damage' with a number of hearts will not account for the item in the main hand and will always be the number provided.
Examples:
make last spawned wolf attack all players
spawn a zombie at location(0, 0, 0)
make player damage last spawned zombie by 2
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda stop eating
| Patterns: |
|
| Since: | 2.10 |
Examples:
force the player's tool to stop glinting
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda get off its back
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
βforce event-player to respawn
| Patterns: |
|
| Since: | 2.10 |
Note that if the inventory is full, it will cause warnings in the console due to over-filling the inventory.
Examples:
generate loot using "minecraft:chests/shipwreck_supply" in {_inventory}
| Patterns: |
|
| Since: | 2.11 |
Examples:
regrow {_goat}'s horns
remove both horns of all goats
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βmake entity left handed
make all zombies in radius 10 of player right handed
| Patterns: | |
| Since: | 2.3 |
Examples:
βhide {vanished::*} from the server list
| Patterns: |
|
| Since: | 2.11 |
| Requirements: | Minecraft 1.21+ |
The entity must be of the right type for the block (e.g. bee for beehive).
Due to unstable behavior on older versions, adding entities to an entity storage requires Minecraft version 1.21+.
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
allow all dropped items to naturally despawn
| Patterns: |
|
| Since: | 2.9.0 |
| Requirements: | Spigot 1.20.5+ |
If changing the 'entire' tooltip of an item, nothing will show up when a player hovers over it.
If changing the 'additional' tooltip, only specific parts (which change per item) will be hidden.
Examples:
hide {_item}'s additional tool tip
| Patterns: |
|
| Since: | 2.4 |
| Usable in events: | death |
Examples:
βif the victim is an op:
βkeep the inventory and experiences
| Patterns: |
|
| Since: | 1.0 |
Examples:
βkick the player due to "You may not place %block%!"
βcancel the event
| Patterns: |
|
| Since: | 1.0, 2.10 (ignoring totem of undying) |
Examples:
kill all creepers in the player's world
kill all endermen, witches and bats
| Patterns: |
|
| Since: | 2.7 |
Examples:
knock victim (vector from attacker to victim) with strength 10
| Patterns: |
|
| Since: | 2.4 |
Examples:
| Patterns: | |
| Since: | 2.3, 2.16 (all leashable entities) |
Most mobs, iron golems, snow golems, and boats can be leashed.
Examples:
βleash event-entity to player
βsend "&aYou leashed &2%event-entity%!" to player
| Patterns: |
|
| Since: | 1.4 |
Examples:
strike lightning effect at the victim
| Patterns: |
|
| Since: | 2.3 |
last loaded server icon expression.
Please note that the image must be 64x64 and the file path starts from the server folder.
Examples:
βclear {server-icons::*}
βloop 5 times:
βload server icon from file "icons/%loop-number%.png"
βadd the last loaded server icon to {server-icons::*}
on server list ping:
βset the icon to a random server icon out of {server-icons::*}
| Patterns: |
|
| Since: | 2.8.0 |
The load effect will create a new world if world doesn't already exist.
When attempting to load a normal vanilla world you must define it's environment i.e "world_nether" must be loaded with nether environment
Examples:
load the world "myCustomWorld"
unload "world_nether"
unload "world_the_end" without saving
unload all worlds
| Patterns: | |
| Since: | 2.0, 2.9.0 (severities) |
NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.
Examples:
βlog "%player% has just joined the server!"
on world change:
βlog "Someone just went to %event-world%!" to file "worldlog/worlds.log"
on command:
βlog "%player% just executed %full command%!" to file "server/commands.log" with a severity of warning
| Patterns: |
|
| Since: | 2.7 |
Examples:
on entity explosion:
βset {_player} to the nearest player
β{_player} is set
βdistance between {_player} and the event-location is less than 15
βmake {_player} look towards vector from the {_player} to location of the event-entity
force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40
| Patterns: |
|
| Since: | 2.10 |
Examples:
βentity is not an adult
βmake entity an adult
| Patterns: |
|
| Since: | 2.11 |
This effect will always make an allay duplicate regardless of whether the duplicate attribute is disabled.
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βmake entity unbreedable
| Patterns: |
|
| Since: | 2.11 |
The warden will not investigate if the warden is aggressive towards an entity.
This effect does not add anger to the warden.
Examples:
| Patterns: |
|
| Since: | 2.7 |
| Usable in events: | Egg Throw |
Examples:
β# EGGS FOR DAYZ!
βmake the egg hatch
| Patterns: |
|
| Since: | 2.11 |
Examples:
βforce last spawned goat to stop screaming
βmake {_enderman} scream
βforce {_enderman} to stop screaming
| Patterns: |
|
| Since: | 2.9.0 |
| Requirements: | Spigot 1.20.5+ |
Examples:
make {_items::*} not resistant to fire
| Patterns: |
|
| Since: | 2.11 |
Ramming does have a cooldown and currently no way to change it.
Examples:
| Patterns: | |
| Since: | 2.5 |
Examples:
βmake the explosion fiery
| Patterns: | |
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.7 |
When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility.
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda start rolling
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda start sneezing
| Patterns: | |
| Since: | 2.3 |
Examples:
force all players to send the message "I love this server"
| Patterns: |
|
| Since: | 2.8.0 2.17 (sign side support) |
Examples:
| Patterns: | |
| Since: | 1.0 2.2-dev26 (advanced features) 2.6 (support for sending anything) |
Only styles written in given string or in formatted expressions will be parsed.
Examples:
message "This message is a distraction. Mwahaha!"
send "Your kill streak is %{kill streak::%uuid of player%}%." to player
if the targeted entity exists:
βmessage "You're currently looking at a %type of the targeted entity%!"
| Patterns: |
|
| Since: | 2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser) |
Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.
Examples:
open the player's inventory for the player
| Patterns: |
|
| Since: | 2.7 |
Examples:
make all cows stop pathfinding
make event-entity pathfind towards player at speed 1
| Patterns: | |
| Since: | 2.11 |
Persistence of entities is whether they are retained through server restarts.
Persistence of leaves is whether they should decay when not connected to a log block within 6 meters.
Persistence of players is if the player's playerdata should be saved when they leave the server. Players' persistence is reset back to 'true' when they join the server.
Passengers inherit the persistence of their vehicle, meaning a persistent zombie put on a non-persistent chicken will become non-persistent. This does not apply to players.
By default, all entities are persistent.
Examples:
force {_leaves} to persist
command /kickcheater <cheater: player>:
βpermission: op
βtrigger:
βprevent {_cheater} from persisting
βkick {_cheater}
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev28, 2.4 (sound categories), 2.9 (sound seed & entity emitter) |
When running 1.19+, playing a sound from an entity directly will result in the sound coming from said entity, even while moving.
If the sound is custom, a location emitter will follow the entity. Do note that pitch and volume
are reflected based on the entity, and Minecraft may not use the values from this syntax.
Minecraft sometimes has a set of sounds under one sound ID that will randomly play. To counter this, you can directly state which seed to use.
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
play sound "custom.music.1" in jukebox category at {speakerBlock}
play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 on target entity for the player
| Patterns: |
|
| Since: | 2.14 |
All effects vary significantly in availability from version to version, and some may simply not function on your version of Minecraft. Some effects, like the death animation entity effect, may cause client glitches and should be used carefully!
Examples:
force draw 10 red dust particles of size 3 for player
play blue instant splash potion break effect with a view radius of 10
play ravager attack animation on player's target
| Patterns: |
|
| Since: | 2.3 |
| Usable in events: | server list ping |
The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the
hover hist when hiding player info.
The version string can override the ???.
Also the Online Players Count and
Max Players expressions will return -1 when hiding player info.
Examples:
hide player related information in the server list
reveal all player related info
| Patterns: |
|
| Since: | 1.3.2 |
Examples:
poison the victim for 20 seconds
cure the player from of poison
| Patterns: |
|
| Since: | 2.14 |
That is, whether the potion effect produces more, translucent, particles.
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
That is, whether the potion effect will ever expire.
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: | |
| Since: | 1.4.6 2.12 (push towards) |
Examples:
push the victim downwards at speed 0.5
push player towards player's target at speed 2
pull player along vector(1,1,1) at speed 1.5
| Patterns: |
|
| Since: | 2.10 |
Item tags should be used for contexts where the item is not placed down, while block tags should be used for contexts where the item is placed. For example, and item tag could be "skript:edible", while a block tag would be "skript:needs_water_above".
All custom tags will be given the namespace "skript", followed by the name you give it. The name must only include the characters A to Z, 0 to 9, and '/', '.', '_', and '-'. Otherwise, the tag will not register.
Please note that two tags can share a name if they are of different types. Registering a new tag of the same name and type will overwrite the existing tag. Tags will reset on server shutdown.
Examples:
register an item tag named "skript:wasp_weapons/swords" containing diamond sword and netherite sword
register block tag named "pokey" containing sweet berry bush and bamboo sapling
on player move:
βblock at player is tagged as tag "skript:pokey"
βdamage the player by 1 heart
| Patterns: | |
| Since: | 2.11 |
| Requirements: | Minecraft 1.21 |
When using beehives, providing a timespan will prevent the released bees from re-entering the beehive for that amount of time.
Due to unstable behaviour on older versions, this effect requires Minecraft version 1.21+.
Examples:
release the entity storage of {_hive} for 5 seconds
| Patterns: |
|
| Since: | 2.0, 2.2-dev24 (multiple strings, items in inventory), 2.5 (replace first, case sensitivity), 2.10 (regex) |
Examples:
replace every "&" with "Β§" in line 1 of targeted block
# Very simple chat censor
on chat:
βreplace all "idiot" and "noob" with "****" in the message
βregex replace "\b(idiot|noob)\b" with "****" in the message # Regex version using word boundaries for better results
replace all stone and dirt in player's inventory and player's top inventory with diamond
| Patterns: |
|
| Since: | 2.2, 2.8.0 (returns aliases) |
Examples:
βreturn 2 * {_i}
function divide(i: number) returns number:
βreturn {_i} / 2
| Patterns: | |
| Since: | 2.9.0 |
Optionally, the entity that rang the bell and the direction the bell should ring can be specified.
A bell can only ring in two directions, and the direction is determined by which way the bell is facing.
By default, the bell will ring in the direction it is facing.
Examples:
| Patterns: |
|
| Since: | 2.2-dev28, 2.10 (quaternions, displays) |
Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis.
Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once.
Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Rotating a display is a shortcut for rotating its left rotation. If the right rotation needs to be modified, it should be acquired, rotated, and re-set.
Note that rotating a quaternion/display around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating quaternions/displays around vector(1, 0, 0) is the same as rotating around the local X axis.
The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
Examples:
rotate last spawned block display around y axis by 10 degrees
rotate {_vector} around vector(1, 1, 1) by 45
rotate {_quaternion} by x 45, y 90, z 135
| Patterns: |
|
| Since: | 2.10 |
Examples:
run {_function}
run {_function} with arguments {_things::*}
| Patterns: |
|
| Since: | 2.8.0 |
Note: saving many worlds at once may possibly cause the server to freeze.
Examples:
save all worlds
| Patterns: | |
| Since: | 2.17 |
Examples:
βsuggestions:
βplayer argument is set # they are writing the text argument
βif the current input contains "frick":
βset the suggestions for the text argument to "Keep your messages nice please!"
βdisable filtering for the text argument's suggestions
βtrigger:
βsend "<grey><italic>%player% -> You: %text argument%" to player argument
βsend "<grey><italic>You -> %player argument%: %text argument%" to player
| Patterns: | |
| Since: | 2.2-dev37c, 2.5.1 (block data support), 2.12 (as original) |
Examples:
make player see player's target block as campfire[facing=south]
make all players see (blocks in radius 5 of location(0, 0, 0)) as bedrock
make all players see (blocks in radius 5 of location(0, 0, 0)) as original
| Patterns: | |
| Since: | 2.4 |
the resource pack in the background, and will automatically switch to it once the download is complete.
The URL must be a direct download link.
The hash is used for caching, the player won't have to re-download the resource pack that way.
The hash must be SHA-1, you can get SHA-1 hash of your resource pack using
this online tool.
The resource pack request action can be used to check
status of the sent resource pack request.
Examples:
βsend the resource pack from "URL" with hash "hash" to the player
| Patterns: |
|
| Since: | 2.0 (cows, sheep & snowmen), 2.8.0 (all shearable entities) |
Please note that..:
- Force-shearing or un-shearing on a sheared mushroom cow is not possible
Examples:
βshear the clicked sheep
βchance of 10%
βforce shear the clicked sheep
| Patterns: |
|
| Since: | 2.9.0, 2.10 (sort order) |
When using the full sort %~objects% (by|based on) <expression> pattern, the input expression can be used to refer to the current item being sorted. (See input expression for more information.)
Examples:
sort {_words::*} # alphabetical sort
sort {_words::*} by length of input # shortest to longest
sort {_words::*} in descending order by length of input # longest to shortest
sort {_words::*} based on {tastiness::%input%} # sort based on custom value
| Patterns: | |
| Since: | 2.11 |
If the player is not moving when this effect is used, they will be put in sprint mode for a tick and then stopped (this causes the FOV to change). Using it a second time, without the player manually sprinting in between, causes the player to stay in sprint mode, with some quirks.
- Particles may not be produced under the player's feet.
- The player will not exit the sprinting state if they stop moving.
- Restrictions like low hunger will not prevent the player from sprinting
- The player pressing shift will stop them sprinting, and pressing sprint will re-assert normal sprinting behavior
Using this effect two or more consecutive times on a stationary player produces undefined behavior and should not be relied on.
Examples:
force player to start sprinting
| Patterns: |
|
| Since: | 2.5 |
Examples:
restart server
| Patterns: |
|
| Since: | 2.4, 2.7 (stop all sounds) |
Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.
Examples:
stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player
stop all sounds for all players
stop sound in the record category
| Patterns: |
|
| Since: | 2.12 |
Examples:
βmake last spawned strider stop shivering
| Patterns: |
|
| Since: | 2.5.1 |
| Requirements: | Minecraft 1.15.2+ |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
untame {_horse}
| Patterns: |
|
| Since: | 1.0, 2.10 (flags) |
Examples:
teleport the attacker to the victim
on dismount:
βcancel event
βteleport the player to {server::spawn} retaining vehicle and passengers
| Patterns: | |
| Since: | 2.10 |
Examples:
if {_display} has drop shadow:
βremove drop shadow from the text of {_display}
| Patterns: | |
| Since: | 2.10 |
Examples:
prevent all text displays from being visible through walls
| Patterns: | |
| Since: | 2.3, 2.15 (clearing the title) |
While both actions remove the title being displayed,
reset will also reset the title timings. Examples:
clear the title
| Patterns: | |
| Since: | 2.3 2.15 (support for showing anything) |
If sending only the subtitle, it will only be shown if the audience currently has a title displayed. Otherwise, it will be shown when the audience is next shown a title.
Additionally, if no input is given for the times, the previous times of the last sent title will be used (or default values). Use the reset title effect to restore the default values for the times.
Examples:
send title "Hi %player%" to player
send title "Loot Drop" with subtitle "starts in 3 minutes" to all players
send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second
send subtitle "Party!" to all players
| Patterns: |
|
| Since: | 1.4, 2.12 (booleans) |
Examples:
on projectile hit:
βprojectile is arrow
βtoggle the block at the arrow
# With booleans
toggle gravity of player
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
send "You can no longer pick up items!" to player
on drop:
βif player can't pick up items:
βallow player to pick up items
| Patterns: |
|
| Since: | 2.10 |
Evaluates the given expression for each element in the list, replacing the original element with the expression's result.
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.
Only variable lists can be transformed with this effect. For other lists, see the transform expression.
Examples:
transform {_a::*} using input * 2
# {_a::*} is now 2, 4, and 6
# get a list of the sizes of all clans without manually looping
set {_clan-sizes::*} to indices of {clans::*}
transform {_clan-sizes::*} using {clans::%input%::size}
# set all existing values of a list to 0:
transform {_list::*} with 0
| Patterns: |
|
| Since: | 1.0 |
This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.
Examples:
| Patterns: |
|
| Since: | 2.10 |
Using 'without physics' will not send updates to the surrounding blocks of the blocks being set.
Example: Updating a block next to a sand block in the air 'without physics' will not cause the sand block to fall.
Examples:
update {_blocks::*} to be sand without physics updates
update {_blocks::*} as stone without neighbouring updates
| Patterns: |
|
| Since: | 2.0 |
Examples:
make the attacker ride the victim
| Patterns: |
|
| Since: | 2.11 |
Make villagers sleep by providing a location of a bed.
Make players sleep by providing a location of a bed. Using 'with force' will bypass "nearby monsters" ,the max distance, allowing players to sleep even if the bed is far away, and lets players sleep in the nether and end. Does not work if the location of the bed is not in the world the player is currently in.
Using 'without spawn location update' will make players wake up without setting their spawn location to the bed.
Examples:
make {_bat} stop sleeping
make {_villager} start sleeping at location(0, 0, 0)
make player go to sleep at location(0, 0, 0) with force
make player wake up without spawn location update
| Patterns: |
|
| Since: | 2.11 |
This effect removes the old entity and creates a new entity.
Zombifying a villager stored in a variable will update the variable to the new zombie villager.
Curing a zombie villager does not update the variable.
Examples:
set {_villager} to last spawned villager
zombify {_villager}
if {_villager} is a zombie villager:
β# This will pass because '{_villager}' gets changed to the new zombie villager
set {_villager} to last spawned villager
zombify last spawned villager
if {_villager} is a zombie villager:
β# This will fail because the variable was not provided when zombifying
unzombify {_zombieVillager}
unzombify {_zombieVillager} after 2 seconds
| Patterns: |
|
| Since: | 1.0 |
Examples:
deop all players
| Patterns: |
|
| Since: | 1.4, 2.16 (Delayed Sections) |
When used as an effect, all code after the
wait runs once the delay elapses. The whole trigger pauses until the wait finishes.When used as a section, only the code within the section is deferred. Code after the section continues immediately, and the body runs on the same event once the delay elapses. This is useful for scheduling follow-up work without blocking the rest of the trigger.
Note that delays are not persistent. For example,
ban player β wait 7 days β unban player will not resume if the server restarts during the delay.Inside a section body, outer
loop-values are not available because the body is parsed as a separate trigger. Event values (like player) still work. If you need a value from before the delay, copy it to a local variable. Local variables are snapshotted when the section is scheduled, so subsequent changes aren't reflected. Examples:
halt for 5 minecraft hours
wait a tick
# Section form: outer continues immediately, body runs 3 seconds later.
send "hello" to player
wait 3 seconds:
βsend "...and goodbye" to player
send "This runs first!" to player
wait 1 seconds:
βsend "This runs third! (one second later)" to player
send "This runs second!" to player
| Patterns: |
|
| Since: | 2.3 2.17 (suppressing in a section) |
Examples:
suppress the variable save warnings
| Patterns: |
|
| Since: | 2.10 |
Examples:
shoot a pig from all players:
βadd event-entity to {_projectiles::*}
| Patterns: |
|
| Since: | 1.0, 2.6.1 (with section), 2.8.6 (dropped items), 2.10 (entity snapshots) |
| Requirements: | Minecraft 1.20.2+ (entity snapshots) |
If it is used as a section, the section is run before the entity is added to the world.
You can modify the entity in this section, using for example 'event-entity' or 'cow'.
Do note that other event values, such as 'player', won't work in this section.
If you're spawning a display and want it to be empty on initialization, like not having a block display be stone, set hidden config node 'spawn empty displays' to true.
Note that when spawning an entity via entity snapshots, the code within the section will not run instantaneously as compared to spawning normally (via 'a zombie').
Examples:
spawn a ghast 5 meters above the player
spawn a zombie at the player:
βset name of the zombie to ""
spawn a block display of a ladder[waterlogged=true] at location above player:
βset billboard of event-display to center # allows the display to rotate around the center axis
| Patterns: |
|
| Since: | 2.12 2.17 (suppressing in a section) |
Examples:
# potentially unsafe code goes here
stop suppressing local variable type hints
| Patterns: |
|
| Since: | 2.11 |
Examples:
βdisallow last spawned to duplicate
| Patterns: |
|
| Since: | 2.13 |
| Usable in events: | Brewing Fuel |
Examples:
βif the brewing stand will consume the fuel:
βprevent the brewing stand from consuming the fuel
| Patterns: |
|
| Since: | 2.11 |
Examples:
βkill last spawned camel
| Patterns: |
|
| Since: | 2.10 |
Examples:
βentity can't age
βbroadcast "An immortal has been born!" to player
| Patterns: |
|
| Since: | 2.10 |
Examples:
βevent-entity can't breed
βsend "Turns out %event-entity% is not breedable. Must be a Skript user!" to player
| Patterns: |
|
| Since: | 2.0 |
| Requirements: | Supported regions plugin |
This condition requires a supported regions plugin to be installed.
Examples:
βdescription: set the block at your crosshair to a different type
βtrigger:
βplayer cannot build at the targeted block:
βmessage "You do not have permission to change blocks there!"
βstop
βset the targeted block to argument
| Patterns: |
|
| Since: | 2.11 |
More information on what and when entities despawn can be found at reference.
Examples:
βmake last spawned entity not despawn on chunk unload
| Patterns: |
|
| Since: | 1.0 |
Examples:
player has enough space for 64 feathers
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βsend "You can pick up items!" to player
on drop:
βif player can't pick up items:
βsend "Be careful, you won't be able to pick that up!" to player
| Patterns: | |
| Since: | 2.3, 2.10 (entities) |
| Requirements: | Minecraft 1.19+ (entities) |
Examples:
βmessage "who dat?"
if the player can see the last spawned entity:
βmessage "hello there!"
| Patterns: | |
| Since: | 2.10 |
Examples:
βsend "Find the red word in <red>this<reset> message."
else:
βsend "You cannot partake in finding the colored word."
| Patterns: | |
| Since: | 2.10 |
Examples:
βsend "You can see all messages."
if player can only see commands:
βsend "This game doesn't work with commands-only chat."
if player can't see any messages:
βsend action bar "Server shutting down in 5 minutes!"
| Patterns: |
|
| Since: | 1.0, 2.14 (chance fails) |
Examples:
βdrop a diamond at location(100, 100, 100, "world')
chance of {chance}% # {chance} between 0 and 100
chance of {chance} # {chance} between 0 and 1
if chance of 99% fails:
βbroadcast "Haha loser! *points and laughs*"
| Patterns: |
|
| Since: | 2.17 |
| Usable in events: | sign change |
Examples:
βthe back side was changed
βcancel the event
βsend "<red>It is not possible to change the back side of a sign!" to the player
| Patterns: |
|
| Since: | 1.0 |
Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with
(was|were) or will be instead of (is|are) respectively, which check different time states of the first expression. Examples:
time in the player's world is greater than 8:00
the creature is not an enderman or an ender dragon
| Patterns: |
|
| Since: | Unknown |
Examples:
player has 4 flint and 2 iron ingots
{list::*} contains 5
names of {list::*} contain "prefix"
contents of the inventories of all players contain 1 stick
| Patterns: |
|
| Since: | 2.0 |
Examples:
on damage:
βdamage was caused by lava, fire or burning
βvictim is a player
βvictim has a potion of fire resistance
βcancel event
βapply fire resistance to the victim for 30 seconds
βremove 1 potion of fire resistance from the victim
# prevent mobs from dropping items under certain circumstances
on death:
βentity is not a player
βdamage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison
βclear drops
| Patterns: |
|
| Since: | 2.12 |
Examples:
βif event-damage source scales damage with difficulty:
| Patterns: |
|
| Since: | 2.12 |
Vanilla damage sources are considered indirect if the 'causing entity' and the 'direct entity' are not the same. For example, taking damage from an arrow that was shot by an entity.
Examples:
βif event-damage source was indirectly caused:
| Patterns: |
|
| Since: | 2.7 |
| Requirements: | Minecraft 1.16+ |
Examples:
| Patterns: |
|
| Since: | 2.7 |
| Usable in events: | Egg Throw |
Examples:
βif an entity won't hatch:
βsend "Better luck next time!" to the player
| Patterns: |
|
| Since: | 2.11 |
This will return true as long as the entity that stared at the enderman is still alive.
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βsend "This entity has nothing left to shear!" to player
| Patterns: | |
| Since: | 2.11 |
Examples:
βrelease the entity storage of {_beehive}
| Patterns: | |
| Since: | 2.6.1 |
Examples:
if player is in water:
player is in lava:
player is in bubble column
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
βadd "Dispensable" to lore of {_item}
set {_component} to the equippable component of {_item}
if {_component} is not able to be dispensed:
βallow {_component} to be dispensed
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.6+ |
Examples:
βadd "Shearable" to lore of {_item}
set {_component} to the equippable component of {_item}
if {_component} can not be sheared off:
βallow {_component} to be sheared off
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.5+ |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
βadd "Swappable" to lore of {_item}
set {_component} to the equippable component of {_item}
if {_component} can not be equipped when right clicked:
βmake {_component} swappable
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
βadd "Damageable on injury" to lore of {_item}
set {_component} to the equippable component of {_item}
if {_component} won't lose durability on injury:
βmake {_component} lose durability when injured
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
βif event is cancelled:
βbroadcast "no clicks allowed!"
| Patterns: | |
| Since: | 1.2 |
Examples:
on damage:
βprojectile exists
βbroadcast "%attacker% used a %projectile% to attack %victim%!"
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Fishing |
Examples:
βif lure enchantment bonus is applied:
βcancel event
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned goat have both horns
βif {_goat} has a right horn:
βforce {_goat} to not have a right horn
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: | |
| Since: | 2.16 |
Examples:
βbroadcast "It's getting dark around here.."
| Patterns: | |
| Since: | 2.10 |
Examples:
βsend "<gray>This server may contain mature chat messages. You have been warned!" to player
| Patterns: | |
| Since: | 2.3 |
Examples:
βmessage "Your custom weather is %player's weather%"
| Patterns: |
|
| Since: | 2.5, 2.12 (expanded data types) |
| Requirements: | Minecraft 1.21.4+ (floats/flags/strings/colours) |
Examples:
if player's tool has custom model data flags:
βloop custom model data flags of player's tool:
βsend "Flag %loop-index%: %loop-value%"
set {_coloured} to whether player's tool has model data colours
| Patterns: |
|
| Since: | 2.8.0 2.17 (sign side support) |
Examples:
| Patterns: |
|
| Since: | 2.8.0 2.12 (cooldown group) |
| Requirements: | MC 1.21.2 (cooldown group) |
Examples:
βsend "You can't use this item right now. Wait %item cooldown of player's tool for player%"
| Patterns: |
|
| Since: | 2.9.0 |
| Requirements: | Spigot 1.20.5+ |
The 'entire tooltip' is what shows to the player when they hover an item (i.e. name, lore, etc.).
The 'additional tooltip' hides certain information from certain items (potions, maps, books, fireworks, and banners).
Examples:
if additional tooltip of {_item} is hidden:
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
victim has line of sight to attacker
player has no line of sight to location 100 blocks in front of player
| Patterns: | |
| Since: | 2.10 |
Examples:
if event-block has a loot table:
β# this will never happen, because it doesn't have a loot table.
set loot table of event-block to "minecraft:chests/simple_dungeon"
if event-block has a loot table:
β# this will happen, because it now has a loot table.
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
victim has the permission "admin":
βsend "You're attacking an admin!" to attacker
| Patterns: | |
| Since: | 2.15 |
Examples:
βadd 1 to {points::%{team::%player%}%}
if player's tool has persistent data tags "custom:damage" and "custom:owner":
βif data tag "custom:owner" of player's tool is not player:
βbroadcast "You are not the owner of this tool!"
βstop
βif data tag "custom:damage" of player's tool > 10:
βbroadcast "Your tool is heavily damaged!"
βelse:
βbroadcast "Your tool is in good condition."
| Patterns: |
|
| Since: | 1.4, 2.7 (multiple players) |
Examples:
player hasn't played before
| Patterns: |
|
| Since: | 2.6.1 2.14 (support for potion effects) |
An entity is considered having a potion effect if it has a potion effect with at least the specified properties.
For example, if an entity has an 'ambient speed 5' effect, they would be considered as having 'speed 5'.
For exact comparisons, consider using the Potion Effect of Entity/Item expression in an 'is' comparison.
Examples:
βmessage "You are sonic!"
if all players have speed and haste active:
βbroadcast "This server is ready to mine!"
| Patterns: | |
| Since: | 2.4 |
Examples:
| Patterns: | |
| Since: | 2.3 |
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
βloop all players in radius 3 of the last spawned creeper
βsend "RUN!!!" to the loop-player
| Patterns: | |
| Since: | 2.10 |
Note that using the 'now' expression will not be in the past or future when used directly in the condition.
Examples:
wait 5 seconds
if {_date} is in the past:
β# this will be true
if now is in the future:
β# this will be false
set {_dates::*} to 1 day from now, 12 days from now, and 1 year from now
if {_dates::*} are in the future:
β# this will be true
if {_dates::*} have passed:
β# this will be false
| Patterns: |
|
| Since: | 2.10 |
Examples:
βevent-entity is not an adult
βkill event-entity
| Patterns: | |
| Since: | 2.0, 2.4-alpha4 (non-living entity support) |
Examples:
on shoot:
βwhile the projectile is alive:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βevent-entity is a baby
βkill event-entity
| Patterns: |
|
| Since: | 1.4 |
Examples:
victim is not IP-banned
"127.0.0.1" is banned
| Patterns: |
|
| Since: | 2.7 |
| Usable in events: | respawn |
| Requirements: | Minecraft 1.16+ |
Examples:
βthe respawn location is a bed
βbroadcast "%player% is respawning in their bed! So cozy!"
| Patterns: |
|
| Since: | 2.4 |
Examples:
{list::*} are blocks
| Patterns: | |
| Since: | 2.5 |
Examples:
βsend "This block is well-powered by redstone!"
if clicked block is indirectly redstone powered:
βsend "This block is indirectly redstone powered."
| Patterns: | |
| Since: | unknown (before 2.1) |
Examples:
βvictim is blocking
βdamage attacker by 0.5 hearts
| Patterns: | |
| Since: | 1.4.4 |
Examples:
victim is burning:
βincrease damage by 2
| Patterns: | |
| Since: | 2.5, 2.10 (withers, wither skulls) |
Examples:
βbroadcast "A charged creeper is at %location of last spawned creeper%"
| Patterns: |
|
| Since: | 2.11 |
Examples:
βkill last spawned ghast
| Patterns: |
|
| Since: | 2.8.0 |
| Requirements: | Minecraft 1.17+ |
Examples:
wait a second
if the last spawned spider is climbing:
βmessage "The spider is now climbing!"
| Patterns: | |
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
βbroadcast "Dance Party!"
| Patterns: |
|
| Since: | 2.11 |
Examples:
βforce last spawned panda to stop eating
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
player's tool is edible
| Patterns: |
|
| Since: | 1.4.6, 2.12 ('or better') |
Examples:
if player's helmet or player's boots are enchanted with protection 3 or better:
if player's chestplate is enchanted with protection
| Patterns: |
|
| Since: | 2.10, 2.12 (tolerance) |
Examples:
if 11 cannot be evenly divided by 10:
if 0.3 can be evenly divided by 0.1 with a tolerance of 0.0000001:
| Patterns: |
|
| Since: | 2.9.0 |
| Requirements: | Spigot 1.20.5+ |
Examples:
if {_items::*} aren't resistant to fire:
| Patterns: | |
| Since: | 2.10 |
| Usable in events: | Fishing |
Open water is defined by a 5x4x5 area of water, air and lily pads. If in open water, treasure items may be caught.
Examples:
βif fish hook is in open water:
βsend "You will catch a shark soon!"
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
player's tool is flammable
| Patterns: | |
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.5.1 |
Examples:
βif player's tool is not fuel:
βsend "Please hold a valid fuel item in your hand"
βcancel event
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
Hands are raised when an entity is using an item (eg: blocking, drawing a bow, eating).
Examples:
βif victim's main hand is raised:
βdrop player's tool at player
βset player's tool to air
| Patterns: |
|
| Since: | 1.0 |
Examples:
victim isn't holding a diamond sword of sharpness
| Patterns: |
|
| Since: | 2.10 |
Examples:
βif entity is in love:
βbroadcast "That was quick!"
| Patterns: | |
| Since: | 2.5 |
Examples:
βif the explosion is fiery:
βbroadcast "A fiery explosive has been ignited!"
| Patterns: |
|
| Since: | 2.7 |
Examples:
if timespan argument is infinite:
| Patterns: |
|
| Since: | 2.5.2 |
Examples:
βif event-block is interactable:
βcancel event
βsend "You cannot break interactable blocks!"
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: | |
| Since: | 2.5, 2.10 (gamemode) |
Examples:
loop all gamemodes:
βif loop-value is not invulnerable:
βbroadcast "the gamemode %loop-value% is vulnerable!"
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βwhile event-entity is not jumping:
βwait 5 ticks
βpush event-entity upwards
| Patterns: | |
| Since: | 2.3, 2.5 (revamp with chunk at location/coords), 2.10 (Scripts) |
'chunk at 1, 1' uses chunk coordinates, which are location coords divided by 16.
Examples:
if chunk 1, 10 in world "world" is loaded:
if world("lobby") is loaded:
if script named "MyScript.sk" is loaded:
| Patterns: | |
| Since: | 2.10 |
Examples:
set {_pig} to last spawned entity
if {_pig} is lootable:
βset loot table of {_pig} to "minecraft:entities/cow"
β# the pig will now drop the loot of a cow when killed, because it is indeed a lootable entity.
set block at event-location to chest
if block at event-location is lootable:
βset loot table of block at event-location to "minecraft:chests/simple_dungeon"
β# the chest will now generate the loot of a simple dungeon when opened, because it is indeed a lootable block.
set block at event-location to white wool
if block at event-location is lootable:
β# uh oh, nothing will happen because a wool is not a lootable block.
| Patterns: |
|
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
This condition requires a supported regions plugin to be installed.
Examples:
βplayer is the owner of the region
βmessage "Welcome back to %region%!"
βsend "%player% just entered %region%!" to all members of the region
| Patterns: |
|
| Since: | 2.5.1 |
Examples:
| Patterns: |
|
| Since: | 1.4 |
Examples:
player-argument is offline
while player is connected:
βwait 60 seconds
βsend "hello!" to player
# The following will act like `{_player} is online`.
# Using variables with `is connected` will not behave the same as with non-variables.
while {_player} is connected:
βbroadcast "online!"
βwait 1 tick
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: | |
| Since: | 2.5.1 |
A block is passable if it has no colliding parts that would prevent players from moving through it.
Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.
Examples:
| Patterns: |
|
| Since: | 2.9.0 |
Can only be a living entity that is a Mob.
Examples:
while {_entity} is pathfinding
βwait a second
launch flickering trailing burst firework colored red at location of {_entity}
subtract 10 from {defence::tower::health}
clear entity within {_entity}
| Patterns: | |
| Since: | 2.11 |
Persistence of entities is whether they are retained through server restarts.
Persistence of leaves is whether they should decay when not connected to a log block within 6 meters.
Persistence of players is if the player's playerdata should be saved when they leave the server. Players' persistence is reset back to 'true' when they join the server.
Passengers inherit the persistence of their vehicle, meaning a persistent zombie put on a non-persistent chicken will become non-persistent. This does not apply to players.
By default, all entities are persistent.
Examples:
βif event-entity is persistent:
βmake event-entity not persistent
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned axolotl stop playing dead
| Patterns: | |
| Since: | 2.6 |
Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file.
When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server.
When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.
Examples:
if plugin "WorldGuard" is not enabled:
if plugins "Essentials" and "Vault" are enabled:
if plugin "MyBrokenPlugin" is disabled:
| Patterns: |
|
| Since: | 1.4.4 |
Examples:
βcure the player from poison
βmessage "You have been cured!" to the player
| Patterns: |
|
| Since: | 2.7 |
| Requirements: | 1.16.5+, Paper 1.19.2+ (blockdata) |
Examples:
βevent-block is set
βif player's tool is the preferred tool for event-block:
βbreak event-block naturally using player's tool
βelse:
βcancel event
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
βif player is pressing forward movement key:
βsend "You are moving forward!"
| Patterns: | |
| Since: | 2.14 |
Examples:
if last spawned interaction is unresponsive:
| Patterns: |
|
| Since: | 2.0, 2.11 (entities) |
Examples:
if player is riding an entity:
if player is riding a saddled pig:
if player is riding last spawned horse:
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
If 'properly' is used, this will only return true if the entity is wearing specifically a saddle item.
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned goat scream
βif {_enderman} is screaming:
βforce {_enderman} to stop screaming
| Patterns: |
|
| Since: | 1.4.4, 2.11 (living entities) |
Examples:
βmake player wake up without spawn location update
if last spawned fox is sleeping:
βmake last spawned fox stop sleeping
| Patterns: | |
| Since: | 2.3 |
Slimes can generally spawn in the swamp biome and in slime chunks.
For more info, see the Minecraft wiki.
Examples:
βtrigger:
βif chunk at player is a slime chunk:
βsend "Yeah, it is!"
βelse:
βsend "Nope, it isn't"
| Patterns: | |
| Since: | 1.4.4 |
Examples:
on target:
βtarget is sneaking
βdistance of target and the entity is bigger than 4
βcancel the event
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
player's tool isn't solid
| Patterns: |
|
| Since: | 2.13 |
Examples:
if a monster can be spawned in {_world}: # false
| Patterns: |
|
| Since: | 2.7 |
Examples:
birch wood is stackable
torch is stackable
| Patterns: |
|
| Since: | 2.3 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βenchant player's tool with sharpness 1
if all logs are tagged with tag "minecraft:logs"
| Patterns: |
|
| Since: | 2.5 |
Examples:
βif victim is tameable:
βcancel event
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
| Patterns: |
|
| Since: | 2.5.1, 2.9.0 (breakable) |
Examples:
βsend "This item is unbreakable!" to player
if tool of {_p} is breakable:
βsend "Your tool is breakable!" to {_p}
| Patterns: | |
| Since: | 2.9.0 |
Examples:
on load:
βif the script is using "example feature":
βbroadcast "You're using an experimental feature!"
| Patterns: | |
| Since: | 2.7, 2.10 (Scripts & Configs) |
An invalid entity may have died or de-spawned for some other reason.
An invalid script reference may have been reloaded, moved or disabled since.
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
target is wearing wolf armor
| Patterns: |
|
| Since: | 2.5.2, 2.9.0 (enforce, offline players) |
| Requirements: | MC 1.17+ (enforce) |
Examples:
if the server is whitelisted:
if the server whitelist is enforced:
| Patterns: |
|
| Since: | 2.7, 2.11 (world borders) |
| Requirements: | MC 1.17+ (within block) |
Note that using the is between condition will refer to a straight line between locations, while this condition will refer to the cuboid between locations.
Examples:
βsend "You are in a PvP zone!" to player
if player is in world("world"):
βsend "You are in the overworld!" to player
if attacker's location is inside of victim:
βcancel event
βsend "Back up!" to attacker and victim
if player is in world "world1" or world "world2":
βkill player
if player is in world "world" and chunk at location(0, 0, 0):
βgive player 1 diamond
| Patterns: | |
| Since: | 2.7 |
Examples:
βif attacker's location is within 10 blocks around {_spawn}:
βcancel event
βsend "You can't PVP in spawn."
| Patterns: | |
| Since: | 2.6 |
Examples:
βcommand is not a script command
β# do something only for non-custom commands
| Patterns: |
|
| Since: | 1.4 |
Examples:
victim is of type {villager type}
| Patterns: |
|
| Since: | 2.10 |
Examples:
βsend "Your tool has the enchantment glint override." to player
if {_item} is forced to glint:
βsend "This item is forced to glint." to player
else if {_item} is forced to not glint:
βsend "This item is forced to not glint." to player
else:
βsend "This item does not have any glint override." to player
| Patterns: |
|
| Since: | 2.10 |
| Usable in events: | Leash / Unleash |
Examples:
βif the leash will drop:
βprevent the leash from dropping
βelse:
βallow the leash to drop
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βif victim is left handed:
βcancel event
| Patterns: | |
| Since: | 2.10 |
Examples:
βopen the lid of {_block}
| Patterns: | |
| Since: | 2.5.2 |
Examples:
βif message partially matches "\d":
βsend "Message contains a digit!"
βif message doesn't match "[A-Za-z]+":
βsend "Message doesn't only contain letters!"
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda get off its back
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda stop rolling
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
βmake last spawned panda stop sneezing
| Patterns: |
|
| Since: | 2.14 |
Examples:
βif the potion effect has an icon:
βhide the icon of event-potioneffecttype for event-entity
| Patterns: |
|
| Since: | 2.14 |
Examples:
βif the potion effect has particles:
β hide the particles of event-potioneffecttype for event-entity
| Patterns: |
|
| Since: | 2.14 |
That is, whether the potion effect produces more, translucent, particles.
Examples:
βif the potion effect is ambient:
βmessage "It's particle time!"
| Patterns: |
|
| Since: | 2.14 |
That is, whether the effect happens once/immediately.
Examples:
βmessage "Use your tool for immediate benefits!"
| Patterns: |
|
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
This condition requires a supported regions plugin to be installed.
Examples:
on region enter:
βregion contains {flags.%world%.red}
βmessage "The red flag is near!"
| Patterns: |
|
| Since: | 2.4 |
| Usable in events: | resource pack request response |
Examples:
βif the resource pack wasn't accepted:
βkick the player due to "You have to install the resource pack to play in this server!"
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: |
|
| Since: | 2.12 |
Examples:
βmake last spawned strider stop shivering
| Patterns: | |
| Since: | 2.10 |
Examples:
βremove drop shadow from the text of {_display}
| Patterns: | |
| Since: | 2.10 |
Examples:
βprevent last spawned text display from being visible through walls
| Patterns: | |
| Since: | 2.0 |
Examples:
βtrigger:
β{command::%player's uuid%::last-usage} was less than a minute ago:
βmessage "Please wait a minute between uses of this command."
βstop
βset {command::%player's uuid%::last-usage} to now
β# ... actual command trigger here ...
| Patterns: |
|
| Since: | 2.10 |
Examples:
βif the used firework will be consumed:
βprevent the used firework from being consumed
| Patterns: |
|
| Since: | 2.11 |
Examples:
βprevent all dropped items from naturally despawning
| Patterns: |
|
| Since: | 2.11 |
Examples:
βprevent all dropped items from naturally despawning
| Patterns: |
|
| Since: | 2.12 |
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: | 1.0 |
if: executed when its condition is true
else if: executed if all previous chained conditionals weren't executed, and its condition is true
else: executed if all previous chained conditionals weren't executed
parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true
else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true
Examples:
βsend "Your health is okay so far but be careful!"
else if player's health is greater than 2:
βsend "You need to heal ASAP, your health is very low!"
else: # Less than 2 hearts
βsend "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"
parse if plugin "SomePluginName" is enabled: # parse if %condition%
β# This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section
| Patterns: |
|
| Since: | 2.10 |
It also supports filtering based on meeting any of the given criteria, rather than all, like multi-line if statements.
Examples:
filter {_a::*} to match:
βinput is a number
βmod(input, 2) = 0
βinput > 0
send {_a::*} # sends 2, 4, 6, 8, and 10
| Patterns: | |
| Since: | 2.10, 2.14 (stable release) |
When looping a simple (non-indexed) set of values, e.g. all players, the index will be the loop counter number.
Examples:
βsend "Hello %{_player}%!" to {_player}
loop {_item} in {list of items::*}:
βbroadcast {_item}'s name
for each key {_index} in {list of items::*}:
βbroadcast {_index}
loop key {_index} and value {_value} in {list of items::*}:
βbroadcast "%{_index}% = %{_value}%"
for each {_index}, {_value} in {my list::*}:
βbroadcast "%{_index}% = %{_value}%"
| Patterns: |
|
| Since: | 1.0 |
A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with βloop-
send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.Loopable Values
All expressions that represent more than one value, e.g. βall playersβ, βworldsβ, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g.
loop the victim and the attacker, to execute the same code for only a few values.List Variables
When looping list variables, you can also use
loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *). Examples:
βsend "Hello %loop-player%!" to loop-player
loop items in player's inventory:
βif loop-item is dirt:
βset loop-item to air
loop 10 times:
βsend title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc.
βwait 1 second
loop {Coins::*}:
βset {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of " +
β"the player and loop-value is the number of coins for the player
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.0, 2.6 (do while) |
Examples:
βsend "More players are needed to begin the adventure" to all players
βwait 5 seconds
set {_counter} to 1
do while {_counter} > 1: # false but will increase {_counter} by 1 then get out
βadd 1 to {_counter}
# Be careful when using while loops with conditions that are almost
# always true for a long time without using 'wait %timespan%' inside it,
# otherwise it will probably hang and crash your server.
while player is online:
βgive player 1 dirt
βwait 1 second # without using a delay effect the server will crash
| Patterns: | |
| Since: | 1.3.4 |
Examples:
at 7am in "world"
| Patterns: |
|
| Since: | 2.7 |
Note: this does not include anvil damage from falling.
Examples:
βcancel the event
| Patterns: |
|
| Since: | 2.7 |
Examples:
βevent-item is set # result item
βchance of 5%:
βset repair cost to repair cost * 50%
βsend "You're LUCKY! You got 50% discount." to player
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
| Patterns: |
|
| Since: | 2.5.1 |
Examples:
βsend "You swung your arm!"
| Patterns: |
|
| Since: | 2.5, 2.11 (equipment slots) |
Examples:
βbroadcast the old armor item
on helmet change:
| Patterns: |
|
| Since: | 2.15 |
Examples:
on attempt to attack an animal: cancel event
on attempting to attack an entity: if victim is a creeper: cancel event
on attempt to attack a zombie or creeper: attacker isn't holding a diamond sword cancel event
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βbroadcast event-player
βbroadcast event-block
βbroadcast primary beacon effect
βbroadcast secondary beacon effect
on beacon change effect:
on player change beacon effect:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βbroadcast applied effect
βbroadcast event-player
βbroadcast event-block
on primary beacon effect apply of haste:
on application of secondary beacon effect:
on beacon effect of speed:
| Patterns: |
|
| Since: | 2.10 |
Examples:
on beacon activate:
on beacon deactivate:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.9.0 |
Examples:
βsend "<red>Raiders are nearby!" to all players in radius 32 around event-block
| Patterns: |
|
| Since: | 2.9.0 |
Examples:
βsend "<gold>Ding-dong!<reset>" to all players in radius 10 of event-block
| Patterns: |
|
| Since: | 1.0 |
Examples:
βif block is tagged with minecraft tag "logs":
βsend "You can't break the holy log!"
| Patterns: |
|
| Since: | 2.10 |
- event-player: The player that broke the block
- past event-block: The block that was broken
- event-block: The block after being broken
- event-items (or drops): The drops of the block
- event-entities: The entities of the dropped items
If the breaking of the block leads to others being broken, such as torches, they will appearin "event-items" and "event-entities".
Examples:
βbroadcast event-player
βbroadcast past event-block
βbroadcast event-block
βbroadcast event-items
βbroadcast event-entities
on block drop of oak log:
| Patterns: |
|
| Since: | 2.5 |
| Requirements: | Minecraft 1.13 or newer |
Examples:
βsend "Fertilized %size of fertilized blocks% blocks got fertilized."
| Patterns: |
|
| Since: | 2.2-Fixes-V10 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev31 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev31 |
Examples:
| Patterns: |
|
| Since: | 1.0 (break), unknown (mine), 2.6 (BlockData support) |
Examples:
on break of stone:
on break of chest[facing=north]:
on break of potatoes[age=7]:
| Patterns: |
|
| Since: | 2.13 |
Examples:
| Patterns: |
|
| Since: | 2.13 |
Examples:
| Patterns: |
|
| Since: | 2.13 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βset broadcast-message to "&c[BROADCAST] %broadcasted message%"
| Patterns: |
|
| Since: | Unknown |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.6 (BlockData support) |
Examples:
on burn of oak wood, oak fences, or chests:
on burn of oak_log[axis=y]:
| Patterns: |
|
| Since: | 1.0 (basic), 2.0 ([un]cancellable) |
Please note that the data value of the block to be placed is not available in this event, only its ID.
Examples:
βcancel event
| Patterns: |
|
| Since: | 1.4.1 |
Use chat format to change message format.
Use chat recipients to edit chat recipients.
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.10 (blockdata) |
Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them.
Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.
Examples:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:
on click on chest[facing=north]:
on click on campfire[lit=true]:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.0 |
Examples:
| Patterns: |
|
| Since: | 2.0 |
Examples:
βplayer doesn't have permission "VIP"
βnumber of players is greater than 15
βkick the player due to "The last 5 slots are reserved for VIP players."
| Patterns: |
|
| Since: | 2.0 |
Examples:
| Patterns: |
|
| Since: | unknown (before 2.1) |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.7 (by entity) |
Examples:
on damage of a player:
on damage of player by zombie:
| Patterns: |
|
| Since: | 1.0 |
Examples:
on death of player:
on death of a wither or ender dragon:
βbroadcast "A %entity% has been slain in %world%!"
| Patterns: |
|
| Since: | unknown (before 2.1) |
Examples:
βsend "that'd be 19.99 please!"
| Patterns: |
|
| Since: | unknown (before 2.1), 2.7 (entity) |
Examples:
βif event-item is compass:
βcancel event
on entity drop of an egg:
βif event-entity is a chicken:
βset item of event-dropped item to a diamond
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
βif the used firework will be consumed:
βprevent the used firework from being consume
| Patterns: |
|
| Since: | 2.5 |
To get the enchanted item, see the enchant item expression
Examples:
βif the clicked button is 1: # offer 1
βset the applied enchantments to sharpness 10 and unbreaking 10
| Patterns: |
|
| Since: | 2.5 |
To get the enchant item, see the enchant item expression
Examples:
βset enchant offer 1 to sharpness 1
βset the cost of enchant offer 1 to 10 levels
| Patterns: |
|
| Since: | 2.9.0 |
Note: This does not stop enderman from targeting the player as a result of getting damaged.
Examples:
on enderman enrage:
βif player has permission "safeFrom.enderman":
βcancel event
| Patterns: |
|
| Since: | unknown, 2.5.2 (falling block), 2.8.0 (any entity support) |
event-block represents the old block and event-blockdata represents the new replacement that'll be applied to the block.
Examples:
βkill event-entity
βbroadcast "A sheep stole some grass!"
on falling block land:
βevent-entity is a falling dirt
βcancel event
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev13b |
Examples:
βkill event-entity
| Patterns: |
|
| Since: | 2.7 |
Examples:
βif entity is a wither skeleton:
βcancel event
| Patterns: |
|
| Since: | 2.2-dev13b |
Examples:
βcancel event
| Patterns: |
|
| Since: | 2.10 2.14 (action support) |
Examples:
on entity potion effect of night vision added: βmessage "You can now see in the dark!"
on entity potion effect of strength removed: βmessage "You're now weaker!"
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
Examples when it's called include; when a zombie gets cured and a villager spawns, an entity drowns in water like a zombie that turns to a drown, an entity that gets frozen in powder snow, a mooshroom that when sheared, spawns a new cow.
Examples:
on mooshroom transforming:
on zombie, skeleton or slime transform:
| Patterns: |
|
| Since: | 2.7 |
Examples:
βset {_xp} to event-experience
βbroadcast "%{_xp}%"
| Patterns: |
|
| Since: | 2.10 |
Experience cooldown is how long until a player can pick up another orb of experience.
Examples:
βbroadcast event-player
βbroadcast event-timespan
βbroadcast past event-timespan
βbroadcast xp cooldown change reason
| Patterns: |
|
| Since: | 2.0 |
Please note that this event will not fire for xp orbs spawned by plugins (including Skript) with Bukkit.
Examples:
βworld is "minigame_world"
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.6 (BlockData support) |
Examples:
on fade of snow[layers=2]
| Patterns: |
|
| Since: | 2.4 |
Examples:
βif event-colors contains red:
on firework exploding colored red, light green and black:
on firework explosion colored rgb 0, 255, 0:
βbroadcast "A firework colored %colors% was exploded at %location%!"
| Patterns: |
|
| Since: | 1.3.7 |
Examples:
βbroadcast "Welcome %player% to the server!"
| Patterns: |
|
| Since: | 2.10 2.11 (state change) |
An entity hooked event is triggered when an entity gets caught by a fishing rod.
A fish escape event is called when the player fails to click on time, and the fish escapes.
A fish approaching event is when the bobber is waiting to be hooked, and a fish is approaching.
A fishing state change event is triggered whenever the fishing state changes.
Examples:
on entity caught: βpush event-entity vector from entity to player
on fishing state change: βif event-fishing state is fish caught: βbroadcast "A fish has been caught!"
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
βif {game::%player%::playing} exists:
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βif event-block is water:
βbroadcast "Build more dams! It's starting to get wet in here"
| Patterns: |
|
| Since: | 1.0, 2.6 (BlockData support) |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.10 (specific item) |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
βcancel the event # bad idea, but you CAN do it!
| Patterns: |
|
| Since: | 1.0, 2.2-dev20 (plants), 2.8.0 (from, into, blockdata) |
"of" matches any grow event, "from" matches only the old state, "into" matches only the new state,and "from into" requires matching both the old and new states.
Using "and" lists in this event is equivalent to using "or" lists. The event will trigger if any one of the elements is what grew.
Examples:
on grow of tree:
on grow of wheat[age=7]:
on grow from a sapling:
on grow into tree:
on grow from a sapling into tree:
on grow of wheat, carrots, or potatoes:
on grow into tree, giant mushroom, cactus:
on grow from wheat[age=0] to wheat[age=1] or wheat[age=2]:
| Patterns: |
|
| Since: | 2.3 |
Works also when one or both of the slots are empty.
The event is called before the items are actually swapped,
so when you use the player's tool or player's offtool expressions,
they will return the values before the swap -
this enables you to cancel the event before anything happens.
Examples:
βevent-player's tool is a diamond sword
βcancel event
| Patterns: |
|
| Since: | 2.12 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.9.0 (by reason) |
Examples:
on player healing from a regeneration potion:
on healing of a zombie, cow or a wither:
βheal reason is healing potion
βcancel event
| Patterns: |
|
| Since: | 2.5.1 |
Examples:
βpush event-entity upwards at speed 2
| Patterns: |
|
| Since: | 1.4.4 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
The burn event will be called when the block is about do be destroyed by the fire.
Examples:
βif event-block is a ladder:
βcancel event
| Patterns: |
|
| Since: | 2.2-Fixes-V10 |
Examples:
βif event-item is stone:
βgive player 1 stone
βremove 20$ from player's balance
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
βif player's location is {location}:
βsend "You exited the shop!"
| Patterns: |
|
| Since: | 2.7 |
Examples:
βif player's current inventory is {_gui}:
βsend "You can't drag your items here!" to player
βcancel event
| Patterns: |
|
| Since: | 2.8.0 |
When this event is called, the initiator may have already removed the item from the source inventory and is ready to move it into the destination inventory.
If this event is cancelled, the items will be returned to the source inventory.
Examples:
βbroadcast "%holder of past event-inventory% is transporting %event-item% to %holder of event-inventory%!"
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
βclose player's inventory
| Patterns: |
|
| Since: | 2.5.1 |
Examples:
| Patterns: |
|
| Since: | 2.7 |
Warning: setting the event-slot to a new item can result in an infinite loop.
Examples:
βif event-item is a diamond:
βsend "You obtained a diamond!" to player
| Patterns: |
|
| Since: | 2.1.1 |
This event cannot be cancelled.
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
βcancel event
| Patterns: |
|
| Since: | 2.2-dev35 |
Examples:
βsend "Not my precious!"
βcancel event
| Patterns: |
|
| Since: | 2.5.1 |
| Requirements: | Minecraft 1.13 or newer |
Examples:
βchance of 50%:
βcancel the event
βsend "Oops! Mending failed!" to player
| Patterns: |
|
| Since: | 2.2-dev35 |
Examples:
βcancel event
| Patterns: |
|
| Since: | unknown (before 2.1) |
Examples:
βbroadcast "Someone dropped an iron sword!"
| Patterns: |
|
| Since: | 1.0 |
Examples:
βmessage "Welcome on our awesome server!"
βbroadcast "%player% just joined the server!"
| Patterns: |
|
| Since: | 2.3 |
This event requires PaperSpigot.
Examples:
βevent-player does not have permission "jump"
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.3 |
Examples:
βif player's language starts with "en":
βsend "Hello!"
| Patterns: |
|
| Since: | 2.10 |
Examples:
βsend "Baaaaa--" to player
on player leash:
βsend "<%event-entity%> Let me go!" to player
on unleash:
βbroadcast "<%event-entity%> I'm free"
on player unleash:
βsend "<%event-entity%> Thanks for freeing me!" to player
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.4 (level up/down) |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
βspawn a zombie at location of event-entity
| Patterns: |
|
| Since: | 2.7 |
For example, when opening a shipwreck chest.
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.6, 2.8.0 (turn around) |
NOTE: Move event will only be called when the entity/player moves position, keyword 'turn around' is for orientation (ie: looking around), and the combined syntax listens for both.
NOTE: These events can be performance heavy as they are called quite often.
Examples:
βif player does not have permission "player.can.move":
βcancel event
on skeleton move:
βif event-entity is not in world "world":
βkill event-entity
on player turning around:
βsend action bar "You are currently turning your head around!" to player
| Patterns: |
|
| Since: | 2.0 |
Please note that using this event can cause lag if there are many players online.
Examples:
on stepping on stone:
| Patterns: |
|
| Since: | 2.16 |
Examples:
| Patterns: |
|
| Since: | 1.4.6 |
Examples:
on block physics:
βblock is sand
βcancel event
| Patterns: |
|
| Since: | unknown (before 2.1), 2.5 (entity) |
Examples:
on entity pickup of wheat:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Cancelling will prevent piglins from dropping items, but will still make them pick up the input.
Examples:
βif barter drops contain diamond:
βsend "Diamonds belong in the money pit!" to player
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βbroadcast "A piston is extending!"
| Patterns: |
|
| Since: | 1.0 |
Examples:
βbroadcast "A piston is retracting!"
| Patterns: |
|
| Since: | 1.0, 2.6 (BlockData support) |
Examples:
on place of a furnace, crafting table or chest:
on break of chest[type=right] or chest[type=left]
| Patterns: |
|
| Since: | 2.7 |
Examples:
βsend "You entered a chunk: %past event-chunk% -> %event-chunk%!" to player
| Patterns: |
|
| Since: | 2.7 |
Cancelling this event will prevent the player from being counted as deeply sleeping unless they exit and re-enter the bed.
Examples:
βsend "Zzzz.." to player
| Patterns: |
|
| Since: | 1.0 |
Examples:
on game mode change: βsend "Wow! Your gamemode changed!"
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.21.3+ |
Note: The input keys event value is the set of keys the player is currently pressing, not the keys that were pressed or released.
Examples:
| Patterns: |
|
| Since: | 2.15 |
| Requirements: | 1.21.5+ |
The past event-slot represents the slot containing the item that will be put into the players hotbar, or nothing, if the item is not in the inventory.
The event-slot represents the slot in the hotbar where the picked item will be placed.
Both event-slots may be set to new slots.
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βcancel the event
βteleport event-projectile to block 5 above event-projectile
| Patterns: |
|
| Since: | 2.7 |
Examples:
βchance of 50%:
βcancel event
βsend "The trade was somehow denied!" to player
| Patterns: |
|
| Since: | 2.2-dev28 |
Examples:
βworld is "city"
βsend "Welcome to the City!"
| Patterns: |
|
| Since: | 1.0, 2.5.3 (entities), 2.13 (location changers) |
Cancel the event to prevent the entity from teleporting.
Examples:
βbroadcast "%player% has entered a portal!"
on player portal:
βplayer's world is world("wilderness")
βset world of event-location to player's world
βadd 9000 to x-pos of event-location
on entity portal:
βbroadcast "A %type of event-entity% has entered a portal!
| Patterns: |
|
| Since: | 1.0, 2.5.3 (event-entity support) |
| Requirements: | Minecraft 1.14+ (event-entity support) |
In Minecraft 1.14+, you can use the player in this event.
Please note that there may not always be a player (or other entity) in this event.
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.2-Fixes-V10 |
Examples:
| Patterns: |
|
| Since: | 1.0 (pressure plate), 1.4.4 (tripwire) |
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
βteleport shooter of event-projectile to event-entity
| Patterns: |
|
| Since: | 1.0 |
Examples:
βif victim's health <= 3:
βdelete event-projectile
| Patterns: |
|
| Since: | 1.0 (simple disconnection) |
Examples:
on disconnect:
| Patterns: |
|
| Since: | 2.8.0 |
Cancelling this event will skip the current arrow item and fire a new event for the next arrow item.
The arrow and bow in the event can be accessed with the Readied Arrow/Bow expression.
Examples:
βselected bow's name is "Spectral Bow"
βif selected arrow is not a spectral arrow:
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βsend "someone is using redstone" to console
| Patterns: |
|
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
This event requires a supported regions plugin to be installed.
Examples:
βmessage "Leaving %region%."
| Patterns: |
|
| Since: | 2.4 |
send resource pack effect.
The resource pack condition can be used
to check the resource pack state.
This event will be triggered once when the player accepts or declines the resource pack request,
and once when the resource pack is successfully installed or failed to download.
Examples:
βif the resource pack was declined or failed to download:
on resource pack deny:
βkick the player due to "You have to install the resource pack to play in this server!"
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev28 |
Examples:
βentity is player
βentity has permission "admin.undying"
βuncancel the event
| Patterns: |
|
| Since: | 2.5 |
Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.
Examples:
βsend "You are riptiding!"
| Patterns: |
|
| Since: | 2.0 |
The keyword 'async' indicates the trigger can be ran asynchronously,
Examples:
βset {running::%script%} to true
on unload:
βset {running::%script%} to false
| Patterns: |
|
| Since: | 2.8.0 |
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 |
The IP expression can be used to get the IP adress of the pinger.
This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).
Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.
Examples:
βset the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
βset the fake max players count to (online players count + 1)
βset the shown icon to a random server icon out of {server-icons::*}
| Patterns: |
|
| Since: | 2.0 |
Examples:
on server stop:
| Patterns: |
|
| Since: | 2.2-dev21 |
Examples:
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βif projectile is an arrow:
βsend "you shot an arrow!" to shooter
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev26 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.10 (specific item) |
Examples:
on smelt of raw iron: βbroadcast smelted item βset the smelted item to iron block
| Patterns: |
|
| Since: | 1.0 |
Examples:
on sneak toggle:
βplayer is sneaking
βpush the player upwards at speed 0.5
| Patterns: |
|
| Since: | 1.0, 2.5.1 (non-living entities) |
Examples:
on spawn of an ender dragon:
βbroadcast "A dragon has been sighted in %world%!"
| Patterns: |
|
| Since: | 1.0 |
Examples:
βbroadcast "someone changed the spawn!"
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: |
|
| Since: | 2.5 |
| Requirements: | Minecraft 1.13 or newer |
Examples:
βloop absorbed blocks:
βbroadcast "%loop-block% was absorbed by a sponge"!
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
βplayer is not sprinting
βsend "Run!"
| Patterns: |
|
| Since: | 2.10 |
Examples:
on smelting start of raw iron: βadd 20 seconds to total cook time
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
βcancel the event
on stonecutting:
βbroadcast "%player% is using stonecutter to craft %event-item%!"
| Patterns: |
|
| Since: | 2.8.0 |
Note that event-timespan will return the time the item was used for.
Examples:
βbroadcast "%player% used %event-item% for %event-timespan%."
| Patterns: |
|
| Since: | 2.3 |
| Requirements: | 1.13 or newer |
Examples:
βevent-entity does not have permission "swim"
βcancel event
| Patterns: |
|
| Since: | 2.11 |
Examples:
at 2:30am real time:
at 6:10 pm in real time:
at 5:00 am and 5:00 pm in real time:
at 5:00 and 17:00 in real time:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
βtarget is a player
| Patterns: |
|
| Since: | 1.0, 2.9.0 (entity teleport) |
When teleporting entities, the event may also be called due to a result of natural causes, such as an enderman or shulker teleporting, or wolves teleporting to players.
When teleporting players, the event can be called by teleporting through a nether/end portal, or by other means (e.g. plugins).
Examples:
on player teleport:
on creeper teleport:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.17 |
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.21.1+ |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
on vehicle collision with obsidian:
on vehicle collision with a zombie:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βentity is a player
βcancel event
| Patterns: |
|
| Since: | 1.0 |
Examples:
βif event-entity is a spider:
βkill event-entity
| Patterns: |
|
| Since: | 2.10 |
Please note that using this event can cause lag if there are multiple vehicle entities, i.e. Horse, Pig, Boat, Minecart
Examples:
βbroadcast past event-location
βbroadcast event-location
| Patterns: |
|
| Since: | 2.12 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
on weather change to sunny:
| Patterns: |
|
| Since: | 2.11 |
This event does not get called for virtual borders.
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 1.0, 2.8.0 (defining worlds) |
any scripts are loaded, this event is only called for newly created worlds.
World management plugins might change the behaviour of this event though.
Examples:
| Patterns: |
|
| Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
βbroadcast "The world %event-world% has been loaded!"
| Patterns: |
|
| Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
βbroadcast "The world %event-world% has been saved"
| Patterns: |
|
| Since: | 1.0, 2.8.0 (defining worlds) |
Examples:
βbroadcast "the %event-world% has been unloaded!"
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
the amount of {thing}
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.5 |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.
Examples:
| Patterns: |
|
| Since: | 2.15 |
Examples:
send action bar "ALERT! A horde of zombies has overrun the central village." to the world
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 1.4.4 |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'.
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
set target block of player to oak stairs[facing=north;waterlogged=true]
set block at player to grass_block[snowy=true]
set loop-block to minecraft:chest[facing=north]
set block above player to oak_log[axis=y]
set target block of player to minecraft:oak_leaves[distance=2;persistent=false]
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.16 |
Examples:
| Patterns: |
|
| Since: | 2.16 |
Examples:
| Patterns: |
|
| Since: | 2.4 |
| Requirements: | Minecraft 1.14 or newer |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:british_shorthair'.
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.21.5+ |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:warm'.
Examples:
| Patterns: |
|
| Since: | 2.0 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev16b, 2.2-dev35 (renamed to click type) |
Examples:
| Patterns: |
|
| Since: | Unknown |
Examples:
set the color of the block to green
message "You're holding a &lt;%color of tool%&gt;%color of tool%&lt;reset&gt; wool block"
| Patterns: |
|
| Since: | 1.0 |
Examples:
βtrigger:
βif arg-1 is not set:
βif command sender is console:
βsend "You can't push yourself as a console :\" to sender
βstop
βpush sender upwards with force 2
βsend "Yay!"
βelse:
βpush arg-1 upwards with force 2
βsend "Yay!" to sender and arg-1
| Patterns: |
|
| Since: | 2.10 |
Configs can be reloaded or navigated to find options.
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.21.5+ |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:warm'.
Examples:
| Patterns: |
|
| Since: | 2.0 |
Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.
Examples:
| Patterns: |
|
| Since: | 2.12 |
Cannot change any attributes of the damage source from an 'on damage' or 'on death' event.
Examples:
| Patterns: |
|
| Since: | 2.12 |
Examples:
| Patterns: |
|
| Since: | 1.4 |
See time and timespan for the other time types of Skript.
Examples:
subtract a day from {_yesterday}
# now {_yesterday} represents the date 24 hours before now
| Patterns: |
|
| Since: | 2.3 |
Examples:
| Patterns: | |
| Since: | 2.0 |
Locations and some blocks also have a direction, but without a length.
Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.
Examples:
loop blocks from the block infront of the player to the block 10 below the player:
βset the block behind the loop-block to water
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 1.4.6 |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:basalt_deltas'.
This also supports custom enchantments using namespaces, ex: 'myenchants:explosive'.
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: |
|
| Since: | 1.4.6 |
Examples:
helmet is enchanted with waterbreathing
| Patterns: |
|
| Since: | 1.0 |
Examples:
player is an op
projectile is an arrow
shoot a fireball from the player
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
This includes all of the data associated with an entity (its name, health, attributes, etc.), at the time this expression is used. Essentially, these are a way to create templates for entities.
Individual attributes of a snapshot cannot be modified or retrieved.
Examples:
| Patterns: |
|
| Since: | 1.3 |
Examples:
spawn a creeper
| Patterns: | |
| Since: | 1.3 |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
| Patterns: |
|
| Since: | 2.10 |
This may also return a result.
Examples:
| Patterns: |
|
| Since: | 2.0 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.4 |
which can be used in the launch firework effect.
See the firework effect expression for detailed patterns.
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.4 |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.13 |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:warm'.
Examples:
| Patterns: |
|
| Since: | 2.10 |
This can be executed (with arguments) and may return a result.
Examples:
set {_result} to the result of {_function}
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
set the player argument's game mode to creative
| Patterns: |
|
| Since: | 2.5 |
| Requirements: | Minecraft 1.13 or newer |
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: |
|
| Since: | 2.4 |
| Requirements: | Minecraft 1.14 or newer |
Examples:
| Patterns: |
|
| Since: | 2.5 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.21.3+ |
Examples:
| Patterns: |
|
| Since: | 1.0 |
An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).
Examples:
| Patterns: |
|
| Since: | 2.2-dev16 |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev32 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
You don't usually need this type except when you want to make a command that only accepts an exact item.
Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.
Examples:
{_item} is a torch
| Patterns: |
|
| Since: | 2.13 |
| Requirements: | Minecraft 1.21.2+ |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.17 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.
Examples:
add oak slab to the inventory of the block
player's tool is a diamond sword of sharpness
block is dirt or farmland
| Patterns: |
|
| Since: | 1.0 |
Examples:
shoot a zombie from the creeper
| Patterns: |
|
| Since: | 1.0 |
Examples:
set {home::%uuid of player%} to location of the player
| Patterns: |
|
| Since: | 2.10 |
Some loot tables will require some values (i.e. looter, location, looted entity) in a loot context when generating loot whereas others may not.
For example, the loot table of a simple dungeon chest will only require a location, whereas the loot table of a cow will require a looting player, looted entity, and location.
You can find more information about this in https://minecraft.wiki/w/Loot_context
Examples:
| Patterns: |
|
| Since: | 2.10 |
You can find more information about this in https://minecraft.wiki/w/Loot_table
Examples:
| Patterns: |
|
| Since: | 2.2-dev36 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.0 |
| Requirements: | Vault, an economy plugin that supports Vault |
add 100$ to the player's balance and add 100 to the player's balance. Examples:
remove Fr. 9.95 from the player's money
set the victim's money to 0
increase the attacker's balance by the level of the victim * 100
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: |
|
| Since: | 2.13 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
This may have navigable children.
Examples:
| Patterns: |
|
| Since: | 1.0 |
Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.
Radians will be converted to degrees.
Examples:
set {_temp} to 2*{_temp} - 2.5
set {_angle} to 3.14 in radians # will be converted to degrees
| Patterns: |
|
| Since: | 1.0 |
Examples:
| Patterns: |
|
| Since: | 2.0 beta 8 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.12 |
| Requirements: | Minecraft 1.21.5+ |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:warm'.
Examples:
| Patterns: |
|
| Since: | 1.0 |
You have two possibilities to use players as command arguments:
Examples:
set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.
| Patterns: |
|
| Since: | 2.5.2 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
'added' indicates the entity does not already have a potion effect of the event potion effect type.
'changed' indicates the entity already has a potion effect of the event potion effect type, but some property about the potion effect is changing.
'cleared' indicates that the effect is being removed because all of the entity's effects are being removed.
'removed' indicates that the event potion effect type has been specifically removed from the entity.
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.0 beta 3 |
Examples:
apply potion of speed 2 to the player for 60 seconds
remove invisibility from the victim
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
shoot an arrow at speed 5 from the player
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
add "hello" to {queue}
broadcast the 1st element of {queue}
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
| Patterns: |
|
| Since: | 2.1 |
| Requirements: | Supported regions plugin |
Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.
Examples:
| Patterns: |
|
| Since: | 2.4 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Disabled scripts will report as being empty since their content has not been loaded.
Examples:
| Patterns: |
|
| Since: | 2.3 |
Examples:
| Patterns: |
|
| Since: | Unknown |
The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set).
Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.
Examples:
delete helmet of the victim
set the color of the player's tool to green
enchant the player's chestplate with projectile protection 5
| Patterns: |
|
| Since: | 2.4 |
Examples:
| Patterns: |
|
| Since: | 2.3 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev35 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text.
Please read the article on Texts and Variable Names to learn more.
Examples:
message "Hello %player%"
message "The id of ""%type of tool%"" is %id of tool%."
| Patterns: |
|
| Since: | 2.15 |
This includes colors, decorations, and more.
Examples:
| Patterns: |
|
| Since: | 1.0 |
This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.
Examples:
| Patterns: |
|
| Since: | 1.0, 2.6.1 (weeks, months, years) |
NOTE: Months always have the value of 30 days, and years of 365 days.
See date and time for the other time types of Skript.
Examples:
βwait a minecraft second and 5 ticks
every 10 mc days and 12 hours:
βhalt for 12.7 irl minutes, 12 hours and 120.5 seconds
| Patterns: |
|
| Since: | 2.8.0 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
grow a huge red mushroom above the block
| Patterns: |
|
| Since: | 2.0 |
This is mostly used for expressions like 'event-
Examples:
{variable} is a type # check whether the variable contains a type, e.g. number or player
{variable} is an object # will always succeed if the variable is set as everything is an object, even types.
disable PvP in the event-world
kill the loop-entity
| Patterns: |
|
| Since: | 2.11 |
Read more about UUIDs and how they are used in Minecraft in the wiki entry about UUIDs.
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.2-dev23 |
Examples:
| Patterns: |
|
| Since: | 2.10.2 |
Examples:
| Patterns: |
|
| Since: | 2.12 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 2.10 |
Examples:
| Patterns: |
|
| Since: | 1.0 |
Examples:
is sunny in the player's world
message "It is %weather in the argument's world% in %world of the argument%"
| Patterns: |
|
| Since: | 2.10 |
| Requirements: | Minecraft 1.21+ |
NOTE: Minecraft namespaces are supported, ex: 'minecraft:ashen'.
Examples:
| Patterns: |
|
| Since: | 1.0, 2.2 (alternate syntax) |
Examples:
| Patterns: |
|
| Since: | 2.11 |
Examples:
| Patterns: |
|
| Since: | 2.7 |
Examples:
| Patterns: |
|
| Since: | 2.14 |
Examples:
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
abs(-2) = 2
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).
Examples:
atan2(10, 0) = 90
atan2(-10, 5) = -63.4349
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Quaternion |
Examples:
| Patterns: |
|
| Since: | 2.2-dev32 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | long |
Examples:
ceil(2) = 2
ceil(2.99) = 3
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Number |
This function retains indices
Examples:
clamp(5.5, 0, 5) = 5
clamp(0.25, 0, 0.5) = 0.25
clamp(5, 7, 10) = 7
clamp((5, 0, 10, 9, 13), 7, 10) = (7, 7, 10, 9, 10)
set {_clamped::*} to clamp({_values::*}, 0, 10)
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
For example, a combination with 3 options and a set size of 1, returns 3: (1), (2), (3)
A combination of 3 options with a set size of 2 returns 3: (1, 2), (1, 3), (2, 3)
Note that the bigger the 'options' and lower the 'selected' may result in approximations or even infinity values.
Combinations differ from permutations in that combinations focus on unique sets, ignoring the order of elements, whereas permutations account for the arrangement of elements within the set.
Example: (1, 2) and (2, 1) represent a single combination since order doesn't matter in combinations, but they are two distinct permutations because permutations consider the order.
Examples:
combinations(5, 3) = 10
combinations(size of {some list::*}, 2)
| Patterns: |
|
| Since: | 2.9.0 |
| Return Type: | Text |
Examples:
concat("foo ", 100, " bar") # foo 100 bar
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Date |
A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).
Examples:
date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990
date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)
| Patterns: |
|
| Since: | 2.16 |
| Return Type: | Entity |
If the entity is unloaded or an offline player, the function will return nothing.
Examples:
kill entity({uuid})
set {_type} to type of entity({uuid})
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
exp(1) = 2.7183
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
Getting the factorial of any number above 21 will return an approximation, not an exact value.
Any number after 170 will always return Infinity.
Should not be used to calculate permutations or combinations manually.
Examples:
factorial(3) = 3*2*1 = 6
factorial(5) = 5*4*3*2*1 = 120
factorial(171) = Infinity
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | long |
Examples:
floor(2) = 2
floor(2.99) = 2
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Text |
Will return none if the format is invalid.
For further reference, see this article.
Examples:
βaliases: bal
βexecutable by: players
βtrigger:
βset {_money} to formatNumber({money::%sender's uuid%})
βsend "Your balance: %{_money}%" to sender
| Patterns: |
|
| Since: | 2.14 |
| Return Type: | long |
Examples:
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Boolean |
Examples:
isNaN(0/0) # true
isNaN(sqrt(-1)) # true
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Returns NaN (not a number) if the argument is negative.
Examples:
ln(exp(5)) = 5
ln(2) = 0.6931
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Location |
If for whatever reason the world is not found, it will fallback to the server's main world.
Examples:
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'.Another useful equation is
base ^ log(a, base) = a for any numbers 'base' and 'a'.Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value.
Returns NaN (not a number) if any of the arguments are negative.
Examples:
log(16, 2) = 4 # 2^4 = 16
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
max(1, 2, 3, 4) = 4
max({some list variable::*})
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
You cannot get the mean of a set of numbers that includes infinity or NaN.
Examples:
mean(0, 5, 10) = 5
mean(13, 97, 376, 709) = 298.75
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
You cannot get the median of a set of numbers that includes NaN.
Examples:
median(1, 2, 3, 4, 5, 6) = 3.5
median(0, 123, 456, 789) = 289.5
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
min(1, 2, 3, 4) = 1
min({some list variable::*})
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
d/m, where d and m are the arguments of this function.The returned value is always positive. Returns NaN (not a number) if the second argument is zero.
Examples:
mod(256436, 100) = 36
mod(-1, 10) = 9
| Patterns: |
|
| Since: | 2.8.0, 2.9.0 (prevent lookups) |
| Return Type: | Offline Player |
Examples:
set {_p} to offlineplayer("069a79f4-44e9-4726-a5be-fca90e38aaf5")
set {_p} to offlineplayer("Notch", false)
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
For example, permutations with 3 options and an arrangement size of 1, returns 3: (1), (2), (3)
Permutations with 3 options and an arrangement size of 2 returns 6: (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2)
Note that the bigger the 'options' and lower the 'selected' may result in approximations or even infinity values.
Permutations differ from combinations in that permutations account for the arrangement of elements within the set, whereas combinations focus on unique sets and ignore the order of elements.
Example: (1, 2) and (2, 1) are two distinct permutations because the positions of '1' and '2' are different, but they represent a single combination since order doesn't matter in combinations.
Examples:
permutations(10, 4) = 5040
permutations(size of {some list::*}, 2)
| Patterns: |
|
| Since: | 2.8.0 |
| Return Type: | Player |
Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
Examples:
set {_p} to player("Notch", true) # will return the only online player whose name is 'Notch'
set {_p} to player("069a79f4-44e9-4726-a5be-fca90e38aaf5") # <none> if player is offline
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
product(2, 3, 4) = 24
product({some list variable::*})
product(2, {_v::*}, and the player's y-coordinate)
| Patterns: |
|
| Since: | 2.10 |
| Return Type: | Quaternion |
Examples:
| Patterns: |
|
| Since: | 2.5, 2.10 (alpha) |
| Return Type: | Color |
Examples:
set the colour of a text display to rgb(10, 50, 100, 50)
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | Number |
Examples:
root(4, 16) = 2
root(-4, 16) = 0.5 # same as 16^(-1/4)
| Patterns: |
|
| Since: | 2.2, 2.7 (decimal placement) |
| Return Type: | Number |
Examples:
round(2) = 2
round(2.99) = 3
round(2.5) = 3
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
sin(60) = 0.866
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
(argument) ^ (1/2) β other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3).Returns NaN (not a number) if the argument is negative.
Examples:
sqrt(2) = 1.4142
sqrt(-1) = NaN
| Patterns: |
|
| Since: | 2.2 |
| Return Type: | Number |
Examples:
sum(2, 3, 4) = 9
sum({some list variable::*})
sum(2, {_v::*}, and the player's y-coordinate)
| Patterns: |
|
| Since: | 2.14 |
| Return Type: | Text |
Examples:
| Patterns: |
|
| Since: | 2.11 |
| Return Type: | UUID |
Examples:
| Patterns: |
|
| Since: | 2.15 |
| Return Type: | Vector |
Examples:
Examples:
