Absorbed blocks
- expressions
- Skript 2.5
[the] absorbed blocksThe blocks absorbed by a sponge block.
View example
the absorbed blocks534 expressions
Values: players, items, numbers, text.
[the] absorbed blocksThe blocks absorbed by a sponge block.
the absorbed blocks[the] (raised|active) (tool|item|weapon) of %living entities%%living entities%'[s] (raised|active) (tool|item|weapon)Returns the item the entities are currently using (ie: the food they're eating, the bow they're drawing back, etc.). This cannot be changed. If an entity is not using any item, this will return null.
on damage of player:
if victim's active tool is a bow:
interrupt player's active item use[the] [elapsed|remaining] (item|tool) us[ag]e time of %living entities%%living entities%'[s] [elapsed|remaining] (item|tool) us[ag]e timeReturns the time that the entities have either spent using an item, or the time left for them to finish using an item.
If an entity is not using any item, this will return 0 seconds.
on right click:
broadcast player's remaining item use time
wait 1 second
broadcast player's item use time[the] affected entitiesThe affected entities in the area cloud effect event.
on area cloud effect:
loop affected entities:
if loop-value is a player:
send "WARNING: you've step on an area effect cloud!" to loop-value[the] [max[imum]] age of %blocks/entities%%blocks/entities%'[s] [max[imum]] ageReturns the age or maximum age of blocks and age for entities (there in no maximum age for entities).
For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested.
For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.
# Set targeted crop to fully grown crop
set age of targeted block to maximum age of targeted block# Spawn a baby cow that will only need 1 minute to become an adult
spawn a baby cow at player
set age of last spawned entity to -1200 # in ticks = 60 seconds[all [[of] the]|the] banned (players|(ips|ip addresses))Obtains the list of all banned players or IP addresses.
command /banlist:
trigger:
send all the banned players[all [[of] the]|the] [registered] [script] commandsReturns all registered commands or all script commands.
send "Number of all commands: %size of all commands%"send "Number of all script commands: %size of all script commands%"[all [[of] the]|the] functions (from|in) %script%No matching entry in Skript's documentation.
[all [[of] the]|the] [server] [non(-| )]op[erator]sThe list of operators on the server.
set {_ops::*} to all operators[(all [[of] the]|the)] permissions (from|of) %players%[(all [[of] the]|the)] %players%'[s] permissionsReturns all permissions of the defined player(s). Note that the modifications to resulting list do not actually change permissions.
set {_permissions::*} to all permissions of the player[all [[of] the]] [persistent] data [tag] keys of %objects%[all of] %objects%'[s] [persistent] data [tag] keysReturns all persistent data keys stored in the specified objects.
This is not limited to tags set by Skript, but includes all keys regardless of their origin.
set {_keys::*} to persistent data keys of player's tool
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%"[all [[of] the]|the] scripts [without ([subdirectory] paths|parents)][all [[of] the]|the] (enabled|loaded) scripts [without ([subdirectory] paths|parents)][all [[of] the]|the] (disabled|unloaded) scripts [without ([subdirectory] paths|parents)]Returns all of the scripts, or just the enabled or disabled ones.
command /scripts:
trigger:
send "All Scripts: %scripts%" to player
send "Loaded Scripts: %enabled scripts%" to player
send "Unloaded Scripts: %disabled scripts%" to player[all [[of] the]|the] [minecraft|datapack|paper|(custom|skript)] [item|block|entity [type]] tagsReturns all the tags.
`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".
broadcast minecraft tagssend paper entity tagsbroadcast all block tags[the] (duplicat(e|ing|ion)|clon(e|ing)) cool[ ]down [time] [of %living entities%]%living entities%'[s] (duplicat(e|ing|ion)|clon(e|ing)) cool[ ]down [time]The cooldown time until an allay can duplicate again naturally.
Resetting the cooldown time will set the cooldown time to the same amount of time after an allay has duplicated.
set {_time} to the duplicate cooldown of last spawned allayadd 5 seconds to the duplication cool down time of last spawned allayremove 3 seconds from the duplicating cooldown time of last spawned allayclear the clone cool down of last spawned allayreset the cloning cool down time of last spawned allay[the] target jukebox [of %living entities%]%living entities%'[s] target jukeboxThe location of the jukebox an allay is set to.
set {_loc} to the target jukebox of last spawned allay[the] (red|green|blue|alpha) (value|component)[s] of %colours%%colours%'[s] (red|green|blue|alpha) (value|component)[s]The alpha, red, green, or blue value of colors. Ranges from 0 to 255.
Alpha represents opacity.
broadcast red value of rgb(100, 0, 50) # sends '100'set {_red} to red's red value + 10alphabetically sorted %texts%Sorts given strings in alphabetical order.
set {_list::*} to alphabetically sorted {_strings::*}[the] altitude[s] of %locations%%locations%'[s] altitude[s]Effectively an alias of 'y-coordinate of โฆ', it represents the height of some location within the world.
on damage:
altitude of the attacker is higher than the altitude of the victim
set damage to damage * 1.2[the] (amount|number|size)[s] of %objects%%objects%'[s] (amount|number|size)[s]No matching entry in Skript's documentation.
[the] (amount|number) of %item types% (in|of) %inventories%Counts how many of a particular item type are in a given inventory.
message "You have %number of tag values of minecraft tag "diamond_ores" in the player's inventory% diamond ores in your inventory."[an] eternityforever[an] ([out] of|outside [of]) time[an] (infinite|indefinite) (duration|timespan)Represents a timespan with an infinite duration. An eternity is also created when arithmetic results in a timespan larger than about 292 million years.
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.
set fire to the player for an eternity%number% [in] deg[ree][s]%number% [in] (rad[ian][s])%numbers% in deg[ree][s]%numbers% in (rad[ian][s])Represents the passed number value in degrees.
If radians is specified, converts the passed value to degrees. This conversion may not be entirely accurate, due to floating point precision.
set {_angle} to 90 degrees{_angle} is 90 # true180 degrees is pi # truepi radians is 180 degrees # true[the] [anvil] [item] [max[imum]] repair cost [of %inventories%]%inventories%'[s] [anvil] [item] [max[imum]] repair costReturns the experience cost (in levels) to complete the current repair or the maximum experience cost (in levels) to be allowed by the current repair.
The default value of max cost set by vanilla Minecraft is 40.
on inventory click:
if {AnvilRepairSaleActive} = true:
wait a tick # recommended, to avoid client bugs
set anvil repair cost to anvil repair cost * 50%
send "Anvil repair sale is ON!" to playeron inventory click:
player have permission "anvil.repair.max.bypass"
set max repair cost of event-inventory to 99999[the] anvil [inventory] (rename|text) input of %inventories%%inventories%'[s] anvil [inventory] (rename|text) inputAn expression to get the name to be applied to an item in an anvil inventory.
on inventory click:
type of event-inventory is anvil inventory
if the anvil text input of the event-inventory is "FREE OP":
ban player(any [one]|one) of [the] %objects%Returns an 'or list' composed of the given objects. For example, `any of (1, 2, and 3)` is equivalent to `1, 2, or 3`
Useful when doing comparisons with variable lists.
if any of {_numbers::*} are 1:if any of {teamA::*} are within location(0, 0, 0) and location(10, 10, 10):[the] applied [beacon] effectThe type of effect applied by a beacon.
on beacon effect:
if the applied effect is primary beacon effect:
broadcast "Is Primary"
else if applied effect = secondary effect:
broadcast "Is Secondary"[the] applied enchant[ment]sThe applied enchantments in an enchant event.
Deleting or removing the applied enchantments will prevent the item's enchantment.
on enchant:
set the applied enchantments to sharpness 10 and fire aspect 5[the] last arg[ument][the] arg[ument](-| )<(\d+)>[the] (first|second|third|<(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th>) arg[ument][s][all [[of] the]|the] arg[ument][s]A user provided value in a command execution.
For example, if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!", 'argument 1' is the player named "Njol" and 'argument 2' is the text "Hello Njol!".
One can also use the type of the argument instead of its index to address the argument.
For example, in the command example above, 'player-argument' is the same as 'argument 1'.
Usable in script commands and command events.
Please note that specifying the argument type is only supported in script commands.
give the item-argument to the player-argumentdamage the player-argument by the number-argumentgive a diamond pickaxe to the argumentadd argument 1 to argument 2heal the last argument%object%[ ]+[ ]%object%%object%[ ]-[ ]%object%%object%[ ]*[ ]%object%%object%[ ]/[ ]%object%%object%[ ]^[ ]%object%Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.
set the player's health to 10 - the player's healthloop (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!"[the] (old|unequipped) armo[u]r item[the] (new|equipped) armo[u]r itemGet the unequipped or equipped armor item from a 'armor change' event.
on armor change
broadcast the old armor item[the] (%equipment slots%|[the] armo[u]r[s]) [item[s]] of %living entities%%living entities%'[s] (%equipment slots%|[the] armo[u]r[s]) [item[s]]Equipment of living entities, i.e. the boots, leggings, chestplate or helmet.
Body armor is a special slot that can only be used for:
Saddle is a special slot that can only be used for: pigs, striders and horse types (horse, camel, llama, mule, donkey).
set chestplate of the player to a diamond chestplatehelmet of player is neither tag values of tag "paper:helmets" nor air # player is wearing a block, e.g. from another plugin[the] (attached|hit) block[s] of %entities%%entities%'[s] (attached|hit) block[s]Returns the attached block of an arrow.
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.
set hit block of last shot arrow to diamond blockon projectile hit:
wait 1 tick
break attached blocks of event-projectile
kill event-projectile[the] arrow knockback strength of %entities%%entities%'[s] arrow knockback strengthAn arrow's knockback strength.
on shoot:
event-projectile is an arrow
set arrow knockback strength of event-projectile to 10[the] arrow pierce level of %entities%%entities%'[s] arrow pierce levelNo matching entry in Skript's documentation.
[number of] arrow[s] stuck in %living entities%The number of arrows stuck in a living entity.
set arrows stuck in player to 5atNo matching entry in Skript's documentation.
[the] attack cooldown of %players%%players%'[s] attack cooldownReturns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack.
NOTE: Currently this can not be set to anything.
on damage:
if attack cooldown of attacker < 1:
set damage to 0
send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker[the] (attacked|damaged|victim) [%entity type%]The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie.
on damage:
victim is a creeper
damage the attacked by 1 heart[the] (attacker|damager)The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player.",
Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.
on damage:
attacker is a player
health of attacker is less than or equal to 2
damage victim by 1 heart[a] %banner pattern type% colo[u]red %colour%Creates a new banner pattern.
set {_pattern} to a creeper banner pattern colored redadd {_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)[a[n]] %banner pattern types% item[s]Gets the item from a banner pattern type.
Note that not all banner pattern types have an item.
set {_item} to creeper charged banner pattern itemset {_item} to snout banner pattern itemset {_item} to thing banner pattern item[all [[of] the]|the] banner pattern[s] of %items/item types/slots/blocks%%items/item types/slots/blocks%'[s] banner pattern[s][the] %integer%[st|nd|rd|th] [banner] pattern of %items/item types/slots/blocks%%items/item types/slots/blocks%'[s] %integer%[st|nd|rd|th] [banner] patternGets or sets the banner patterns of a banner.
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.
broadcast banner patterns of {_banneritem}broadcast 1st banner pattern of block at location(0,0,0)clear banner patterns of {_banneritem}[the] [piglin] barter[ing] dropsThe items dropped by the piglin in a piglin bartering event.
on piglin barter:
if the bartering drops contain a jack o lantern:
remove jack o lantern from bartering output
broadcast "it's not halloween yet!"[the] [piglin] barter[ing] inputThe item picked up by the piglin in a piglin bartering event.
on piglin barter:
if the bartering input is a gold ingot:
broadcast "my precious..."[the] (primary|secondary) [beacon] effect [of %blocks%]%blocks%'[s] (primary|secondary) [beacon] effectThe active effects of a beacon.
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.
set primary beacon effect of {_block} to haste
set secondary effect of {_block} to resistance[the] beacon [effect] range of %blocks%%blocks%'[s] beacon [effect] rangeThe range of a beacon's effects, in blocks.
if the beacon tier of the clicked block is 4:
set the beacon effect range of the clicked block to 100[the] beacon tier of %blocks%%blocks%'[s] beacon tierThe tier of a beacon. Ranges from 0 to 4.
if the beacon tier of the clicked block is 4:
send "This is a max tier beacon!"[the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offline players%%offline players%'[s] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]]Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.
NOTE: Offline players can not have their bed location changed, only online players.
if bed of player exists:
teleport player the the player's bed
else:
teleport the player to the world's spawn pointset the bed location of player to spawn location of world("world") # unsafe/invalid bed location
set the safe bed location of player to spawn location of world("world") # safe/valid bed location[the] [max[imum]] honey level of %blocks%%blocks%'[s] [max[imum]] honey levelThe current or max honey level of a beehive.
The max level is 5, which cannot be changed.
set the honey level of {_beehive} to the max honey level of {_beehive}[the] target flower of %blocks%%blocks%'[s] target flowerThe flower a beehive has selected to pollinate from.
set the target flower of {_beehive} to location(0, 0, 0)clear the target flower of {_beehive}[the] biome [(of|%direction%) %locations%]%locations%'[s] biomeThe biome at a certain location. Please note that biomes are only defined for x/z-columns
(i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x.
As of Minecraft 1.16, biomes are now 3D (per block vs column).
# damage player in deserts constantly
every real minute:
loop all players:
biome at loop-player is desert
damage the loop-player by 1a (blank|empty) equippable componentGets a blank equippable component.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set {_component} to a blank equippable component:
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}[the] block[s] (at|of) %locations%[the] block %direction% [%location%]The block involved in the event, e.g. the clicked block or the placed block.
Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.
block is iron oreset block below to airspawn a creeper above the blockloop blocks in radius 4:
loop-block is obsidian
set loop-block to waterblock is a chest:
clear the inventory of the block[the] break speed[s] [of %blocks%] [for %players%]%block%'[s] break speed[s] [for %players%]Gets the speed at which the given player would break this block, taking into account tools, potion effects, whether or not the player is in water, enchantments, etc. The returned value is the amount of progress made in breaking the block each tick. When the total breaking progress reaches 1.0, the block is broken. Note that the break speed can change in the course of breaking a block, e.g. if a potion effect is applied or expires, or the player jumps/enters water.
on left click using diamond pickaxe:
event-block is set
send "Break Speed: %break speed for player%" to player[the] block[ ]data of %blocks/entities%%blocks/entities%'[s] block[ ]dataGet the block data associated with a block.
This data can also be used to set blocks.
set {_data} to block data of target blockset block at player to {_data}set block data of target block to oak_stairs[facing=south;waterlogged=true][the] [block] hardness of %item types%%item types%'[s] [block] hardnessObtains the block's hardness level (also known as "strength"). This number is used to calculate the time required to break each block.
set {_hard} to block hardness of target blockif block hardness of target block > 5:[the] (break|fall|hit|place|step) sound[s] of %blocks/block datas/item types%%blocks/block datas/item types%'[s] (break|fall|hit|place|step) sound[s]Gets the sound that a given block, blockdata, or itemtype will use in a specific scenario.
This will return a string in the form of "SOUND_EXAMPLE", which can be used in the play sound syntax.
Check out this website for a list of sounds in Minecraft, or this one to go to the Sounds wiki page.
play sound (break sound of dirt) at all playersset {_sounds::*} to place sounds of dirt, grass block, blue wool and stone[(all [[of] the]|the)] blocks in radius %number% [(of|around) %location%][(all [[of] the]|the)] blocks around %location% in radius %number%All blocks in a sphere around a center, mostly useful for looping.
loop blocks in radius 5 around the player:
set loop-block to air[(all [[of] the]|the)] blocks %direction% [%locations%][(all [[of] the]|the)] blocks from %location% [on] %direction%[(all [[of] the]|the)] blocks from %location% to %location%[(all [[of] the]|the)] blocks between %location% and %location%[(all [[of] the]|the)] blocks within %location% and %location%[(all [[of] the]|the)] blocks (in|within) %chunk%Blocks relative to other blocks or between other blocks.
Can be used to get blocks relative to other blocks or for looping.
Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.
loop blocks above the player:loop blocks between the block below the player and the targeted block:set the blocks below the player, the victim and the targeted block to airset all blocks within {loc1} and {loc2} to stoneset all blocks within chunk at player to air[the] [book] (author|writer|publisher) of %item types%%item types%'[s] [book] (author|writer|publisher)The author of a book.
on book sign:
broadcast "A new book has been created by %author of event-item%"[the] [book] (pages|content[s]) of %item types%%item types%'[s] [book] (pages|content[s])[the] [book] page %number% of %item types%%item types%'[s] [book] page %number%The pages of a book (Supports Skript's chat format)
Note: In order to modify the pages of a new written book, you must have the title and author
of the book set. Skript will do this for you, but if you want your own, please set those values.
on book sign:
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!"[the] book (title|name) of %item types%%item types%'[s] book (title|name)The title of a book.
on book sign:
message "You finished your book titled %title of event-item%"[the] boss[ ]bar of %entities%%entities%'[s] boss[ ]barReturns a boss bar from one or more bosses.
on spawn of wither:
set title of boss bar of event-entity to "<red>Angry Wither"[the] boss[ ]bar[s] (from|with) [the] (id|key)[s] %texts%Obtains a keyed boss bar from the specified key.
set {_bar} to a keyed red boss bar with key "example":
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"[the] breeding mother[the] breeding father[the] [bred] (offspring|child)[the] breederRepresents family members within a breeding event.
on breeding:
send "When a %breeding mother% and %breeding father% love each other very much, they make a %bred offspring%" to breeder[the] brewing resultsThe resulting items in an 'on brew complete' event.
on brew complete:
set {_results::*} to the brewing results[the] brewing [stand] fuel (level|amount) [of %blocks%]%blocks%'[s] brewing [stand] fuel (level|amount)The fuel level of a brewing stand. The fuel level is decreased by one at the start of brewing each potion.
set the brewing stand fuel level of {_block} to 10
clear the brewing stand fuel level of {_block}[the] [brewing stand['s]] (first|1st) bottle slot[s] [of %blocks%]%blocks%'[s] [brewing stand['s]] (first|1st) bottle slot[s][the] [brewing stand['s]] (second|2nd) bottle slot[s] [of %blocks%]%blocks%'[s] [brewing stand['s]] (second|2nd) bottle slot[s][the] [brewing stand['s]] (third|3rd) bottle slot[s] [of %blocks%]%blocks%'[s] [brewing stand['s]] (third|3rd) bottle slot[s][the] brewing [stand] ingredient slot[s] [of %blocks%]%blocks%'[s] brewing [stand] ingredient slot[s][the] brewing [stand] fuel slot[s] [of %blocks%]%blocks%'[s] brewing [stand] fuel slot[s]A slot of a brewing stand, i.e. the first, second, or third bottle slot, the fuel slot or the ingredient slot.
set the 1st bottle slot of {_block} to potion of waterclear the brewing stand second bottle slot of {_block}[the] [current|remaining] brewing time [of %blocks%]%blocks%'[s] [current|remaining] brewing timeThe remaining brewing time of a brewing stand.
set the brewing time of {_block} to 10 secondsclear the remaining brewing time of {_block}[the] broadcast(-|[ed] )messageThe message broadcasted in a broadcast event.
on broadcast:
set broadcast message to "<light green>[BROADCAST] %broadcast message%"[the] [max[imum]] (dust|brush)[ed|ing] (value|stage|progress[ion]) of %blocks/block datas%%blocks/block datas%'[s] [max[imum]] (dust|brush)[ed|ing] (value|stage|progress[ion])Represents how far the block has been uncovered.
The only blocks that can currently be "brushed" are Suspicious Gravel and Suspicious Sand.
0 means the block is untouched, the max (usually 3) means nearly fulled brushed.
Resetting this value will set it to 0.
# prevent dusting past level 1
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[the] brushable item of %blocks%%blocks%'[s] brushable itemRepresents the item that is uncovered when dusting.
The only blocks that can currently be "dusted" are Suspicious Gravel and Suspicious Sand.
send target block's brushable itemset {_gravel}'s brushable item to emerald%texts% in ((upper|caps)[ ]case|lower[ ]case)(capitali(s|z)ed|upper[ ]case[d]|lower[ ]case[d]) %texts%%texts% in [(lenient|strict) ]((proper|title)[ ]case|camel[ ]case|pascal[ ]case)[(lenient|strict) ]((proper|title)[ ]case|camel[ ]case|pascal[ ]case) %texts%%texts% in [(lower|upper) ](snake[ ]case|kebab[ ]case)[(lower|upper) ](snake[ ]case|kebab[ ]case) %texts%Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case
"Oops!" in lowercase # oops!"oops!" in uppercase # OOPS!"hellO i'm steve!" in proper case # HellO I'm Steve!"hellO i'm steve!" in strict proper case # Hello I'm Steve!"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()"spAwn neW boSs ()" in strict camel case # spawnNewBoss()"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()"Hello Player!" in snake case # Hello_Player!"Hello Player!" in lower snake case # hello_player!"Hello Player!" in upper snake case # HELLO_PLAYER!"What is your name?" in kebab case # What-is-your-name?"What is your name?" in lower kebab case # what-is-your-name?"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?[the] (<.+>|value[s]) (within|in) %objects%No matching entry in Skript's documentation.
[the] world[ ]border (center|middle) [of %world borders%]%world borders%'[s] world[ ]border (center|middle)The center of a world border.
set world border center of {_worldborder} to location(10, 0, 20)[the] [unicode|character] code([ ]point| position) of %texts%%texts%'[s] [unicode|character] code([ ]point| position)Returns the Unicode codepoint of a character
function is_in_order(letters: strings) :: boolean:
loop {_letters::*}:
set {_codepoint} to codepoint of lowercase loop-value
return false if {_codepoint} is not set # 'loop-value is not a single character'
if:
{_previous-codepoint} is set
# if the codepoint of the current character is not
# 1 more than the codepoint of the previous character
# then the letters are not in order
{_codepoint} - {_previous-codepoint} is not 1
then:
return false
set {_previous-codepoint} to {_codepoint}
return truecharacter (from|at|with) code([ ]point| position) %numbers%Returns the character at the specified codepoint
function chars_between(lower: string, upper: string) :: strings:
set {_lower} to codepoint of {_lower}
return {_none} if {_lower} is not set
set {_upper} to codepoint of {_upper}
return {_none} if {_upper} is not set
loop integers between {_lower} and {_upper}:
add character from codepoint loop-value to {_chars::*}
return {_chars::*}[(all [[of] the]|the)] [alphanumeric] characters (between|from) %text% (and|to) %text%All characters between two given characters, useful for generating random strings. This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters. The ASCII table linked here shows this ordering for the first 256 characters.
If you would like only alphanumeric characters you can use the 'alphanumeric' option in the expression.
If strings of more than one character are given, only the first character of each is used.
loop characters from "a" to "f":
broadcast "%loop-value%"# 0123456789:;<=>?@ABC... ...uvwxyz
send characters between "0" and "z"# 0123456789ABC... ...uvwxyz
send alphanumeric characters between "0" and "z"[the] (message|chat) format[ting]Can be used to modify the chat format.
The sender of a message is represented by player.
The message is represented by message.
set the chat format to "<yellow>%player%<light gray>: <green>%message%"[the] [chat( |-)]messageThe chat message in a chat event.
on chat:
player has permission "admin"
set the message to "<light red>%message%"[the] [chat( | -)]recipientsThe recipients of a chat event
chat recipients[the] choice arg[ument] <(\d+)>[the] (first|second|third|<(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th>) choice arg[ument][s][the] [last] choice arg[ument]Represents the literal argument out of a choice group selected by the command sender.
Choice arguments, just like regular arguments, are numbered in order of occurrence (left to right).
This expression also supports optional literal arguments.
command /alert (restart|giveaway):
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!"[(all [[of] the]|the)] chunk[s] (of|%directions%) %locations%%locations%'[s] chunk[s][(all [[of] the]|the)] loaded chunks (of|in) %worlds%[the] chunk [at] %number%, %number% (in|of) %world%Returns the chunk of a block, location or entity is in, or a list of the loaded chunks of a world.
add the chunk at the player to {protected chunks::*}set {_chunks::*} to the loaded chunks of the player's world(a|an) <.+>No matching entry in Skript's documentation.
[the] (clicked [enchant[ment]] (button|option)|clicked (block|%item type/entity type%)|clicked slot|clicked inventory|click (type|action)|inventory action)The clicked block, entity, inventory, inventory slot, inventory click type or inventory action.
message "You clicked on a %type of clicked entity%!"
if the clicked block is a chest:
show the inventory of the clicked block to the player[the] colo[u]r[s] (from|of) hex[adecimal] code[s] %texts%Returns a proper argb color from a hex code string. The hex code must contain RRGGBB values, but can also contain a leading # or AARRGGBB format. Invalid codes will cause runtime errors.
send color from hex code "#FFBBA7"send color from hex code "FFBBA7"send color from hex code "#AAFFBBA7"[the] colo[u]r[s] of %item types/entities/potion effect types/boss bars%%item types/entities/potion effect types/boss bars%'[s] colo[u]r[s]The color of an item, entity, block, firework effect, or text display.
This can also be used to color chat messages with "<%color of ...%>this text is colored!".
Do note that firework effects support setting, adding, removing, resetting, and deleting; text displays support setting and resetting; and items, entities, and blocks only support setting, and only for very few items/blocks.
on click on wool:
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(colo[u]r-|colo[u]red )%texts%(format-|formatted )%texts%Parses or removes colors and, optionally, chat styles in/from a message.
on chat:
set message to colored message # only safe tags, such as colors, will be parsedcommand /fade <player>:
trigger:
set the display name of the player-argument to the uncolored display name of the player-argumentcommand /format <text>:
trigger:
message formatted text-argument # parses all tags, but this is okay as the output is sent back to the executor(un|non)[-](colo[u]r-|colo[u]red )%texts%(un|non)[-](format-|formatted )%texts%Parses or removes colors and, optionally, chat styles in/from a message.
on chat:
set message to colored message # only safe tags, such as colors, will be parsedcommand /fade <player>:
trigger:
set the display name of the player-argument to the uncolored display name of the player-argumentcommand /format <text>:
trigger:
message formatted text-argument # parses all tags, but this is okay as the output is sent back to the executor[the] (full|complete|whole) command[the] command [label|alias]The command that caused an 'on command' event (excluding the leading slash and all arguments)
# prevent any commands except for the /exit command during some game
on command:
if {game::%player%::playing} is true:
if the command is not "exit":
message "You're not allowed to use commands during the game"
cancel the event[the] [command[ ]block] command of %blocks/entities%%blocks/entities%'[s] [command[ ]block] commandGets or sets the command associated with a command block or minecart with command block.
send command of {_block}set command of {_cmdMinecart} to "say asdf"[the] [command['s]] executorThe executor of a command.
This differs from the command sender in that the executor may not be the thing that triggered/initiated the command.
The executor of a command is often changed to be different from the command sender by using a vanilla command such as "/execute".
command /balance:
# 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[the] main command [label|name] [of [[the] command[s]] %texts%]command[s] %texts%'[s] main command [label|name][the] description [of [[the] command[s]] %texts%]command[s] %texts%'[s] description[the] label [of [[the] command[s]] %texts%]command[s] %texts%'[s] label[the] usage [of [[the] command[s]] %texts%]command[s] %texts%'[s] usage[all [[of] the]|the] aliases [of [[the] command[s]] %texts%]command[s] %texts%'[s] aliases[the] permission [of [[the] command[s]] %texts%]command[s] %texts%'[s] permission[the] permission message [of [[the] command[s]] %texts%]command[s] %texts%'[s] permission message[the] plugin [owner] [of [[the] command[s]] %texts%]command[s] %texts%'[s] plugin [owner]Get information about a command.
main command label of command "skript"description of command "help"label of command "pl"usage of command "help"aliases of command "bukkit:help"permission of command "/op"command "sk"'s plugin ownercommand /greet <player>:
usage: /greet <target>
trigger:
if arg-1 is sender:
send "&cYou can't greet yourself! Usage: %the usage%"
stop
send "%sender% greets you!" to arg-1
send "You greeted %arg-1%!"[the] [command['s]] senderThe sender of a command. This differs from the command executor in that this is always the thing that originally triggered/initiated the command. It cannot be changed by commands like "/execute".
make the command sender execute "/say hi!"on command:
log "%sender% used command /%command% %arguments%" to "commands.log"[the] compass target of %players%%players%'[s] compass targetThe location a player's compass is pointing at.
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.
# make all player's compasses target a player stored in {compass::target::%player%}
every 5 seconds:
loop all players:
set the loop-player's compass target to location of {compass::target::%%loop-player%}[the] [skript] configThe Skript config.
This can be reloaded, or navigated to retrieve options.
set {_node} to node "language" in the skript config
if text value of {_node} is "french":
broadcast "Bonjour!"[the] (console|server)Represents the server's console which can receive messages and execute commands
execute console command "/stop"send "message to console" to the console[the] consumed itemRepresents the item consumed within an entity shoot bow and item consume event.
on player or skeleton shoot projectile:
if the consumed item is an arrow:
cancel event
send "You're now allowed to shoot your arrows." to shooteron 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[a] [new] [%colour%] boss[ ]bar [(with title|titled) %text%][a] [new] keyed [%colour%] boss[ ]bar with (id|key) %text% [(with title|titled) %text%]Creates a new boss bar.
Boss bars can be pink/blue/red/green/yellow/purple/white, and will pick the closest valid color to the one you provide.
Boss bars can have viewers removed or added to them.
Making the boss bar 'keyed' will add it to the persistent storage of the server and will be editable by commands and restored after restart.
on join:
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}[a] loot context %direction% %location%Create a loot context.
set {_player} to player
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}(a|[a] virtual) world[ ]borderCreates a new, unused world border. World borders can be assigned to either worlds or specific players.
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.
on join:
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[the] created damage sourceGet the created damage source being created/modified in a 'custom damage source' section.
set {_source} to a custom damage source:
set the damage type of the created damage source to magiccreated [potion] effecteffectAn expression to obtain the potion effect being made in a potion effect creation section.
set {_potion} to a potion effect of speed 2 for 10 minutes:
hide the effect's icon
hide the effect's particles[the] [event-]<.+>The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow).
You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.
give a diamond sword of sharpness 3 to the playerkill the creeperkill all powered creepers in the wolf's worldprojectile is an arrow[the] [creeper] max[imum] fuse tick[s] of %living entities%%living entities%'[s] [creeper] max[imum] fuse tick[s]No matching entry in Skript's documentation.
[the] cursor slot of %players%%players%'[s] cursor slotThe item which the player has on their inventory cursor. This slot is always empty if player has no inventory open.
cursor slot of player is dirtset cursor slot of player to 64 diamonds[a] [new] chest inventory (named|with name) %text% [with %number% row[s]][a] [new] chest inventory with %number% row[s] [(named|with name) %text%]Returns a chest inventory with the given amount of rows and the name.
Use the open inventory effect to open it.
open chest inventory with 1 row named "test" to playerset {_inventory} to a chest inventory with 1 row
set slot 4 of {_inventory} to a diamond named "example"
open {_inventory} to playeropen chest inventory named "<#00ff00>hex coloured title!" with 6 rows to player[the] [custom] model data of %item types%%item types%'[s] [custom] model data[the] [custom] model data (floats|flags|strings|colo[u]rs) of %item type%%item type%'[s] [custom] model data (floats|flags|strings|colo[u]rs)[the] ((complete|full)) [custom] model data of %item type%%item type%'[s] ((complete|full)) [custom] model dataGet/set the custom model data of an item. Using just `custom model data` will return an integer. Items without model data will return 0.
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.
set custom model data of player's tool to 3
set {_model} to custom model data of player's toolset 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)[the] damageHow much damage is done in a entity/vehicle/item damage events.
For entity damage events, possibly ignoring armour, criticals and/or enchantments (remember that in Skript '1' is one full heart, not half a heart).
For items, it's the amount of durability damage the item will be taking.
on item damage:
event-item is any tool
clear damage # unbreakable tools as the damage will be 0on damage:
increase the damage by 2[the] world[ ]border damage amount [of %world borders%]%world borders%'[s] world[ ]border damage amountThe amount of damage a player takes per second for each block they are outside the border plus the border buffer.
Players only take damage when outside of the world's world border, and the damage value cannot be less than 0.
set world border damage amount of {_worldborder} to 1[the] world[ ]border damage buffer [of %world borders%]%world borders%'[s] world[ ]border damage bufferThe amount of blocks a player may safely be outside the border before taking damage.
Players only take damage when outside of the world's world border, and the damage buffer distance cannot be less than 0.
set world border damage buffer of {_worldborder} to 10[the] damage causeThe damage cause of a damage event. Please click on the link for more information.
damage cause is lava, fire or burning[a] custom damage source [(with|using) [the|a] [damage type [of]] %damage type%]Create a custom damage source and change the attributes.
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.
set {_source} to a custom damage source:
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[the] (causing|responsible) entity [of %damage sources%]%damage sources%'[s] (causing|responsible) entityThe causing entity of a damage source.
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.
set {_source} to a custom damage source:
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[the] damage location [of %damage sources%]%damage sources%'[s] damage locationThe location where the damage was originated from.
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.
damage all players by 5 using a custom damage source:
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[the] damage type [of %damage sources%]%damage sources%'[s] damage typeThe type of damage of a damage source.
Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.
set {_source} to a custom damage source:
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[the] direct entity [of %damage sources%]%damage sources%'[s] direct entityThe direct entity of a damage source.
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.
set {_source} to a custom damage source:
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[the] food exhaustion [of %damage sources%]%damage sources%'[s] food exhaustionThe amount of hunger exhaustion caused by a damage source.
on damage:
if the food exhaustion of event-damage source is 10:[the] source location [of %damage sources%]%damage sources%'[s] source locationThe final location where the damage was originated from.
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.
on death:
set {_location} to the source location of event-damage source[the] (damage[s] [value[s]]|durabilit(y|ies)) of %item types/items/slots%%item types/items/slots%'[s] (damage[s] [value[s]]|durabilit(y|ies))The damage value/durability of an item.
set damage value of player's tool to 10reset the durability of {_item}set durability of player's held item to 0%item type% with (damage|data) [value] %number%%item type% damaged by %number%Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks
give player diamond sword with damage value 100set player's tool to diamond hoe damaged by 250give player diamond sword with damage 700 named "BROKEN SWORD"set {_item} to diamond hoe with damage value 50 named "SAD HOE"%time span% (ago|in the past|before [the] [date] %date%)%time span% (later|(from|after) [the] [date] %date%)A date the specified timespan before/after another date.
set {_yesterday} to 1 day agoset {_hourAfter} to 1 hour after {someOtherDate}set {_hoursBefore} to 5 hours before {someOtherDate}(de|un)queued %queue%unrolled %queue%Requires the 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.
set {queue} to a new queue
add "hello" and "there" to {queue}
set {list::*} to dequeued {queue}[the] death( |-)messageThe message sent to all online players when a player dies.
on death of player:
set the death message to "%player% died!"[the] debug info[rmation] of %objects%%objects%'[s] debug info[rmation]Returns a string version of the given objects, but with their type attached:
debug info of 1, "a", 0.5 -> 1 (long), "a" (string), 0.5 (double)
This is intended to make debugging easier, not as a reliable method of getting the type of a value.
broadcast debug info of {list::*}%objects% (otherwise|?) %objects%A shorthand expression for giving things a default value. If the first thing isn't set, the second thing will be returned.
broadcast {score::%player's uuid%} otherwise "%player% has no score!"difference (between|of) %object% and %object%The difference between two values
Supported types include numbers, dates and times.
if difference between {command::%player%::lastuse} and now is smaller than a minute:
message "You have to wait a minute before using this command again!"[the] difficult(y|ies) of %worlds%%worlds%'[s] difficult(y|ies)The difficulty of a world.
set the difficulty of "world" to hard[%number% [(block|met(er|re))[s]] [to the]] (north[(-| |)(east|west)][(ward(s|ly|)|er(n|ly|))] [of]|south[(-| |)(east|west)][(ward(s|ly|)|er(n|ly|))] [of]|(east|west)[(ward(s|ly|)|er(n|ly|))] [of]|above|over|(up|down)[ward(s|ly|)]|below|under[neath]|beneath) [%direction%][%number% [(block|met(er|re))[s]]] in [the] (direction|horizontal direction|facing|horizontal facing) of %entity/block% (of|from|)[%number% [(block|met(er|re))[s]]] in %entity/block%'[s] (direction|horizontal direction|facing|horizontal facing) (of|from|)[%number% [(block|met(er|re))[s]]] (in[ ]front [of]|forward[s]|behind|backwards|[to the] (right|left) [of])[%number% [(block|met(er|re))[s]]] horizontal[ly] (in[ ]front [of]|forward[s]|behind|backwards|to the (right|left) [of])A helper expression for the direction type.
thrust the player upwardsset the block behind the player to waterloop 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 stoneblock in horizontal facing of the clicked entity from the player is airspawn a creeper 1.5 meters horizontally behind the playerspawn a TNT 5 meters above and 2 meters horizontally behind the playerthrust the last spawned TNT in the horizontal direction of the player with speed 0.2push the player upwards and horizontally forward at speed 0.5push the clicked entity in in the direction of the player at speed -0.5open the inventory of the block 2 blocks below the player to the playerteleport the clicked entity behind the playergrow a regular tree 2 meters horizontally behind the player[the] bill[ |-]board[ing] [setting][s] [of %entities%]%entities%'[s] bill[ |-]board[ing] [setting][s]set billboard of the last spawned text display to center[the] [block|sky] (light [level]|brightness) override[s] [of %entities%]%entities%'[s] [block|sky] (light [level]|brightness) override[s]Returns or changes the brightness override of displays.
Unmodified displays will not have a brightness override value set. Resetting or deleting this value will remove the override.
Use the 'block' or 'sky' options to get/change specific values or get both values as a list by using neither option.
NOTE: setting only one of the sky/block light overrides of a display without an existing override will set both sky and block light to the given value. Make sure to set both block and sky levels to your desired values for the best results. Likewise, you can only clear the brightness override, you cannot clear/reset the sky/block values individually.
set sky light override of the last spawned text display to 7subtract 3 from the block light level override of the last spawned text displayif sky light level override of {_display} is 5:
clear brightness override of {_display}[the] glow[ing] colo[u]r[s] override[s] [of %entities%]%entities%'[s] glow[ing] colo[u]r[s] override[s]Returns or changes the glowing color override of displays.
This overrides whatever color is already set for the scoreboard team of the displays.
set glow color override of the last spawned text display to blue[the] display (height|width) [of %entities%]%entities%'[s] display (height|width)Returns or changes the height or width of displays.
The rendering culling bounding box spans horizontally width/2 from entity position, which determines the point at which the display will be frustum culled (no longer rendered because the game determines you are no longer able to see it).
If set to 0, no culling will occur on both the vertical and horizontal directions. Default is 0.0.
set display height of the last spawned text display to 2.5[the] interpolation (delay|duration)[s] [of %entities%]%entities%'[s] interpolation (delay|duration)[s]Returns or changes the interpolation delay/duration of displays.
Interpolation duration is the amount of time a display will take to interpolate, or shift, between its current state and a new state.
Interpolation delay is the amount of ticks before client-side interpolation will commence.Setting to 0 seconds will make it immediate.
Resetting either value will return that value to 0.
set interpolation delay of the last spawned text display to 2 ticks[the] (left|right) [transformation] rotation[s] of %entities%%entities%'[s] (left|right) [transformation] rotation[s]No matching entry in Skript's documentation.
[the] shadow (radius|strength) [of %entities%]%entities%'[s] shadow (radius|strength)Returns or changes the shadow radius/strength of displays.
set shadow radius of the last spawned text display to 1.75[the] teleport[ation] duration[s] [of %entities%]%entities%'[s] teleport[ation] duration[s]The teleport duration of displays is the amount of time it takes to get between locations.
0 means that updates are applied immediately.
1 means that the display entity will move from current position to the updated one over one tick.
Higher values spread the movement over multiple ticks. Max of 59 ticks.
set teleport duration of the last spawned text display to 2 ticks
teleport last spawned text display to {_location}
wait 2 ticks
message "display entity has arrived at %{_location}%"[the] (display|[display] transformation) (scale|translation)[s] of %entities%%entities%'[s] (display|[display] transformation) (scale|translation)[s]Returns or changes the transformation scale or translation of displays.
set transformation translation of display to vector from -0.5, -0.5, -0.5 # Center the display in the same position as a block[the] view range [of %entities%]%entities%'[s] view rangeReturns or changes the view range of displays.
Default value is 1.0. This value is then multiplied by 64 and the player's entity view distance setting to determine the actual range.
For example, a player with 150% entity view distance will see a block display with a view range of 1.2 at 1.2 * 64 * 150% = 115.2 blocks away.
set view range of the last spawned text display to 2.9[the] distance between %location% and %location%The distance between two points.
if the distance between the player and {home::%uuid of player%} is smaller than 20:
message "You're very close to your home!"[the] uuid of [the] [dropped] item owner [of %entities%][the] [dropped] item owner's uuid [of %entities%]The uuid of the owner of the dropped item.
Setting the owner of a dropped item means only that entity or player can pick it up.
Dropping an item does not automatically make the entity or player the owner.
set the uuid of the dropped item owner of last dropped item to player
if the uuid of the dropped item owner of last dropped item is uuid of player:[the] uuid of [the] [dropped] item thrower [of %entities%][the] [dropped] item thrower's uuid [of %entities%]The uuid of the entity or player that threw/dropped the dropped item.
set the uuid of the dropped item thrower of {_dropped item} to player
if the uuid of the dropped item thrower of {_dropped item} is uuid of player:clear the item thrower of {_dropped item}[the] dropsThis expression only works in death and harvest events.
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.
clear dropsremove 4 planks from the drops[(all|the|all [of] the)] drops of %blocks% [(using|with) %item type% [(as %entity%)]]%blocks%'s drops [(using|with) %item type% [(as %entity%)]]A list of the items that will drop when a block is broken.
on break of block:
give drops of block using player's tool to player[the] (first|last) element [out] (of|in) %objects%[the] (first|last) %integer% elements [out] (of|in) %objects%[a] random element [out] (of|in) %objects%%integer% random [distinct] elements [out] (of|in) %objects%[the] %integer%(st|nd|rd|th) [[to] last] element [out] (of|in) %objects%[the] elements (from|between) %integer% (to|and) %integer% [out] (of|in) %objects%The first, last, range or a random element of a set, e.g. a list variable, or a queue.
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
broadcast the first 3 elements of {top players::*}set {_last} to last element of {top players::*}set {_random player} to random element out of all playerssend 2nd last element of {top players::*} to playerset {page2::*} to elements from 11 to 20 of {top players::*}broadcast the 1st element in {queue}broadcast the first 3 elements in {queue}[the] enchant[ed] itemThe enchant item in an enchant prepare event or enchant event.
It can be modified, but enchantments will still be applied in the enchant event.
on enchant:
set the enchanted item to a diamond chestplateon enchant prepare:
set the enchant item to a wooden sword[the] [displayed] ([e]xp[erience]|enchanting) costThe cost of enchanting in an enchant event.
This is number that was displayed in the enchantment table, not the actual number of levels removed.
on enchant:
send "Cost: %the displayed enchanting cost%" to player[the] enchant[ment] bonusThe enchantment bonus in an enchant prepare event. This represents the number of bookshelves affecting/surrounding the enchantment table.
on enchant:
send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player[the] enchant[ment] hintThe enchantment hint in an enchant event.
This is the enchantment that was shown to the player when they hovered over the enchantment offer that they eventually selected.
on enchant:
send "You got at least %the enchantment hint%!"[the] [enchant[ment]] level[s] of %enchantments% (on|of) %item types%[the] %enchantments% [enchant[ment]] level[s] (on|of) %item types%%item types%'[s] %enchantments% [enchant[ment]] level[s]%item types%'[s] [enchant[ment]] level[s] of %enchantments%The level of a particular enchantment on an item.
player's tool is a sword of sharpness:
message "You have a sword of sharpness %level of sharpness of the player's tool% equipped"[all [[of] the]|the] enchant[ment] offersenchant[ment] offer[s] %integers%[the] %integer%(st|nd|rd|th) enchant[ment] offerThe enchantment offer in enchant prepare events.
on enchant prepare:
send "Your enchantment offers are: %the enchantment offers%" to player[the] [enchant[ment]] cost of %enchantment offers%%enchantment offers%'[s] [enchant[ment]] costThe cost of an enchantment offer. This is displayed to the right of an enchantment offer.
If the cost is changed, it will always be at least 1.
This changes how many levels are required to enchant, but does not change the number of levels removed.
To change the number of levels removed, use the enchant event.
set cost of enchantment offer 1 to 50[the] ender[ ]chest[s] of %players%%players%'[s] ender[ ]chest[s]The ender chest of a player.
open the player's ender chest to the player[the] carr(ied|ying) block[[ ]data] of %living entities%%living entities%'[s] carr(ied|ying) block[[ ]data]The block data an enderman is carrying.
Custom attributes such as NBT or names do not transfer over.
Blocks, blockdatas and items are acceptable objects to change the carrying block.
broadcast the carrying blockdata of last spawned endermanset the carried block of last spawned enderman to an oak logset 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}(all [[of] the]|the) %entity types% [(in|of) (world[s] %worlds%|%chunks%)](all [[of] the]|the) entities of type[s] %entity types% [(in|of) (world[s] %worlds%|%chunks%)](all [[of] the]|the) %entity types% (within|[with]in radius) %number% [(block[s]|met(er|re)[s])] (of|around) %location%(all [[of] the]|the) entities of type[s] %entity types% in radius %number% (of|around) %location%(all [[of] the]|the) %entity types% within %location% and %location%%plural entity types%All entities in all worlds, in a specific world, in a chunk, in a radius around a certain location or within two locations. e.g. all players, all creepers in the player's world, or players in radius 100 of the player.
kill all creepers in the player's worldsend "Psst!" to all players within 100 meters of the playergive a diamond to all opsheal all tamed wolves in radius 2000 around {town center}delete all monsters in chunk at playersize of all players within {_corner::1} and {_corner::2}}[the] (ai|artificial intelligence) of %living entities%%living entities%'[s] (ai|artificial intelligence)Returns whether an entity has AI.
set artificial intelligence of target entity to false[the] %attribute type% [(total|final|modified)] attribute [value] of %entities%%entities%'[s] %attribute type% [(total|final|modified)] attribute [value]The numerical value of an entity's particular attribute.
Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead.
Resetting an entity's attribute is only available in Minecraft 1.11 and above.
on damage of player:
send "You are wounded!" to victim
set victim's attack speed attribute to 2[the] [max[imum]] (burn[ing]|fire) (time|duration) of %entities%%entities%'[s] [max[imum]] (burn[ing]|fire) (time|duration)How much time an entity will be burning for.
send "You will stop burning in %fire time of player%"send the max burn time of target[the] (owner|tamer) of %living entities%%living entities%'[s] (owner|tamer)The owner of a tameable entity (i.e. horse or wolf).
set owner of last spawned wolf to player
if the owner of last spawned wolf is player:[the] entity size of %living entities%%living entities%'[s] entity sizeChanges the entity size of slimes and phantoms. This is not the same as changing the scale attribute of an entity.
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.
spawn a slime at player:
set entity size of event-entity to 5
set name of event-entity to "King Slime Jorg"[the] entity snapshot of %entities/entity types%%entities/entity types%'[s] entity snapshotReturns the entity snapshot of a provided entity, which includes all the data associated with it (name, health, attributes, etc.) at the time this expression is used.
Individual attributes of a snapshot cannot be modified or retrieved.
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
spawn {_snapshot} at location(0, 0, 0)[the] (damage|hurt) sound[s] of %living entities%%living entities%'[s] (damage|hurt) sound[s][the] death sound[s] of %living entities%%living entities%'[s] death sound[s][the] [(tall|high)|(low|normal)] fall damage sound[s] [from [[a] height [of]] %number%] of %living entities%%living entities%'[s] [(tall|high)|(low|normal)] fall [damage] sound[s] [from [[a] height [of]] %number%][the] swim[ming] sound[s] of %living entities%%living entities%'[s] swim[ming] sound[s][the] [(fast|speedy)] splash sound[s] of %living entities%%living entities%'[s] [(fast|speedy)] splash sound[s][the] eat[ing] sound[s] of %living entities% [(with|using|[while] eating [a]) %item type%]%living entities%'[s] eat[ing] sound[s][the] drink[ing] sound[s] of %living entities% [(with|using|[while] drinking [a]) %item type%]%living entities%'[s] drink[ing] sound[s][the] ambient sound[s] of %living entities%%living entities%'[s] ambient sound[s]Gets the sound that a given entity will make in a specific scenario.
play sound (hurt sound of player) at playerset {_sounds::*} to death sounds of (all mobs in radius 10 of player)[the] [max[imum]] [stored] entity count [of %blocks%]%blocks%'[s] [max[imum]] [stored] entity countThe current number of entities stored inside an entity block storage (i.e. beehive).
The maximum amount of entities an entity block storage can hold.
broadcast the stored entity count of {_beehive}set the maximum entity count of {_beehive} to 20(offline player|player|world|entit(y|ies))[s] from %uuids%Get an entity, player, offline player or world from a UUID.
Unloaded entities or players that are offline (when using 'player from %uuid%') will return nothing.
set {_player} to player from "a0789aeb-7b46-43f6-86fb-cb671fed5775" parsed as uuidset {_offline player} to offline player from {_some uuid}set {_entity} to entity from {_some uuid}set {_world} to world from {_some uuid}[the] equippable component[s] of %slots/item types/items%%slots/item types/items%'[s] equippable component[s]The equippable component of an item. Any changes made to the equippable component will be present on the item.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set {_component} to the equippable component of {_item}
set the equipment slot of {_component} to helmet slotclear the equippable component of {_item}reset the equippable component of {_item}[the] allowed entities [of %equippable components%]%equippable components%'[s] allowed entitiesThe entities allowed to wear the item.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the allowed entities of {_item} to a zombie and a skeletonset {_component} to the equippable component of {_item}
clear the allowed entities of {_component}[the] camera overlay [of %equippable components%]%equippable components%'[s] camera overlayThe camera overlay for the player when the item is equipped.
Example: The jack-o'-lantern view when having a jack-o'-lantern equipped as a helmet.
The camera overlay is represented as a namespaced key.
A namespaced key can be formatted as 'namespace:id' or 'id'. It can only contain one ':' to separate the namespace and the id. Only alphanumeric characters, periods, underscores, and dashes can be used.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the camera overlay of {_item} to "custom_overlay"set {_component} to the equippable component of {_item}
set the camera overlay of {_component} to "custom_overlay"[the] equip sound [of %equippable components%]%equippable components%'[s] equip soundThe sound to be played when the item is equipped.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the equip sound of {_item} to "entity.experience_orb.pickup"set {_component} to the equippable component of {_item}
set the equip sound of {_component} to "block.note_block.pling"[the] equipment slot [of %equippable components%]%equippable components%'[s] equipment slotThe equipment slot an item can be equipped to.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the equipment slot of {_item} to chest slotset {_component} to the equippable component of {_item}
set the equipment slot of {_component} to boots slot[the] equipped (model|asset) (key|id) [of %equippable components%]%equippable components%'[s] equipped (model|asset) (key|id)The model of the item when equipped.
The model key is represented as a namespaced key.
A namespaced key can be formatted as 'namespace:id' or 'id'. It can only contain one ':' to separate the namespace and the id. Only alphanumeric characters, periods, underscores, and dashes can be used.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the equipped model key of {_item} to "custom_model"set {_component} to the equippable component of {_item}
set the equipped model id of {_component} to "custom_model"[the] shear[ed [off]] sound [of %equippable components%]%equippable components%'[s] shear[ed [off]] soundThe sound to be played when the item is sheared off of an entity.
NOTE: Equippable component elements are experimental. Thus, they are subject to change and may not work as intended.
set the shear sound of {_item} to "entity.experience_orb.pickup"set {_component} to the equippable component of {_item}
set the shear sound of {_component} to "block.note_block.pling"the <.+>event-<.+>No matching entry in Skript's documentation.
<.+>No matching entry in Skript's documentation.
[the] exact item[s] of %blocks%%blocks%'[s] exact item[s]Get an exact item representation of a block, carrying over any data. For example, using this expression on a chest block with items stored inside will return a chest item with the exact same items in its inventory as the chest block.
set {_item} to exact item of block at location(0, 0, 0)%objects% (except|excluding|not including) %objects%Filter a list by providing objects to be excluded.
spawn zombie at location(0, 0, 0):
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[the] exhaustion of %players%%players%'[s] exhaustionThe exhaustion of a player. This is mainly used to determine the rate of hunger depletion.
set exhaustion of all players to 1[the] (spawned|dropped|) [e]xp[erience] [orb[s]]How much experience was spawned in an experience spawn or block break event. Can be changed.
on experience spawn:
add 5 to the spawned experienceon break of coal ore:
clear dropped experienceon break of diamond ore:
if tool of player = diamond pickaxe:
add 100 to dropped experienceon breed:
breeding father is a cow
set dropped experience to 10on fish catch:
add 70 to dropped experience[the] (experience|[e]xp) cooldown change (reason|cause|type)The experience change reason within an experience cooldown change event.
on player experience cooldown change:
if xp cooldown change reason is plugin:
#Changed by a plugin
else if xp cooldown change reason is orb pickup:
#Changed by picking up xp orb[the] (experience|[e]xp) [pickup|collection] cooldown of %players%%players%'[s] (experience|[e]xp) [pickup|collection] cooldownThe experience cooldown of a player.
Experience cooldown is how long until a player can pick up another orb of experience.
The cooldown of a player must be 0 to pick up another orb of experience.
send experience cooldown of playerset the xp pickup cooldown of player to 1 hourif exp collection cooldown of player >= 10 minutes:
clear the experience pickup cooldown of player[the] exploded blocksGet all the blocks that were destroyed in an explode event. Supports add/remove/set/clear/delete blocks.
on explode:
loop exploded blocks:
add loop-block to {exploded::blocks::*}on explode:
loop exploded blocks:
if loop-block is grass:
remove loop-block from exploded blockson explode:
clear exploded blockson explode:
set exploded blocks to blocks in radius 10 around event-entityon explode:
add blocks above event-entity to exploded blocks[the] [explosion['s]] block (yield|amount)[the] percentage of blocks droppedThe percentage of exploded blocks dropped in an explosion event.
When changing the yield, a value greater than 1 will function the same as using 1.
Attempting to change the yield to a value less than 0 will have no effect.
on explode:
set the explosion's block yield to 10%[the] explosion (yield|radius|size)[the] (yield|radius|size) of [the] explosionThe yield of the explosion in an explosion prime event. This is how big the explosion is.
When changing the yield, values less than 0 will be ignored.
Read this wiki page for more information
on explosion prime:
set the yield of the explosion to 10[the] explosive (yield|radius|size|power) of %entities%%entities%'[s] explosive (yield|radius|size|power)The yield of an explosive (creeper, ghast, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity.
Read this wiki page for more information.
The yield of ghasts can only be set to between 0 and 127.
on spawn of a creeper:
set the explosive yield of the event-entity to 10[the] (horizontal|) facing of %living entities/blocks%%living entities/blocks%'[s] (horizontal|) facingThe facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')
# makes a bridge
loop blocks from the block below the player in the horizontal facing of the player:
set loop-block to cobblestone[the] fall[en] (distance|height) of %entities%%entities%'[s] fall[en] (distance|height)The distance an entity has fallen for.
set all entities' fall distance to 10on damage:
send "%victim's fall distance%" to victim[all] [the] fertilized blocksThe blocks fertilized in block fertilize events.
the fertilized blocks%objects% (where|that match) [<.+>]%objects% (where|that match) (<.+>)Filters a list based on a condition.
For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]',
only "something" would be broadcast as it is the only string that matched the condition.
send "congrats on being staff!" to all players where [player input has permission "staff"]loop (all blocks in radius 5 of player) where [block input is not air]:[the] final damageHow much damage is done in a damage event, considering all types of damage reduction. Can NOT be changed.
send "%final damage%" to victim(|flickering|trailing|flickering trailing|trailing flickering) %firework type% [firework [effect]] colo[u]red %colours%(|flickering|trailing|flickering trailing|trailing flickering) %firework type% [firework [effect]] colo[u]red %colours% fad(e|ing) [to] %colours%Represents a 'firework effect' which can be used in the launch firework effect.
launch flickering trailing burst firework colored blue and green at playerlaunch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entitylaunch ball large colored red, purple and white fading to light green and black at player's location with duration 1[the] first empty slot[s] (in|of) %inventories%%inventories%'[s] first empty slot[s]Returns the first empty slot in an inventory. If no empty slot is found, it returns nothing.
set the first empty slot in player's inventory to 5 diamondsif the first empty slot in player's inventory is not set:
message "No empty slot available in your inventory!" to player(min[imum]|max[imum]) fish[ing] approach[ing] angleReturns the angle at which the fish will approach the fishing hook, after the wait time.
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.
on fish approach:
if any:
maximum fishing approach angle is bigger than 300.5 degrees
min fishing approach angle is smaller than 59.5 degrees
then:
cancel eventfish[ing] bit(e|ing) [wait] timeReturns the time it takes a fish to bite the fishing hook, after it started approaching the hook.
May return a timespan of 0 seconds. If modifying the value, it should be at least 1 tick.
on fish approach:
set fishing bite time to 5 seconds[the] fish[ing] (hook|bobber)The fishing hook in a fishing event.
on fish line cast:
wait a second
teleport player to fishing hook[the] hook[ed] entityReturns the hooked entity in the hooked event.
on entity hooked:
if hooked entity is a player:
teleport hooked entity to player(min[imum]|max[imum]) fish[ing] wait[ing] timeReturns the minimum and/or maximum waiting time of the fishing hook.
Default minimum value is 5 seconds and maximum is 30 seconds, before lure is applied.
on fishing line cast:
set min fish waiting time to 10 seconds
set max fishing waiting time to 20 seconds[the] fl(y[ing]|ight) (mode|state) of %players%%players%'[s] fl(y[ing]|ight) (mode|state)Whether the player(s) are allowed to fly. Use Make Fly effect to force player(s) to fly.
set flight mode of player to truesend "%flying state of all players%"[the] (food|hunger)[[ ](level|met(er|re)|bar)] [of %players%]%players%'[s] (food|hunger)[[ ](level|met(er|re)|bar)]The food level of a player from 0 to 10. Has several aliases: food/hunger level/meter/bar.
set the player's food level to 10%dates% formatted [human-readable] [(with|as) %text%][human-readable] formatted %dates% [(with|as) %text%]Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.
command /date:
trigger:
send "Full date: %now formatted human-readable%" to sender
send "Short date: %now formatted as "yyyy-MM-dd"%" to sender[the] (former|past|old) [state] [of] %objects%%objects% before [the event][the] (future|to-be|new) [state] [of] %objects%%objects%(-to-be| after[(wards| the event)])Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event.
Note: The past, future and present states of an expression are sometimes called 'time states' of an expression.
Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.
on teleport:
former world was "world_nether" # or 'world was'
world will be "world" # or 'world after the event is'on tool change:
past tool is an axe
the tool after the event will be airon weather change:
set {weather::%world%::old} to past weather
set {weather::%world%::current} to the new weather[the] [server] (free|max[imum]|total) (memory|ram)The free, max or total memory of the server in Megabytes.
while player is online:
send action bar "Memory left: %free memory%/%max memory%MB" to player
wait 5 ticks[the] freeze time of %entities%%entities%'[s] freeze timeHow much time an entity has been in powdered snow for.
player's freeze time is less than 3 seconds:
send "you're about to freeze!" to the player[the] function[s] [named] %texts% [(from|in) %script%]Obtain a function by name, which can be executed.
set {_function} to the function named "myFunction"run {_function} with arguments 13 and true[the] (smelted item|result[ item])[the] extracted item[s][the] smelting item[the] burned (fuel|item)Represents the different items in furnace events.
Only 'smelting item' can be changed.
on furnace smelt:
broadcast smelted item
# Or 'result'on furnace extract:
broadcast extracted itemon fuel burn:
broadcast burned fuelon smelting start:
broadcast smelting item
clear smelting item[the] ((ore|input)|fuel|(result|output)) slot[s] [of %blocks%]%blocks%'[s] ((ore|input)|fuel|(result|output)) slot[s]A slot of a furnace, i.e. either the ore, fuel or result slot.
set the fuel slot of the clicked block to a lava bucketset the block's ore slot to 64 iron oreclear the result slot of the blockon smelt:
if the fuel slot is charcoal:
add 5 seconds to the burn time[the] [furnace] cook[ing] time [of %blocks%]%blocks%'[s]cook[ing] time[the] [furnace] total cook[ing] time [of %blocks%]%blocks%'[s]total cook[ing] time[the] [furnace] fuel burn[ing] time [of %blocks%]%blocks%'[s]fuel burn[ing] timeThe cook time, total cook time, and burn time of a furnace. Can be changed.
set the cooking time of {_block} to 10set the total cooking time of {_block} to 50set the fuel burning time of {_block} to 100on smelt:
if the fuel slot is charcoal:
add 5 seconds to the fuel burn time[record] song (of|using) %item type%[dispenser] black smoke effect [(in|with|using) [the] direction] %direction%[dispenser] white smoke effect [(in|with|using) [the] direction] %direction%%item type/block data% [foot]step[s] sound [effect]%item type/block data% (break|destroy) effect%item type/block data% (break|destroy) effect with sounddestroy progress effect on the %direction% [side|face]destroy progress effect on the %direction% [side|face] with sound%colour% [splash] potion break effect%colour% instant [splash] potion break effectcompost[er] [fill[ing]] (succe(ss|ed)|fail[ure|ed]) sound [effect]villager plant grow[th] effect [(with|using) %number% particles][fake] bone meal effect [(with|using) %number% particles](electric|lightning[ rod]|copper) spark effect [(in|using|along) the (x|y|z) axis]sculk (charge|spread) effect [(with|using) data %integer%]ender dragon egg teleport[ing] [to %vector%] effectshulker teleport[ing] [to %vector%] effectconsumable teleport[ing] [to %vector%] effectenderman teleport[ing] [to %vector%] effect[finish] brush[ing] %item type/block data% effecttrial spawner detect[ing|s] [%number%] player[s] effectominous trial spawner detect[ing|s] [%number%] player[s] effect[ominous] trial spawner spawn[ing] [mob] effect[ominous] trial spawner spawn[ing] [mob] effect with soundbee growth effect [(with|using) %number% particles][ominous] [trial] vault activate effect[ominous] [trial] vault deactivate effecttrial spawner become[ing] [not] ominous effect[ominous] trial spawner spawn[ing] item effectplace turtle egg effect [(with|using) %number% particles][mace] smash attack effect [(with|using) %number% particles]Creates game effects that require some extra information, such as colors, particle counts, or block data.
Game effects consist of combinations particles and/or sounds that are used in Minecraft, such as the bone meal particles, the sound of footsteps on a specific block, or the particles and sound of breaking a splash potion.
Game effects not present here do not require data and can be found in the Game Effect type.
Data requirements vary from version to version, so these docs are only accurate for the most recent Minecraft version at time of release.
play compost success sound effect to player[the] game[ ]mode of %players%%players%'[s] game[ ]modeThe gamemode of a player. See Gamemodes
player's gamemode is survivalset the player's gamemode to creativeset gamemode of player to adventure[the] gamerule %gamerule% of %worlds%The gamerule value of a world.
set the gamerule commandBlockOutput of world "world" to false[the] (gliding|glider) [state] of %living entities%%living entities%'[s] (gliding|glider) [state]Sets of gets gliding state of player. It allows you to set gliding state of entity even if they do not have an Elytra equipped.
set gliding of player to off[the] glowing of %entities%%entities%'[s] glowingIndicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.
set glowing of player to true[the] gravity of %entities%%entities%'[s] gravityIf entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag.
set gravity of player off[the] hanging (entity|remover)on break of item frame:
if item of hanging entity is diamond pickaxe:
cancel event
if hanging remover is a player:
send "You can't break that item frame!" to hanging remover%texts% hash[ed] with (MD5|SHA-256|SHA-384|SHA-512)Hashes the given text using the MD5 or SHA algorithms. Each algorithm is suitable for different use cases.
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.
set {_hash} to "hello world" hashed with SHA-256[the] hatching entity [type]The type of the entity that will be hatched in a Player Egg Throw event.
on player egg throw:
set the hatching entity type to a primed tnt[the] hatching numberThe number of entities that will be hatched in a Player Egg Throw event.
Please note that no more than 127 entities can be hatched at once.
on player egg throw:
set the hatching number to 10[the] (head|eye[s]) [location[s]] of %living entities%%living entities%'[s] (head|eye[s]) [location[s]]The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight.
Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.
set the block at the player's head to airset the block in front of the player's eyes to glassloop blocks in front of the player's head:[the] heal[ing] amountThe amount of health healed in a heal event.
on player healing:
increase the heal amount by 2
remove 0.5 from the healing amount[the] (regen|health regain|heal[ing]) (reason|cause)The heal reason of a heal event.
on heal:
heal reason is satiated
send "You ate enough food and gained full health back!"[the] health of %living entities%%living entities%'[s] healthThe health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).
message "You have %health% HP left."[the] hex[adecimal] code[s] of %colours%%colours%'[s] hex[adecimal] code[s]Returns the hexadecimal value representing the given color(s).
The hex value of a colour does not contain a leading #, just the RRGGBB value.
For those looking for hex values of numbers, see the asBase and fromBase functions.
send formatted "<#%hex code of rgb(100, 10, 10)%>darker red" to all players[the] [max[imum]] domestication level of %living entities%%living entities%'[s] [max[imum]] domestication levelGets and/or sets the (max) domestication of a horse.
The domestication of a horse is how close a horse is to becoming tame - the higher the domestication, the closer they are to becoming tame (must be between 1 and the max domestication level of the horse).
The max domestication of a horse is how long it will take for a horse to become tame (must be greater than 0).
function domesticateAndTame(horse: entity, p: offline player, i: int = 10):
add {_i} to domestication level of {_horse}
if domestication level of {_horse} >= max domestication level of {_horse}:
tame {_horse}
set tamer of {_horse} to {_p}[the] (host|domain)[ ][name]The hostname used by the connecting player to connect to the server in a connect event.
on connect:
hostname is "testers.example.com"
send "Welcome back tester!"[the] hotbar buttonThe hotbar button clicked in an inventory click event.
on inventory click:
send "You clicked the hotbar button %hotbar button%!"[the] [([currently] selected|current)] hotbar slot[s] [of %players%]%players%'[s] [([currently] selected|current)] hotbar slot[s]The currently selected hotbar slot.
To retrieve its number use Slot Index expression.
Use future and past tense to grab the previous slot in an item change event, see example.
message "%player's current hotbar slot%"set player's selected hotbar slot to slot 4 of playersend "index of player's current hotbar slot = 1" # second slot from the lefton item held change:
if the selected hotbar slot was a diamond:
set the currently selected hotbar slot to slot 5 of player[the] [custom] [player|server] (hover|sample) ([message] list|message)[the] [custom] player [hover|sample] listThe list when you hover on the player counts of the server in the server list.
This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players.
And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.
on server list ping:
clear the hover list
add "&aWelcome to the &6Minecraft &aserver!" to the hover list
add "" to the hover list # A blank line
add "&cThere are &6%online player count% &conline players!" to the hover list[the] humidit(y|ies) of %blocks%%blocks%'[s] humidit(y|ies)Humidity of given blocks.
set {_humidity} to event-block's humidity[(the|all [[of] the])] (indexes|indices) of %objects%%objects%'[s] (indexes|indices)[sorted] (indices|indexes) of %objects% in (ascending|descending) order[sorted] %objects%'[s] (indices|indexes) in (ascending|descending) orderReturns all the indices of a list variable, optionally sorted by their values.
To sort the indices, all objects in the list must be comparable;
Otherwise, this expression will just return the unsorted indices.
set {l::*} to "some", "cool" and "values"
broadcast "%indices of {l::*}%" # result is 1, 2 and 3", "
set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first[the] [first|last|all] (position|positions|indices|index|indexes) of [[the] value] %texts% in %text%[the] [first|last|all] (position|positions) of [[the] value] %objects% in %objects%[the] [first|last|all] (index|indices|indexes) of [[the] value] %objects% in %objects%Get the first, last or all positions of a character (or text) in another text using 'positions of %texts% in %text%'. Nothing is returned when the value does not occur in the text. Positions range from 1 to the length of the text (inclusive).
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.
set {_first} to the first position of "@" in the text argument
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 6set {_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 4positive (infinity|โ) [value]โ [value]infinity valuevalue of [positive] (infinity|โ)A number representing positive infinity.
if {_number} is infinity:[the] [event-]initiator[( |-)inventory]Returns the initiator inventory in an on inventory item move event.
on inventory item move:
holder of event-initiator-inventory is a chest
broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"input<.+> inputinput indexRepresents the input in a filter expression or sort effect.
For example, if you ran 'broadcast "something" and "something else" where [input is "something"]
the condition would be checked twice, using "something" and "something else" as the inputs.
The 'input index' pattern can be used when acting on a variable to access the index of the input.
send "congrats on being staff!" to all players where [input has permission "staff"]sort {_list::*} based on length of input index[the] interaction (height|width)[s] of %entities%%entities%'[s] interaction (height|width)[s]Returns the height or width of an interaction entity's hitbox. Both default to 1.
The width of the hitbox determines the x/z widths
set interaction height of last spawned interaction to 5.3set interaction width of last spawned interaction to 2[the] inventor(y|ies) of %inventory holders/blocks/item types/items%%inventory holders/blocks/item types/items%'[s] inventor(y|ies)The inventory of a block or player. You can usually omit this expression and can directly add or remove items to/from blocks or players.
add a plank to the player's inventoryclear the player's inventoryremove 5 wool from the inventory of the clicked block[the] inventory actionThe inventory action of an inventory event. Please click on the link for more information.
inventory action is pickup all[the] inventory clos(e|ing) (reason|cause)The inventory close reason of an inventory close event.
on inventory close:
inventory close reason is teleport
send "Your inventory closed due to teleporting!" to player[the] holder[s] of %inventories%%inventories%'[s] holder[s]No matching entry in Skript's documentation.
([amount of] rows|[amount of] slots) of %inventories%%inventories%'[s] ([amount of] rows|[amount of] slots)Gets the amount of rows/slots, viewers and holder of an inventory.
NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.
event-inventory's amount of rowsholder of player's top inventory{_inventory}'s viewers[a] [new] %inventory type% (named|with name) %text%[a] new %inventory type%No matching entry in Skript's documentation.
[the] slot[s] %numbers% of %inventory%%inventory%'[s] slot[s] %numbers%Represents a slot in an inventory. It can be used to change the item in an inventory too.
if slot 0 of player is air:
set slot 0 of player to 2 stones
remove 1 stone from slot 0 of player
add 2 stones to slot 0 of player
clear slot 1 of player[the] (inverse|opposite)[s] of %booleans%An expression to obtain the inverse value of a boolean
set {_gravity} to inverse of player's flight modeIP[s][( |-)address[es]] of %players%%players%'[s] IP[s][( |-)address[es]]IP[( |-)address]The IP address of a player, or the connected player in a connect event, or the pinger in a server list ping event.
ban the IP address of the player")
broadcast "Banned the IP %IP of player%"on connect:
log "[%now%] %player% (%ip%) is connected to the server."on server list ping:
send "%IP-address%" to the console[the] item[[ ]stack] (amount|size|number) of %slots/item types/items%%slots/item types/items%'[s] item[[ ]stack] (amount|size|number)The amount of an item stack.
send "You have got %item amount of player's tool% %player's tool% in your hand!" to player[the|a[n]] [item] component copy of %item components%[the] [item] component copies of %item components%Grab a copy of an item component of an item. Any changes made to the copy will not be present on the item.
set {_component} to the item component copy of (the equippable component of {_item})[the] [item] cooldown of %item types% for %players%%players%'[s] [item] cooldown for %item types%Gets the current cooldown of a provided item for a player.
If the provided item has a cooldown group component specified the cooldown of the group will be prioritized.
Otherwise the cooldown of the item material will be used.
on right click using stick:
set item cooldown of player's tool for player to 1 minute
set item cooldown of stone and grass for all players to 20 seconds
reset item cooldown of cobblestone and dirt for all players[the] item [display] transform[s] [of %entities%]%entities%'[s] item [display] transform[s]Returns or changes the item display transform of item displays.
set the item transform of the last spawned item display to first person left handedset the item transform of the last spawned item display to no transform # Reset to default[the] enchantments of %item types%%item types%'[s] enchantmentsAll the enchantments an item type has.
clear enchantments of event-item[the] item flags of %item types%%item types%'[s] item flagsThe item flags of an item. Can be modified.
set item flags of player's tool to hide enchants and hide attributesadd hide potion effects to item flags of player's held itemremove hide enchants from item flags of {legendary sword}[the] item model of %item types/slots%%item types/slots%'[s] item modelThe item model of an item. Accepts a Namespaced Key which takes the form of "namespace:key", e.g. "minecraft:dirt". See this article for more detail.
set the item model of player's held item to "diamond"set the item model of {_item} to "minecraft:dirt"[the] item [inside] of %entities%%entities%'[s] item [inside]An item associated with an entity. For dropped item entities, it gets the item that was dropped.
For item frames, the item inside the frame is returned.
For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item.
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.
item of event-entityset the item inside of event-entity to a diamond sword named "Example"[the] item rarity of %item types/slots%%item types/slots%'[s] item rarityThe item rarity of an item.
set the item rarity of player's tool to epicset the item rarity of {_item} to uncommonset {_rarity} to item rarity of player's held itemunbreakable %item types%breakable %item types%No matching entry in Skript's documentation.
%item type% with [custom] model data %numbers/booleans/texts/colours%Get an item with custom model data.
give player a diamond sword with custom model data 2set slot 1 of inventory of player to wooden hoe with custom model data 357give player a diamond hoe with custom model data 2, true, true, "scythe", and rgb(0,0,100)%item types% with[out] [enchant[ment]] glintGet an item with or without enchantment glint.
set {_item with glint} to diamond with enchantment glintset {_item without glint} to diamond without enchantment glint%item types% with [the] item flag[s] %item flags%%item types% with [the] %item flags% item flag[s]%item types% with all [the] item flagsCreates a new item with the specified item flags.
give player diamond sword with item flags hide enchants and hide attributesset {_item} to player's tool with item flag hide additional tooltipgive player torch with hide placed on item flagset {_item} to diamond sword with all item flags%item types% with [an|the] [item] model %text%No matching entry in Skript's documentation.
%item type% with [a|the] lore %texts%Returns a copy of an item with with new lore.
If passing multiple components, each with be a line of lore.
set {_item} to stone with lore "line 1" and "line 2"
give {_item} to player%item types% with [entire|additional] tool[ ]tip[s]%item types% without [entire|additional] tool[ ]tip[s]Get an item with or without entire/additional tooltip.
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.
set {_item with additional tooltip} to diamond with additional tooltipset {_item without entire tooltip} to diamond without entire tooltip[all [[of] the]|the] block[[ ]type]severy block[[ ]type][all [[of] the]|the|every] item[s] of type[s] %item types%[all [[of] the]|the|every] block[s] of type[s] %item types%Items or blocks of a specific type, useful for looping.
loop tag values of tag "diamond_ores" and tag values of tag "oak_logs":
block contains loop-item
message "Theres at least one %loop-item% in this block"drop all blocks at the player # drops one of every block at the player[all [[of] the]] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%all [[of] the] %item types% ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%All items or specific type(s) of items in an inventory. Useful for looping or storing in a list variable.
Please note that the positions of the items in the inventory are not saved, only their order is preserved.
loop all items in the player's inventory:
loop-item is enchanted
remove loop-item from the playerset {inventory::%uuid of player%::*} to items in the player's inventory(concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]split %text% (at|using|by) [[the] delimiter] %text% [with case sensitivity] [without [the] trailing [empty] (string|text)]%text% split (at|using|by) [[the] delimiter] %text% [with case sensitivity] [without [the] trailing [empty] (string|text)]regex split %text% (at|using|by) [[the] delimiter] %text% [without [the] trailing [empty] (string|text)]regex %text% split (at|using|by) [[the] delimiter] %text% [without [the] trailing [empty] (string|text)]Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.
message "Online players: %join all players' names with "" | ""%" # %all players% would use the default "x, y, and z"set {_s::*} to the string argument split at ","[the] (join|log[ ]in)( |-)messageThe message sent to all online players when a player joins the server.
on first join:
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%!"[the] boss[ ]bar (key|id) of %boss bars%%boss bars%'[s] boss[ ]bar (key|id)Returns the key of a keyed boss bar.
Does not return anything for normal boss bars.
broadcast the boss bar key of {_mybar}keyed %objects%This expression is used to explicitly pass the keys of an expression alongside its values.
For example, when setting a list variable or passing an expression to a function.
set {_first::foo} to "value1"
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[the] kick( |-)messageThe message sent to all online players when a player is kicked from server.
on kick:
set the kick message to "%player% was booted from the server! They won't be missed..."[the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%%players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]Currently selected game language of a player. The value of the language is not defined properly.
The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
message player's current language[the] last attacker of %entity%%entity%'[s] last attackerThe last block or entity that attacked an entity.
send "%last attacker of event-entity%"[the] last caught [run[ ]time] errorsGets the last caught runtime errors from a 'catch runtime errors' section.
catch runtime errors:
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)[the] last damage [taken] (of|by) %living entities%%living entities%'[s] last damage [taken]The last damage that was done to an entity. Note that changing it doesn't deal more/less damage.
set last damage of event-entity to 2[the] last damage (cause|reason|type) of %living entities%%living entities%'[s] last damage (cause|reason|type)Cause of last damage done to an entity
set last damage cause of event-entity to fire tick[the] [last] death location[s] of %offline players%%offline players%'[s] [last] death location[s]Gets the last death location of a player, or offline player, if available.
Can also be set, reset, and deleted if the player is online.
set {_loc} to the last death location of playerteleport player to last death location of (random element out of all players)[the] [last[ly]] dropped itemNo matching entry in Skript's documentation.
[the] last (date|time)[s] [that|when] %entities% (were|was) (attacked|interacted with|clicked [on])Returns the date of the last attack (left click), or interaction (right click) on an interaction entity
Using 'clicked on' will return the latest attack or interaction, whichever was more recent.
if the last time {_interaction} was clicked < 5 seconds ago[the] last player[s] to (attack|interact with|click [on]) %entities%[the] last player[s] (who|that) (attacked|interacted with|clicked [on]) %entities%Returns the last player to attack (left click), or interact (right click) with an interaction entity.
If 'click on' or 'clicked on' are used, this will return the last player to either attack or interact with the entity whichever was most recent.
kill the last player that attacked the last spawned interactionfeed the last player who interacted with {_i}[the] [last[ly]] loaded server iconReturns the last loaded server icon with the load server icon effect.
set {server-icon} to the last loaded server icon[the] [last] resource pack response[s] of %players%%players%'[s] [last] resource pack response[s]Returns the last resource pack response received from a player.
if player's last resource pack response is deny or download fail:[the] [last[ly]] (spawned|shot) %entity type%[the] [last[ly]] (launched|deployed) firework[the] [last[ly]] (created|struck) lightningHolds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.
spawn a priest
set {healer::%spawned priest%} to trueshoot an arrow from the last spawned entity
ignite the shot projectiledrop a diamond sword
push last dropped item upwardsteleport player to last struck lightningdelete last launched firework[the] (last|first) login of %offline players%%offline players%'[s] (last|first) loginWhen a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.
command /onlinefor:
trigger:
send "You have been online for %difference between player's last login and now%."
send "You first joined the server %difference between player's first login and now% ago."[the] leash holder[s] of %entities%%entities%'[s] leash holder[s]The leash holder of an entity.
set {_example} to the leash holder of the target mob[the] length of %texts%%texts%'[s] lengthThe length of a text, in number of characters.
set {_l} to length of the string argument[the] [xp|exp[erience]] level [of %players%]%players%'[s] [xp|exp[erience]] levelThe experience level of a player.
reduce the victim's level by 1set the player's level to 0on level change:
set {_diff} to future xp level - past exp level
broadcast "%player%'s level changed by %{_diff}%!"[the] level progress of %players%%players%'[s] level progressThe player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar).
Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
# use the exp bar as mana
on rightclick with a blaze rod:
player's level progress is larger than 0.2
shoot a fireball from the player
reduce the player's level progress by 0.2
every 2 seconds:
loop all players:
level progress of loop-player is smaller than 0.9:
increase level progress of the loop-player by 0.1
else:
set level progress of the loop-player to 0.99
on xp spawn:
cancel event[(sky|sun|block)[ ]]light[ ]level [(of|%direction%) %location%]Gets the light level at a certain location which ranges from 0 to 15.
It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.
# set vampire players standing in bright sunlight on fire
every 5 seconds:
loop all players:
{vampire::%uuid of loop-player%} is true
sunlight level at the loop-player is greater than 10
ignite the loop-player for 5 seconds[(all [[of] the]|the)] [loaded] pluginsAn expression to obtain a list of the names of the server's loaded plugins.
if the loaded plugins contains "Vault":
broadcast "This server uses Vault plugin!"send "Plugins (%size of loaded plugins%): %plugins%" to player[the] (location|position) %directions% [%location%]The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).
drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'set {_loc} to the location 1 meter above the player(location|position) of %location%%location%'[s] (location|position)The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time).
Please note that the location of an entity is at it's feet, use head location to get the location of the head.
set {home::%uuid of player%} to the location of the playermessage "You home was set to %player's location% in %player's world%."[the] (location|position) [at] [(][x[ ][=[ ]]]%number%, [y[ ][=[ ]]]%number%, [and] [z[ ][=[ ]]]%number%[)] [[(in|of) [[the] world]] %world%]Allows to create a location from three coordinates and a world.
set {_loc} to the location at arg-1, arg-2, arg-3 of the world arg-4distance between the player and the location (0, 0, 0) is less than 200%locations% with [a] (yaw|pitch) [of] %number%%locations% with [a] yaw [of] %number% and [a] pitch [of] %number%Returns the given locations with the specified yaw and/or pitch.
set {_location} to player's location with yaw 0 and pitch 0[the] [current] loop-<.+>[the] next loop-<.+>[the] previous loop-<.+>[the] loop <(?:counter|iteration)(?:-\d+)?>Returns the previous, current, or next looped value.
# Countdown
loop 10 times:
message "%11 - loop-number%"
wait a second# Generate a 10x10 floor made of randomly colored wool below the player
loop blocks from the block below the player to the block 10 east of the block below the player:
loop blocks from the loop-block to the block 10 north of the loop-block:
set loop-block-2 to any woolloop {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[the] lootThe loot that will be generated in a 'loot generate' event.
on loot generate:
chance of 10%
add 64 diamonds to loot
send "You hit the jackpot!!"[the] loot[ing] [context] location [of %loot contexts%]%loot contexts%'[s] loot[ing] [context] locationReturns the loot location of a loot context.
set {_player} to player
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[the] loot of %loot tables% [(with|using) [[loot] context] %loot context%]%loot tables%'[s] loot [(with|using) [[loot] context] %loot context%]Returns the items of a loot table using a loot context. Not specifying a loot context will use a loot context with a location at the world's origin.
set {_items::*} to loot of the loot table "minecraft:chests/simple_dungeon" with loot context {_context}
# this will set {_items::*} to the items that would be dropped from the simple dungeon loot table with the given loot contextgive 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[the] loot[ ]table[s] of %entities/blocks%%entities/blocks%'[s] loot[ ]table[s]Returns the loot table of an entity or block.
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.
set loot table of event-entity to "minecraft:entities/ghast"
# this will set the loot table of the entity to a ghast's loot table, thus dropping ghast tears and gunpowderset loot table of event-block to "minecraft:chests/simple_dungeon"[the] loot[ ]table[s] %texts%Returns the loot table from a namespaced key.
set {_table} to loot table "minecraft:chests/simple_dungeon"[the] looted entity [of %loot contexts%]%loot contexts%'[s] looted entityReturns the looted entity of a loot context.
set {_entity} to looted entity of {_context}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[the] (looter|looting player) [of %loot contexts%]%loot contexts%'[s] (looter|looting player)Returns the looter of a loot context. Note that setting the looter will read the looter's tool enchantments (e.g. looting) when generating loot.
set {_killer} to looter of {_context}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[the] lore of %item type/slot%%item type/slot%'[s] lore[the] line %number% of [the] lore of %item type/slot%[the] line %number% of %item type/slot%'[s] lore[the] %number%(st|nd|rd|th) line of [the] lore of %item type/slot%[the] %number%(st|nd|rd|th) line of %item type/slot%'[s] loreReturns the lore of an item.
set the 1st line of the item's lore to "<orange>Excalibur 2.0"[the] love[d] time of %living entities%%living entities%'[s] love[d] timeThe amount of time the animals have been in love for. Using a value of 30 seconds is equivalent to using an item to breed them.
Only works on animals that can be bred and returns '0 seconds' for animals that can't be bred.
on right click:
send "%event-entity% has been in love for %love time of event-entity% more than you!" to player[the] (highest|lowest) [solid] block[s] (at|of) %locations%An expression to obtain the lowest or highest solid (impassable) block at a location.
Note that the y-coordinate of the location is not taken into account for this expression.
teleport the player to the block above the highest block at the playerset the highest solid block at the player's location to the lowest solid block at the player's location[the] loot[ing] [context] luck [value|factor] [of %loot contexts%]%loot contexts%'[s] loot[ing] [context] luck [value|factor]Returns the luck of a loot context as a float. This represents the luck potion effect that an entity can have.
set {_luck} to loot luck value of {_context}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[the] max[imum] (durabilit(y|ies)|damage) of %item types/items/slots%%item types/items/slots%'[s] max[imum] (durabilit(y|ies)|damage)The maximum durability of an item. Changing requires Minecraft 1.20.5+
Note: 'delete' will remove the max durability from the item (making it a non-damageable item). Delete requires Paper 1.21+
maximum durability of diamond swordif max durability of player's tool is not 0: # Item is damageableset max durability of player's tool to 5000add 5 to max durability of player's toolreset max durability of player's tooldelete max durability of player's tool[the] max[imum] health of %living entities%%living entities%'[s] max[imum] healthThe maximum health of an entity, e.g. 10 for a player.
on join:
set the maximum health of the player to 100spawn a giant
set the last spawned entity's max health to 1000[the] max[imum] [item] us(e|age) (time|duration) of %items%%items%'[s] max[imum] [item] us(e|age) (time|duration)Returns the max duration an item can be used for before the action completes. E.g. it takes 1.6 seconds to drink a potion, or 1.4 seconds to load an unenchanted crossbow.
Some items, like bows and shields, do not have a limit to their use. They will return 1 hour.
on right click:
broadcast max usage duration of player's tool[the] max[imum] minecart (speed|velocity) of %entities%%entities%'[s] max[imum] minecart (speed|velocity)The maximum speed of a minecart.
on right click on minecart:
set max minecart speed of event-entity to 1[the] [(real|default)|(fake|shown|displayed)] max[imum] player[s] [count|amount|number|size][the] [(real|default)|(fake|shown|displayed)] max[imum] (count|amount|number|size) of playersThe count of max players. This can be changed in a server list ping event only.
'real max players' returns the real count of max players of the server and can be modified on Paper 1.16 or later.
on server list ping:
set the max players count to (online players count + 1)[the] max[imum] double valueA number representing the maximum value of a double number type.
if {_number} >= maximum double value:[the] max[imum] float valueA number representing the maximum value of a float number type.
if {_number} >= maximum float value:[the] max[imum] freeze time of %entities%%entities%'[s] max[imum] freeze timeThe maximum amount of time an entity can spend in powdered snow before taking damage.
difference between player's freeze time and player's max freeze time is less than 1 second:
send "you're about to freeze!" to the player[the] max[imum] integer valueA number representing the maximum value of an integer number type.
if {_number} >= maximum integer value:[the] max[imum] long valueA number representing the maximum value of a long number type.
if {_number} >= maximum long value:[the] max[imum] stack[[ ]size] of %item types/inventories%%item types/inventories%'[s] max[imum] stack[[ ]size]The maximum stack size of an item (e.g. 64 for torches, 16 for buckets, 1 for swords, etc.) or inventory.
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.
send "You can hold %max stack size of player's tool% of %type of player's tool% in a slot." to playerset the maximum stack size of inventory of all players to 16add 8 to the maximum stack size of player's toolreset the maximum stack size of {_gui}memy[self]A 'me' expression that can be used in players' effect commands only.
!heal me!kick myself!give a diamond axe to me[the] [mending] repair amountThe number of durability points an item is to be repaired in a mending event.
Modifying the repair amount will affect how much experience is given to the player after mending.
on item mend:
set the mending repair amount to 100[the] [default|shown|displayed] (MOTD|message of [the] day)The message of the day in the server list.
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.
on server ling ping:
set the motd to "<red>Join our server today!"metadata [(value|tag)[s]] %texts% of %entities/blocks/worlds%%entities/blocks/worlds%'[s] metadata [(value|tag)[s]] %texts%Metadata is a way to store temporary data on entities, blocks and more that disappears after a server restart.
set metadata value "healer" of player to truebroadcast "%metadata value "healer" of player%"clear metadata value "healer" of player[the] (middle|center) [point] of %location%%location%'[s] (middle|center) [point]Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.
command /stuck:
executable by: players
trigger:
teleport player to the center of player's location
send "You're no longer stuck."[the] mid[-]point (of|between) %location/vector% and %location/vector%Get the midpoint between two vectors or two locations in the same world.
set {_center} to the midpoint between location(0, 0, 0) and location(10, 10, 10)
set {_centerBlock} to the block at {_center}set {_midpoint} to the mid-point of vector(20, 10, 5) and vector(3, 6, 9)[the] [minecart] (derailed|flying) velocity of %entities%%entities%'[s] [minecart] (derailed|flying) velocityThe velocity of a minecart as soon as it has been derailed or as soon as it starts flying.
on right click on minecart:
set derailed velocity of event-entity to vector 2, 10, 2[the] min[imum] double valueA number representing the minimum value of a double number type.
if {_number} <= minimum double value:[the] min[imum] float valueA number representing the minimum value of a float number type.
if {_number} <= minimum float value:[the] min[imum] integer valueA number representing the minimum value of an integer number type.
if {_number} <= minimum integer value:[the] min[imum] long valueA number representing the minimum value of a long number type.
if {_number} <= minimum long value:[the] ((max|min)[imum]|starting) enchant[ment] level [of %enchantments%]%enchantments%'[s] ((max|min)[imum]|starting) enchant[ment] levelThe minimum or maximum allowed level in Minecraft of a particular enchantment.
The minimum starting level is 1 for all existing enchantments as of 26.1.2.
set {_maximum} to the maximum enchantment level of sharpness
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!"[the] (lunar|moon) phase[s] of %worlds%%worlds%'[s] (lunar|moon) phase[s]The current moon phase of a world.
if moon phase of player's world is full moon:
send "Watch for the wolves!"[the] moved blocksBlocks which are moved in a piston event. Cannot be used outside of piston events.
the moved blocks[the] name[s] of %objects%%objects%'[s] name[s]Represents the Minecraft account name of a player, or the custom name of an item, entity, block, inventory, gamerule, world, script or function.
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.
on join: 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"[the] (display|nick|chat|custom)[ ]name[s] of %objects%%objects%'[s] (display|nick|chat|custom)[ ]name[s]Represents the Minecraft account name of a player, or the custom name of an item, entity, block, inventory, gamerule, world, script or function.
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.
on join: 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"%item type% (named|with name[s]) %text%Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.
give a diamond sword of sharpness 100 named "<gold>Excalibur" to the playerset 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 playerNaN [value]value of NaNA number representing an undefined value. NaN occurs as a result of illegal math, like dividing 0 by 0.
NaN is deliberately not equal to any other number, including itself.
if {_number} is not {_number}:if isNaN({_number}) is true:[the] (nearest|closest) %entity types% [[relative] to %entity/location%][the] %entity types% (nearest|closest) [to %entity/location%]Gets the entity nearest to a location or another entity.
kill the nearest pig and cow relative to playerteleport player to the nearest cow relative to playerteleport player to the nearest entity relative to playeron click:
kill nearest pignegative (infinity|โ) [value]-(infinity|โ) [value]value of negative (infinity|โ)A number representing negative infinity.
if {_number} is -infinity:nlnew[ ]lineline[ ]breakReturns a line break separator.
send "Hello%nl%Goodbye!" to player[a[n]] [ambient] potion effect of %potion effect type% [[of tier] %number%] [for %time span%][an] (infinite|permanent) [ambient] potion effect of %potion effect type% [[of tier] %number%][an] (infinite|permanent) [ambient] %potion effect type% [[of tier] %number%] [potion [effect]][a] potion effect [of %potion effect type%] (from|using|based on) %potion effect%Create a new potion effect that can be applied to an entity or item type.
set {_potion} to a potion effect of speed 2 for 10 minutes:
hide the effect's icon
hide the effect's particlesadd strength 5 to the potion effects of the player's toolapply invisibility to the player for 5 minutes:
hide the effect's particlesadd 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%potion effect type% %integer%Create a new potion effect that can be applied to an entity or item type.
set {_potion} to a potion effect of speed 2 for 10 minutes:
hide the effect's icon
hide the effect's particlesadd strength 5 to the potion effects of the player's toolapply invisibility to the player for 5 minutes:
hide the effect's particlesadd 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[the] (invulnerability|invincibility|no damage) tick[s] [of %living entities%]%living entities%'[s] (invulnerability|invincibility|no damage) tick[s]The number of ticks that an entity is invulnerable to damage for.
on damage:
set victim's invulnerability ticks to 20 #Victim will not take damage for the next second[the] (invulnerability|invincibility|no damage) time[[ ]span] [of %living entities%]%living entities%'[s] (invulnerability|invincibility|no damage) time[[ ]span]The amount of time an entity is invulnerable to any damage.
on damage:
set victim's invulnerability time to 20 ticks #Victim will not take damage for the next secondif the no damage timespan of {_entity} is 0 seconds:
set the invincibility time span of {_entity} to 1 minute[the] node %text% (of|in) %node/script%%node/script%'[s] node %text%[the] nodes (of|in) %nodes/scripts%%nodes/scripts%'[s] nodesReturns a node inside a config (or another section-node).
Nodes in Skript configs are written in the format `key: value`.
Section nodes can contain other nodes.
set {_node} to node "language" in the skript config
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-valuenowThe current system time of the server. Use time to get the Minecraft time of a world.
broadcast "Current server time: %now%"number of upper[ ]case char(acters|s) in %text%number of lower[ ]case char(acters|s) in %text%number of digit char(acters|s) in %text%The number of uppercase, lowercase, or digit characters in a string.
#Simple Chat Filter
on chat:
if number of uppercase chars in message / length of message > 0.5
cancel event
send "<red>Your message has to many caps!" to player[(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%All numbers between two given numbers, useful for looping.
Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers.
You may also use 'decimals' if you want to use the decimal precision of the start number.
You may want to use the 'times' expression instead, for instance 'loop 5 times:'
loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4[(all [[of] the]|the)] offline[ ]playersAll players that have ever joined the server. This includes the players currently online.
send "Size of all players who have joined the server: %size of all offline players%"[the] on-screen kick messageThe kick message that is displayed on a player's screen when they are kicked.
on kick:
set the on-screen kick message to "You've been booted!"[the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)[the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online playersThe amount of online players. This can be changed in a server list ping event only to show fake online player amount.
real online player count always return the real count of online players and can't be changed.
on server list ping:
# This will make the max players count 5 if there are 4 players online.
set the fake max players count to (online player count + 1)[the] (current|open|top) inventory [of %players%]%players%'[s] (current|open|top) inventoryReturn the currently opened inventory of a player.
If no inventory is open, it returns the own player's crafting inventory.
set slot 1 of player's current inventory to diamond sword[the] (main|hidden) gene[s] of %living entities%%living entities%'[s] (main|hidden) gene[s]The main or hidden gene of a panda.
if the main gene of last spawned panda is lazy:
set the main gene of last spawned panda to playful%text% parsed as [a[n]] <.+>Parses text as a given type, or as a given pattern.
This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern.
If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available.
Some notes about parsing with a pattern:
- The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there.
- You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...".
- The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
set {var} to line 1 parsed as numberon 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%text% parsed as "<.*>"Parses text as a given type, or as a given pattern.
This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern.
If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available.
Some notes about parsing with a pattern:
- The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there.
- You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...".
- The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.
set {var} to line 1 parsed as numberon chat:
set {var::*} to message parsed as "buying %items% for %money%"
if parse error is set:
message "%parse error%"
else if {var::*} is set:
cancel event
remove {var::2} from the player's balance
give {var::1::*} to the player[the] [last] [parse] errorThe error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.
set {var} to line 1 parsed as integer
if {var} is not set:
parse error is set:
message "<red>Line 1 is invalid: %last parse error%"
else:
message "<red>Please put an integer on line 1!"[the] particle count of %particle effects%%particle effects%'[s] particle countSets how many particles to draw.
Particle count has an influence on how the 'offset' and 'extra' values of a particle apply.
Offsets are treated as distributions if particle count is greater than 0.
Offsets are treated as velocity or some other special behavior if particle count is 0.
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.
draw 7 blue dust particles at player[the] particle distribution of %particle effects%%particle effects%'[s] particle distributionDetermines the normal distribution that particles may be drawn within.
The distribution is defined by a vector of x, y, and z standard deviations.
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.
set the particle distribution of {_my-particle} to vector(1, 2, 1)[the] particle offset of %particle effects%%particle effects%'[s] particle offsetDetermines the offset value for a particle.
Offsets are treated as distributions if particle count is greater than 0.
Offsets are treated as velocity or some other special behavior if particle count is 0.
Setting distribution/velocity with this method may change the particle count to 1/0 respectively.
More detailed information on particle behavior can be found at Paper's particle documentation.
set the particle offset of {_my-particle} to vector(1, 2, 1)[the] (particle speed [value]|extra value) of %particle effects%%particle effects%'[s] (particle speed [value]|extra value)Determines the specific 'speed' or 'extra' value of a particle.
This value is used in different ways depending on the particle, but in general it:
* acts as the speed at which the particle moves if the particle count is greater than 0.
* acts as a multiplier to the particle's offset if the particle count is 0.
More detailed information on particle behavior can be found at Paper's particle documentation.
set the extra value of {_my-flame-particle} to 2set the particle speed of {_my-flame-particle} to 0%particle effects% with [an] offset [of] %vector%%particle effects% with [a] distribution [of] %vector%%directional particle effects% with [a] velocity [of] %vector%Applies a specific offset to a particle.
Offsets are treated as distributions if particle count is greater than 0.
Offsets are treated as velocity or some other special behavior if particle count is 0.
Setting distribution/velocity with this method may change the particle count to 1/0 respectively.
More detailed information on particle behavior can be found at Paper's particle documentation.
draw an electric spark particle with a velocity of vector(1,2,3) at playerdraw 12 red dust particles with a distribution of vector(1,2,1) at player's head location%particle effects% with ([a] particle speed [value]|[an] extra value) [of] %number%Applies a specific 'speed' or 'extra' value to a particle.
This value is used in different ways depending on the particle, but in general it:
* acts as the speed at which the particle moves if the particle count is greater than 0.
* acts as a multiplier to the particle's offset if the particle count is 0.
More detailed information on particle behavior can be found at Paper's particle documentation.
draw an electric spark particle with a particle speed of 0 at playerdraw 12 red dust particles with an extra value of 0.4 at player's head location[%number%|a[n]] %colour% effect particle[s] (of|with) power %number%[%number%|a[n]] %colour% instant effect particle[s] (of|with) power %number%[%number%|a[n]] %colour% flash particle[s][%number%|a[n]] %colour% (potion|entity) effect particle[s][%number%|a[n]] %colour% tinted leaves particle[s][%number%|a[n]] %colour% dust particle[s] [of size %number%][%number%|a[n]] %colour% dust particle[s] [of size %number%] that transitions to %colour%[%number%|a[n]] %item type/block data% block particle[s][%number%|a[n]] %item type/block data% [block] crumble particle[s][%number%|a[n]] %item type/block data% [block] marker particle[s][%number%|a[n]] %item type/block data% dust pillar particle[s][%number%|a[n]] falling %item type/block data% dust particle[s][%number%|a[n]] %item type% item particle[s][%number%|a[n]] sculk charge particle[s] [with [a] roll angle [of] %number%][%number%|a[n]] shriek particle[s] [delayed by %time span%][%number%|a[n]] vibration particle[s] moving to[wards] %entity/location% [over [a duration of] %time span%][%number%|a[n]] %colour% trail particle[s] moving to[wards] %location% [over [a duration of] %time span%][%number%|a[n]] dragon breath particle[s] [of power %number%]Creates particles that require some extra information, such as colors, locations, or block data.
Particles not present here do not require data and can be found in the Particle type.
Data requirements vary from version to version, so these docs are only accurate for the most recent Minecraft version at time of release.
For example, between 1.21.8 and 1.21.9, the 'flash' particle became colourable and now requires a colour data.
set {blood-effect} to a red dust particle of size 1draw 3 blue trail particles moving to player's target over 3 seconds at player[all [[of] the]|the] passenger[s] of %entities%%entities%'[s] passenger[s]The passenger of a vehicle, or the rider of a mob.
For 1.11.2 and above, it returns a list of passengers and you can use all changers in it.
See also: vehicle
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat[the] path[ ]finding target [entity]The target entity that another entity is pathfinding towards in a pathfinding event.
on pathfind:
if the pathfinding target entity is a villager:
broadcast "I suspect a zombie is going towards a villager right now.."[the] path[ ]finding target locationThe location that the entity is pathfinding towards.
on pathfind:
if the pathfinding target location is within radius 5 of {mylocation}:
broadcast "A mob tried to pathfind near a forbidden location!"
cancel event%number%(%| percent) of %numbers%Returns a percentage of one or more numbers.
set damage to 10% of victim's healthset damage to 125 percent of damageset {_result} to {_percent} percent of 999set {_result::*} to 10% of {_numbers::*}set experience to 50% of player's total experience[the] [persistent] [<.+> ][list ]data (value|tag) %text% of %chunks/worlds/entities/blocks/item types/offline players%%chunks/worlds/entities/blocks/item types/offline players%'[s] [persistent] [<.+> ][list ]data (value|tag) %text%Provides access to the 'persistent data container' Bukkit provides on many objects. These values are stored on the chunk/world/item/entity directly, like custom NBT, but are much faster and reliable to access.
Persistent values natively support numbers and text, but any Skript type that can be saved in a variable can also be stored in PDC via this expression. Lists of objects can also be saved.
If you attempt to save invalid types, runtime errors will be thrown.
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'.
set persistent data tag "custom_damage" of player's tool to 10on jump:
if data tag "boost" of player's boots is set:
push player upwardson 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(pi|ฯ)Returns the mathematical constant pi. (approx. 3.1415926535)
set {_tau} to pi * 2[the] picked (item|block|entity)The item, block, or entity picked by a player using the pick block key (default middle mouse button).
on player pick item:
send "You picked %the picked item%!" to the player[the] pick[ ]up delay of %entities%%entities%'[s] pick[ ]up delayThe amount of time before a dropped item can be picked up by an entity.
drop diamond sword at {_location} without velocityset pickup delay of last dropped item to 5 seconds[the] ping of %players%%players%'[s] pingPings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).
command /ping <player=%player%>:
trigger:
send "%arg-1%'s ping is %arg-1's ping%"[a[n]] (plain|unmodified) %item type%A plain item is an item with no modifications. It can be used to convert items to their default state or to match with other default items.
if the player's tool is a plain diamond: # check if player's tool has no modifications
send "You are holding a plain diamond!"[the] [custom] chat completion[s] of %players%%players%'[s] [custom] chat completion[s]The custom chat completion suggestions. You can add, set, remove, and clear them. Removing the names of online players with this expression is ineffective.
This expression will not return anything due to Bukkit limitations.
add "Skript" and "Njol" to chat completions of all playersremove "text" from {_p}'s chat completionsclear player's chat completions[the] [current] (inputs|input keys) of %players%%players%'[s] [current] (inputs|input keys)Get the current input keys of a player.
broadcast "%player% is pressing %current input keys of player%"[the] (player|tab)[ ]list (header|footer) [text|message] of %players%%players%'[s] (player|tab)[ ]list (header|footer) [text|message]The message above and below the player list in the tab menu.
set all players' tab list header to "Welcome to the Server!"send "%the player's tab list header%" to playerreset all players' tab list header[the] (player|tab)[ ]list name[s] of %players%%players%'[s] (player|tab)[ ]list name[s]The name of a player in the player list in the tab menu.
on join:
player has permission "name.red"
set the player's tab list name to "<red>%player's name%"[the] (player|tab)[ ]list priority of %players%%players%'[s] (player|tab)[ ]list priorityThe priority of the player in the player list in the tab menu.
Used to sort players on the tab list. Lowest priority is at the bottom of tab and highest priority is at the top.
If 2 players have same priority then they will be sorted A-Z (but still be above those with lower priority).
on join:
player has permission "group.mod"
set the player's tab list priority to 5[the] protocol version of %players%%players%'[s] protocol versionPlayer's protocol version. For more information and list of protocol versions visit wiki.vg.
command /protocolversion <player>:
trigger:
send "Protocol version of %arg-1%: %protocol version of arg-1%"[the] skull of %offline players%%offline players%'[s] skullGets a skull item representing a player. Skulls for other entities are provided by the aliases.
give the victim's skull to the attackerset the block at the entity to the entity's skull[the] portal['s] blocks[the] blocks of [the] portalThe blocks associated with a portal in the portal creation event.
on portal creation:
loop portal blocks:
broadcast "%loop-block% is part of a portal!"[the] portal cooldown of %entities%%entities%'[s] portal cooldownThe amount of time before an entity can use a portal. By default, it is 15 seconds after exiting a nether portal or end gateway.
Players in survival/adventure get a cooldown of 0.5 seconds, while those in creative get no cooldown.
Resetting will set the cooldown back to the default 15 seconds for non-player entities and 0.5 seconds for players.
on portal:
wait 1 tick
set portal cooldown of event-entity to 5 seconds[the] ([potion] amplifier|potion tier|potion level)[s] of %potion effects%%potion effects%'[s] ([potion] amplifier|potion tier|potion level)[s]An expression to obtain the amplifier of a potion effect.
set the amplifier of {_potion} to 10add 10 to the amplifier of the player's speed effect[the] ([potion] duration|potion length)[s] of %potion effects%%potion effects%'[s] ([potion] duration|potion length)[s]An expression to obtain the duration of a potion effect.
set the duration of {_potion} to 10 secondsadd 10 seconds to the duration of the player's speed effect[the] [active|active and hidden] %potion effect types% [potion] effect[s] of %living entities/item types/slots%%living entities/item types/slots%'[s] [active|active and hidden] %potion effect types% [potion] effect[s]An expression to obtain a specific potion effect type of an entity or item.
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.
set {_effect} to the player's active speed effectadd 10 seconds to the player's slowness effectclear the player's hidden strength effectsreset the player's weakness effectsdelete the player's active jump boost effect[the] potion [effect [type]] categor(y|ies) of %potion effect types%%potion effect types%'[s] potion [effect [type]] categor(y|ies)An expression to obtain the category of a potion effect type.
That is, whether the potion effect type is beneficial, harmful, or neutral.
on entity potion effect modification:
if the potion effect type category is harmful:
message "You have been afflicted with %potion effect type%"[the] [active|active and hidden] potion effects of %living entities/item types/slots%%living entities/item types/slots%'[s] [active|active and hidden] potion effectsAn expression to obtain the active or hidden potion effects of an entity or item.
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.
set {_effects::*} to the active potion effects of the playerclear the player's hidden potion effectsadd the potion effects of the player to the potion effects of the player's toolreset the potion effects of the player's toolremove speed and night vision from the potion effects of the player[the] progress of %objects%%objects%'[s] progressRepresents the progress of something.
set progress of event-bossbar to 75%[the] (projectile|arrow) critical (state|ability|mode) of %entities%%entities%'[s] (projectile|arrow) critical (state|ability|mode)A projectile's critical state. The only currently accepted projectiles are arrows and tridents.
on shoot:
event-projectile is an arrow
set projectile critical mode of event-projectile to true[the] projectile forceReturns the force at which a projectile was shot within an entity shoot bow event.
on entity shoot projectile:
set the velocity of shooter to vector(0,1,0) * projectile force[the] [server] [(sent|required|fake)] protocol version [number]The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg.
If this protocol version doesn't match with the protocol version of the client, the client will see the version string.
But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9),
the version string will not be "Paper 1.9", it will still be "Paper 1.12.2".
But then you can customize the version string as you wish.
Also if the protocol version of the player is higher than protocol version of the server, it will say
"Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.
This can be set in a server list ping event only
(increase and decrease effects cannot be used because that wouldn't make sense).
on server list ping:
set the version string to "<light green>Version: <orange>%minecraft version%"
set the protocol version to 0 # 13w41a (1.7) - so the player will see the custom version string almost always[a] [new] queue [(of|with) %objects%]Requires the 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.
set {queue} to a new queue
add "hello" and "there" to {queue}
broadcast the first element of {queue} # hello
broadcast the first element of {queue} # there
# queue is now emptyset {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'[the] (start|end) of %queue%%queue%'[s] (start|end)Requires the 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.
set {queue} to a new queue
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[the] (quit|leave|log[ ]out)( |-)messageThe message sent to all online players when a player quits the server.
on quit:
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!"[the] (quit|disconnect) (cause|reason)The quit reason as to why a player disconnected in a quit event.
on quit:
quit reason was kicked
player is banned
clear {server::player::%uuid of player%::*}[a] random <.+> [out] (of|from) %objects%Gets a random item out of a set, e.g. a random player out of all players online.
give a diamond to a random player out of all playersgive a random item out of all items to the player[a|%integer%] random [alphanumeric] character[s] (from|between) %text% (to|and) %text%One or more random characters between two given characters. Use 'alphanumeric' if you want only alphanumeric characters.
This expression uses the Unicode numerical code of a character to determine which characters are between the two given characters.
If strings of more than one character are given, only the first character of each is used.
set {_captcha} to join (5 random characters between "a" and "z") with ""send 3 random alphanumeric characters between "0" and "z"[a] random (integer|number)[s] (from|between) %number% (to|and) %number%%integer% random (integer|number)[s] (from|between) %number% (to|and) %number%A given amount of random numbers or integers between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers.
Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.
set the player's health to a random number between 5 and 10send "You rolled a %random integer from 1 to 6%!" to the playerset {_chances::*} to 5 random integers between 5 and 96set {_decimals::*} to 3 random numbers between 2.7 and -1.5[a] random uuidReturns a random UUID.
set {_uuid} to random uuid(raw|minecraft|vanilla) name[s] of %item types%The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.
raw name of tool of playerraw %texts%Returns the string without formatting (colors, decorations, etc.) and without stripping them from it.
For example, raw "&aHello There!" would output &aHello There!
send raw "&aThis text is unformatted!" to all players[the] (readied|selected|drawn) (arrow|bow)The bow or arrow in a Ready Arrow event.
on player ready arrow:
selected bow's name is "Spectral Bow"
if selected arrow is not a spectral arrow:
cancel eventrecursive %objects%Returns all values of an expression, including those in nested structures such as lists of lists.
on load:
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"[the] recursive (amount|number|size) of %objects%The recursive size of list.
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!
if recursive size of {player-data::*} > 1000:[the] redstone power of %blocks%%blocks%'[s] redstone powerPower of a redstone block
if redstone power of targeted block is 15:
send "This block is very powerful!"%objects% (reduced|folded) (to|with|by) [<.+>]%objects% (reduced|folded) (to|with|by) (<.+>)Reduces lists to single values by repeatedly applying an operation.
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.
set {_sum} to {_numbers::*} reduced with [reduced value + input]set {_product} to {_values::*} reduced with [reduced value * input]set {_concatenated} to {_strings::*} reduced with ["%reduced value%%input%"][the] reduced value[the] (accumulator|accumulated) [value][the] folded valueReturns the current accumulated/reduced value within a reduce expression.
This represents the result of all previous reduction operations.
Can only be used inside the reduce expression's operation block.
set {_sum} to {_numbers::*} reduced with [reduced value + input]set {_max} to {_values::*} reduced with [reduced value if reduced value > input else input]set {_combined} to {_items::*} reduced with ("%reduced value%, %input%")[the] remaining air of %living entities%%living entities%'[s] remaining airHow much time a player has left underwater before starting to drown.
if the player's remaining air is less than 3 seconds:
send "hurry, get to the surface!" to the player%texts% repeated %integer% time[s]Repeats inputted strings a given amount of times.
broadcast nl and nl repeated 200 times
broadcast "Hello World " repeated 5 times
if "aa" repeated 2 times is "aaaa":
broadcast "Ahhhh" repeated 100 times%text components% resolved for %command sender% [(bypassing|ignoring) required permissions]Resolves a component with the context of a command sender or other entity.
Certain kinds of components, such as NBT components, Score components, and Selector components, are required to be resolved to display a proper output.
Note that the option to bypass required permissions only applies for players.
send formatted "Hello <selector:@e[limit=5]>, I'm <selector:@s>!" resolved for player[the] resonat(e|ing) time of %block%%block%'[s] resonat(e|ing) timeReturns the resonating time of a bell.
A bell will start resonating five game ticks after being rung, and will continue to resonate for 40 game ticks.
broadcast "The bell has been resonating for %resonating time of target block%"[the] [max[imum]] charge[s] of %blocks%%blocks%'[s] [max[imum]] charge[s]The charges of a respawn anchor.
set the charges of event-block to 3[the] respawn locationThe location that a player should respawn at. This is used within the respawn event.
on respawn:
set respawn location to {example::spawn}[the] respawn[ing] reasonThe respawn reason in a respawn event.
on respawn:
if respawn reason is end portal:
broadcast "%player% took the end portal to the overworld!"[the] result[s] of [running|executing] %function% [with arg[ument]s %objects%]Runs something (like a function) and returns its result.
If the thing is expected to return multiple values, use 'results' instead of 'result'.
set {_function} to the function named "myFunction"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 truereversed %objects%Reverses given list.
set {_list::*} to reversed {_list::*}[the] ring[ing] time of %block%%block%'[s] ring[ing] timeReturns the ringing time of a bell.
A bell typically rings for 50 game ticks.
broadcast "The bell has been ringing for %ringing time of target block%"%vectors/quaternions% rotated around [the] [local] (x|y|z)(-| )axis by %number% [degrees]%quaternions% rotated by x %number%, y %number%(, [and]| and) z %number%Rotates a quaternion or vector around an axis a set amount of degrees, or around all 3 axes at once.
Vectors can only be rotated around the global X/Y/Z axes, or an arbitrary vector axis.
Quaternions are more flexible, allowing rotation around the global or local X/Y/Z axes, arbitrary vectors, or all 3 local axes at once.
Global axes are the ones in the Minecraft world. Local axes are relative to how the quaternion is already oriented.
Note that rotating a quaternion around a vector results in a rotation around the local vector, so results may not be what you expect. For example, rotating around vector(1, 0, 0) is the same as rotating around the local X axis.
The same applies to rotations by all three axes at once. In addition, rotating around all three axes of a quaternion/display at once will rotate in ZYX order, meaning the Z rotation will be applied first and the X rotation last.
set {_new} to {_quaternion} rotated around x axis by 10 degreesset {_new} to {_vector} rotated around vector(1, 1, 1) by 45set {_new} to {_quaternion} rotated by x 45, y 90, z 135[the] rotation (angle|axis) of %quaternions%%quaternions%'[s] rotation (angle|axis)Returns the axis or angle that a quaternion will rotate by/around.
All quaternions can be represented by a rotation of some amount around some axis, so this expression provides the ability to get that angle/axis.
set {_quaternion} to axisAngle(45, vector(1, 2, 3))send rotation axis of {_quaternion} # 1, 2, 3send rotation angle of {_quaternion} # 45set rotation angle of {_quaternion} to 135set rotation axis of {_quaternion} to vector(0, 1, 0)[a|the] (round[ed] down|floored) %numbers%%numbers% (round[ed] down|floored)[a|the] round[ed] %numbers%%numbers% round[ed][a|the] (round[ed] up|ceil[ing]ed) %numbers%%numbers% (round[ed] up|ceil[ing]ed)Rounds numbers normally, up (ceiling) or down (floor) respectively.
set {var} to rounded health of playerset line 1 of the block to "%rounded (1.5 * player's level)%"add rounded down argument to the player's health[the] saturation of %players%%players%'[s] saturationThe saturation of a player. If used in a player event, it can be omitted and will default to event-player.
set saturation of player to 20[the] scale[s] of %objects%%objects%'[s] scale[s]Represents the physical size/scale of something.
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.
set the scale of {_display} to vector(0,2,0)set the scale of {_particle} to 1.5[(all [[of] the]|the)] scoreboard tags of %entities%%entities%'[s] scoreboard tagsScoreboard tags are simple list of texts stored directly in the data of an entity.
So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info.
This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.
Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).
on spawn of a monster:
if the spawn reason is mob spawner:
add "spawned by a spawner" to the scoreboard tags of event-entity
on death of a monster:
if the attacker is a player:
if the victim doesn't have the scoreboard tag "spawned by a spawner":
add 1$ to attacker's balance[the] [current] scriptThe current script, or a script from its (file) name.
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.
on script load:
broadcast "Loaded %the current script%"on script load:
set {running::%script%} to trueon script unload:
set {running::%script%} to falseset {script} to the script named "weather.sk"loop the scripts in directory "quests/":
enable loop-value[the] script[s] [named] %texts%[the] scripts in [directory|folder] %text%The current script, or a script from its (file) name.
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.
on script load:
broadcast "Loaded %the current script%"on script load:
set {running::%script%} to trueon script unload:
set {running::%script%} to falseset {script} to the script named "weather.sk"loop the scripts in directory "quests/":
enable loop-value[the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])[the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]][the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]][the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]Only usable in script commands.
Represents the cooldown time, the cooldown bypass permission, the remaining cooldown time, the elapsed cooldown time.
command /home:
cooldown: 10 seconds
cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
trigger:
teleport player to {home::%player%}[the] [command] [suggestion|tab completion] (full|complete) input[the] [command] [suggestion|tab completion] (current|arg[ument]) input[the] [command] [suggestion|tab completion] (current|arg[ument]) input [start[ing]] (position|index)Usable in a script command's "suggestions" entry.
This provides information including the full content of what the player has typed so far, what they have typed as part of the current argument, and at what position within the full content the current argument starts (starting from 1).
command /message <player> <text>:
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[the] [command] (suggestions|tab completions) (of|for) %objects%%objects%'[s] [command] (suggestions|tab completions)Usable in a script command's "suggestions" entry.
Allows modifying the suggestions displayed while a command is being typed.
command /menu <text> <text>:
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}%}[the] sea level of %worlds%%worlds%'[s] sea levelGets the sea level of a world.
send "The sea level in your world is %sea level in player's world%"[the] [(min|max)[imum]] [sea] pickle(s| (count|amount)) of %blocks%%blocks%'[s] [(min|max)[imum]] [sea] pickle(s| (count|amount))An expression to obtain or modify data relating to the pickles of a sea pickle block.
on block break:
type of block is sea pickle
send "Wow! This stack of sea pickles contained %event-block's sea pickle count% pickles!"
send "It could've contained a maximum of %event-block's maximum sea pickle count% pickles!"
send "It had to have contained at least %event-block's minimum sea pickle count% pickles!"
cancel event
set event-block's sea pickle count to event-block's maximum sea pickle count
send "This bad boy is going to hold so many pickles now!!"[the] loot[[ ]table] seed[s] of %entities/blocks%%entities/blocks%'[s] loot[[ ]table] seed[s]Returns the seed of a loot table. Setting the seed of a block or entity that does not have a loot table will not do anything.
set {_seed} loot table seed of blockset loot table seed of entity to 123456789[the] [sent] [server] command[s] listThe commands that will be sent to the player in a send commands to player event.
Modifications will affect what commands show up for the player to tab complete. They will not affect what commands the player can actually run.
Adding new commands to the list is illegal behavior and will be ignored.
on send command list:
set command list to command list where [input does not contain ":"]
remove "help" from command list[the] [((default)|(shown|sent))] [server] iconIcon of the server in the server list. Can be set to an icon that loaded using the
load server icon effect,
or can be reset to the default icon in a server list ping.
'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.
on script load:
set {server-icons::default} to the default server icon(all [[of] the]|every) <.+>Returns a list of all the values of a type. Useful for looping.
loop all attribute types:
set loop-value attribute of player to 10
message "Set attribute %loop-value% to 10!"[all [[of] the]|the] (items|item[ ]stacks)every item[[ ]stack]Returns a list of all the values of a type. Useful for looping.
loop all attribute types:
set loop-value attribute of player to 10
message "Set attribute %loop-value% to 10!"[all [[of] the]|the|every] item[ ]typesReturns a list of all the values of a type. Useful for looping.
loop all attribute types:
set loop-value attribute of player to 10
message "Set attribute %loop-value% to 10!"(all [[of] the]|every) keyed boss[ ]barsReturns a list of all the values of a type. Useful for looping.
loop all attribute types:
set loop-value attribute of player to 10
message "Set attribute %loop-value% to 10!"[the] shooter [of %entities%]The shooter of a projectile.
shooter is a skeletonshuffled %objects%Shuffles given list randomly.
set {_list::*} to shuffled {_list::*}line %integer% [of [the] (front|back) [side]] [of %block%][the] (1st|first|2nd|second|3rd|third|4th|fourth) line [of [the] (front|back) [side]] [of %block%][all [[of] the]|the] lines [of [the] (front|back) [side]] [of %block%]A line of text on a sign. Can be changed, but note that there is a 16 character limit per line. If a sign side is not specified, the front side will be used by default, unless in a sign change event and a block is not explicitly specified.
on right click:
clicked block is tagged as "minecraft:all_signs"
if line 2 of the clicked block is "[Heal]":
heal the playeron sign change:
any of the lines contain "bad word"
cancel the event
send "<red>You may not write profanity on signs!" to the player[the] simulation distance[s] of %worlds/players%%worlds/players%'[s] simulation distance[s]The simulation distance of a world or a player.
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.
set simulation distance of player to 10add 50 to the simulation distance of world "world"reset the simulation distance of playerclear the simulation distance of world "world"[the] world[ ]border (size|diameter|radius) [of %world borders%]%world borders%'[s] world[ ]border (size|diameter|radius)The size of a world border.
The size can not be smaller than 1.
set world border radius of {_worldborder} to 10[the] (head|skull) owner of %slots/item types/items/blocks%%slots/item types/items/blocks%'[s] (head|skull) ownerThe skull owner of a player skull.
set {_owner} to the skull owner of event-blockset skull owner of {_block} to "Njol" parsed as offlineplayerset head owner of player's tool to {_player}[the] (skull|head) texture of %item types%%item types%'[s] (skull|head) textureThe skull texture of a player head. This allows you to give a skull a custom texture (e.g. instead of it being a Steve head, it's Notch's head).
The texture input is a base64 string containing the texture data to use (https://minecraft-heads.com is one site that provides easy access to base64 texture strings).
Resetting the texture of a skull will make it look like a Steve/Alex head.
set the skull texture of {_i} to "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTM4NmRmZDc0Y2JhZmJkMWRiZTQ3OWY1ZTAzNzRjMDliZjJlYjRlMzg2NjExZmM0ZmM2OTlmMDJlY2E0ZGQyYyJ9fX0="[the] [(raw|unique)] index of %slots%%slots%'[s] [(raw|unique)] indexIndex of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.
Raw index of slot is unique for the view, see Minecraft Wiki
if index of event-slot is 10:
send "You bought a pie!"if display name of player's top inventory is "Custom Menu": # 3 rows inventory
if raw index of event-slot > 27: # outside custom inventory
cancel eventsorted %objects%Sorts given list in natural order. All objects in list must be comparable; if they're not, this expression will return nothing.
set {_sorted::*} to sorted {_players::*}command /leaderboard:
trigger:
loop reversed sorted {most-kills::*}:
send "%loop-counter%. %loop-index% with %loop-value% kills" to sender[the] source blockThe source block in a spread event.
on spread:
if the source block is a grass block:
set the source block to dirt[the] spawn[s] [(point|location)[s]] [of %worlds%]%worlds%'[s] spawn[s] [(point|location)[s]]The spawn point of a world.
teleport all players to spawnset the spawn point of "world" to the player's location[the] spawn egg entity of %items/item types/slots%%items/item types/slots%'[s] spawn egg entityGets or sets the entity snapshot that the provided spawn eggs will spawn when used.
set {_item} to a zombie spawn eggbroadcast 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[the] spawn[ing] reasonThe spawn reason in a spawn event.
on spawn:
spawn reason is reinforcements or breeding
cancel event[the] (spawner|entity|creature) type[s] of %blocks%%blocks%'[s] (spawner|entity|creature) type[s]The entity type of a spawner (mob spawner).
Change the entity type, reset it (pig) or clear it (Minecraft 1.20.0+).
on right click:
if event-block is a spawner:
send "Spawner's type if %spawner type of event-block%" to playerset the creature type of {_spawner} to a trader llamareset {_spawner}'s entity type # Pigclear the spawner type of {_spawner} # Minecraft 1.20.0+spectator target [of %players%]%players%'[s] spectator targetGrabs the spectator target entity of the players.
on player start spectating of player:
message "&c%spectator target% currently has %{game::kills::%spectator target%}% kills!" to the playeron player stop spectating:
past spectator target was a zombie
set spectator target to the nearest skeleton[the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%%players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speedA player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions.
Please note that changing a player's speed will change their FOV just like potions do.
set the player's walk speed to 1increase the argument's fly speed by 0.1[the] stored enchant[ment]s of %item types%%item types%'[s] stored enchant[ment]sThe enchantments stored inside an enchanted book. This is different from enchanting the book, as for example a book
of sharpness does not deal more damage when used as a weapon. Corresponds to the 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.
command /godbook:
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[all [[of] the]|the] string colo[u]r[s] [code[s]] of %texts%[the] (first|last) string colo[u]r[s] [code[s]] of %texts%Retrieve the first, the last, or all of the color objects or color codes of a string.
The retrieved color codes of the string will be formatted with the color symbol.
set {_colors::*} to the string colors of "<red>hey<blue>yo"set {_color} to the first string color code of "&aGoodbye!"
send "%{_color}%Howdy!" to all players[the] style[s] of %objects%%objects%'[s] style[s]Represents the style of something.
set style of event-bossbar to 6 notches[the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%[the] (first|last) [%number%] character[s] of %texts%[the] %number% (first|last) characters of %texts%[the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).
set {_s} to the first 5 characters of the text argumentmessage "%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 consoleset {_characters::*} to characters at 1, 2 and 7 in player's display namesend the last character of all players' names[the] (tablist[ed]|listed) players [of %players%]%players%'[s] (tablist[ed]|listed) playersThe players shown in the tab lists of the specified players.
`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.
tablist players of player[the] [minecraft|datapack|paper|(custom|skript)] [item|block|entity [type]] tag[s] %texts%Represents a tag which can be used to classify items, blocks, or entities.
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".
minecraft tag "dirt" # minecraft:dirtpaper tag "doors" # paper:doorstag "skript:custom_dirt" # skript:custom_dirtcustom tag "dirt" # skript:dirtdatapack block tag "dirt" # minecraft:dirtdatapack tag "my_pack:custom_dirt" # my_pack:custom_dirttag "minecraft:mineable/pickaxe" # minecraft:mineable/pickaxecustom item tag "blood_magic_sk/can_sacrifice_with" # skript:blood_magic_sk/can_sacrifice_with[the] [namespace[d]] key[s] of %minecraft tags%%minecraft tags%'[s] [namespace[d]] key[s]The namespaced key of a minecraft tag. This takes the form of "namespace:key", e.g. "minecraft:dirt".
broadcast namespaced keys of the tags of player's toolif the key of {_my-tag} is "minecraft:stone":
return true[the] tag (contents|values) of %minecraft tag%%minecraft tag%'[s] tag (contents|values)Returns all the values that a tag contains.
For item and block tags, this will return items. For entity tags, it will return entity datas (a creeper, a zombie).
broadcast tag values of minecraft tag "dirt"broadcast (first element of player's tool's block tags)'s tag contents[all [[of] the]|the] [minecraft|datapack|paper|(custom|skript)] [item|block|entity [type]] tags of %item types/blocks/block datas/entities/entity types%%item types/blocks/block datas/entities/entity types%'[s] [minecraft|datapack|paper|(custom|skript)] [item|block|entity [type]] tagsReturns all the tags of an item, block, or entity.
`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".
broadcast minecraft tags of dirtsend true if paper item tags of target block contains paper tag "doors"broadcast the block tags of player's tool[the] tamerThe tamer of an entity. Can only be used in entity tame events. You can use 'event-entity' to refer tamed entity itself.
on tame:
if the tamer is a player:
send "someone tamed something!" to console[the] target[[ed] %entity type%] [of %living entities%] [ignoring blocks] [[with|at] [a] ray[ ]size [of] %number%]%living entities%'[s] target[[ed] %entity type%] [ignoring blocks] [[with|at] [a] ray[ ]size [of] %number%]For players this is the entity at the crosshair.
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.
on entity target:
if entity's target is a player:
send "You're being followed by an %entity%!" to target of entityreset target of entity # Makes the entity target-lessdelete targeted entity of player # for players it will delete the targetdelete target of last spawned zombie # for entities it will make them target-less[the] [(actual[ly]|exact)] target[ed] block[s] [of %living entities%]%living entities%'[s] [(actual[ly]|exact)] target[ed] block[s]The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression.
The actual target block will regard the actual hit box of the block.
set target block of player to stoneset target block of player to oak_stairs[waterlogged=true]break target block of player using player's toolgive player 1 of type of target blockteleport player to location above target blockkill all entities in radius 3 around target block of playerset {_block} to actual target block of playerbreak actual target block of player[the] teleport (cause|reason|type)The teleport cause within a player teleport event.
on teleport:
teleport cause is nether portal, end portal or end gateway
cancel event[the] temperature[s] of %blocks%%blocks%'[s] temperature[s]Temperature at given block.
message "%temperature of the targeted block%"%objects% if <.+>[,] (otherwise|else) %objects%A shorthand expression for returning something based on a condition.
set {points} to 500 if {admin::%player's uuid%} is set else 100[the] text alignment[s] [of %entities%]%entities%'[s] text alignment[s]Returns or changes the alignment setting of text displays.
set text alignment of the last spawned text display to left aligned[the] line width[s] [of %entities%]%entities%'[s] line width[s]Returns or changes the line width of text displays. Default is 200.
set the line width of the last spawned text display to 300[the] [text] opacit(y|ies) [of %entities%]%entities%'[s] [text] opacit(y|ies)Returns or changes the text opacity of text displays. The default is 255, fully opaque.
Values are between 0 and 255. 0 to 3 are treated the same as 255, meaning fully opaque.
Values from 4 to 26 are fully transparent, and opacity increases linearly from there up to 255.
For backwards compatability, setting negative values between -1 and -128 wrap around, so -1 is the same as 255 and -128 is the same as 128.
Adding or subtracting values will adjust the opacity within the bounds of 0-255, so subtracting 300 wil always result in an opacity of 0.
set the text opacity of the last spawned text display to 0 # fully opaqueset text opacity of all text displays to 255 # fully opaqueset text opacity of all text displays to 128 # semi-transparentset text opacity of all text displays to 4 # fully transparent[the] text[s] [of %entities%]%entities%'[s] text[s]Returns or changes the text/string of displays.
Note that currently you can only use Skript chat codes when running Paper.
set text of the last spawned text display to "example"%texts% where [([the] first instance[s]|all instances) of] %texts% (is|are) replaced with %text% [using regex|with case sensitivity]%texts% where [([the] first instance[s]|all instances) of] regex [pattern[s]] %texts% (is|are) replaced with %text%Performs a text replacement on a given value, returning the result. Supports regex and case sensitive replacement.
send "Welcome [player]" where "[player]" is replaced with "%player%" to player# 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[the] [thrown] eggThe egg thrown in a Player Egg Throw event.
spawn an egg at the egg[the] time[s] [([with]in|of) %worlds%]%worlds%'[s] time[s]The time of a world.
Use the "minecraft timespan" syntax to change the time according to Minecraft's time intervals.
Since Minecraft uses discrete intervals for time (ticks), changing the time by real-world minutes or real-world seconds only changes it approximately.
Removing an amount of time from a world's time will move the clock forward a day.
set time of world "world" to 2:00add 2 minecraft hours to time of world "world"add 54 real seconds to time of world "world" # approximately 1 minecraft hour[the] time (alive|lived) of %entities%%entities%'[s] time (alive|lived)Returns the total amount of time the entity has lived.
Note: This does not reset when a player dies.
clear all entities where [input's time lived > 1 hour]on right click on entity:
send "%entity% has lived for %time lived of entity%" to player[the] time played of %offline players%%offline players%'[s] time playedThe amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu.
Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.
set {_t} to time played of playerif player's time played is greater than 10 minutes:
give player a diamond swordset player's time played to 0 seconds[the] time (since|until) %dates%[the] (elapsed time|time until) (since|until) %dates%The time since a date has passed or the time until a date will pass.
This expression will return 0 seconds if the time since or time until would be negative, e.g. if one tries to get the time since a future date.
send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to playersend "%time until {countdown::end}% until the game begins!" to player[the] (ticks|seconds|minutes|hours|days|weeks|months|years) of %time spans%Retrieve specific information of a timespan such as hours/minutes/etc.
set {_t} to difference between now and {Payouts::players::%uuid of player%::last-date}send "It has been %days of {_t}% day(s) since last payout."[the] title[s] of %objects%%objects%'[s] title[s]Represents the title of something.
set title of event-bossbar to "<red>hello!"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[the] (tool|held item|weapon) [of %living entities%]%living entities%'[s] (tool|held item|weapon)[the] off[ ]hand (tool|item) [of %living entities%]%living entities%'[s] off[ ]hand (tool|item)The item an entity is holding in their main or off hand.
player's tool is tagged with minecraft tag "pickaxes"player's off hand tool is a shieldset tool of all players to a diamond swordset offhand tool of target entity to a bow[the] [total] experience of %entities%%entities%'[s] [total] experienceThe total experience, in points, of players or experience orbs.
Adding to a player's experience will trigger Mending, but setting their experience will not.
set total experience of player to 100add 100 to player's experienceif player's total experience is greater than 100:
set player's total experience to 0
give player 1 diamondtps from [the] last ([1] minute|1[ ]m[inute])tps from [the] last 5[ ]m[inutes]tps from [the] last 15[ ]m[inutes][the] tpsReturns the 3 most recent TPS readings, like the /tps command. This expression is only supported on some server software (PaperSpigot).
broadcast "%tps%"[the] transform[ing] (cause|reason|type)The transform reason within an entity entity transform event.
on entity transform:
transform reason is infection, drowned or frozen%objects% (transformed|mapped) (using|with) [<.+>]%objects% (transformed|mapped) (using|with) (<.+>)Transforms (or 'maps') a list's values using a given expression. This is akin to looping over the list and getting a modified version of each value.
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.
set {_a::*} to (1, 2, and 3) transformed using (input * 2 - 1, input * 2)
# {_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[the] type of %entity types/item types/potion effects/block datas/entities/blocks%%entity types/item types/potion effects/block datas/entities/blocks%'[s] typeType of a block, item, entity, inventory, potion effect or enchantment type.
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.
on rightclick on an entity:
message "This is a %type of clicked entity%!"[the] <.+>( |-)arg[ument][( |-)<\d+>][the] arg[ument]( |-)<.+>[( |-)<\d+>]No matching entry in Skript's documentation.
[the] unix date of %numbers%%numbers%'[s] unix dateConverts given Unix timestamp to a date. The Unix timespan represents the number of seconds elapsed since 1 January 1970.
unix date of 946684800 #1 January 2000 12:00 AM (UTC Time)[the] unix timestamp of %dates%%dates%'[s] unix timestampConverts given date to Unix timestamp. This is roughly how many seconds have elapsed since 1 January 1970.
unix timestamp of now[the] (unknown|non-existent) command messageThe message sent to a player when executing an unknown command.
on unknown command execution:
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!"[the] unleash[ing] reasonThe unleash reason in an unleash event.
if the unleash reason is distance:
broadcast "The leash was snapped in half."[the] uuid[s] of %offline players/worlds/entities%%offline players/worlds/entities%'[s] uuid[s]The UUID of a player, entity or world.
# prevents people from joining the server if they use the name of a player
# who has played on this server at least once since this script has been added
on login:
if {uuid::%name of player%} exists:
{uuid::%name of player%} is not uuid of player
kick player due to "Someone with your name has played on this server before"
else:
set {uuid::%name of player%} to uuid of playercommand /what-is-my-uuid:
trigger:
set {_uuid} to uuid of player
send "Your UUID is '%string within {_uuid}%'"[the] [<.+>] value of %nodes%%nodes%'[s] [<.+>] valueReturns the value of something that has a value, e.g. a node in a config.
The value is automatically converted to the specified type (e.g. text, number) where possible.
set {_node} to node "update check interval" in the skript config
broadcast text value of {_node}
# text value of {_node} = "12 hours" (text)
wait for {_node}'s timespan value
# timespan value of {_node} = 12 hours (duration)[the] <.+> value [at] %text% (from|in) %node/script%Returns the value of an sub-node of the given node, following the provided path.
The value is automatically converted to the specified type (e.g. text, number) where possible.
set {_node} to node "language" in the skript config
broadcast the text value of {_node}%vectors% rotated around %vector% by %number% [degrees]No matching entry in Skript's documentation.
[the] angle between [[the] vectors] %vector% and %vector%Gets the angle between two vectors.
send "%the angle between vector 1, 0, 0 and vector 0, 1, 1%"vector[s] [from] %directions%%directions% vector[s]Creates vectors from given directions.
Relative directions are relative to the origin, (0, 0, 0). Therefore, the vector from the direction 'forwards' is (0, 0, 1).
set {_v} to vector from direction upwardsset {_v} to vector in direction of playerset {_v} to vector in horizontal direction of playerset {_v} to vector from facing of playerset {_v::*} to vectors from north, south, east, and west[a] [new] vector [(from|at|to)] %number%,[ ]%number%(,[ ]| and )%number%Creates a vector from x, y and z values.
set {_v} to vector 0, 1, 0%vector% to location in %world%location (from|of) %vector% in %world%%vector% [to location] in %world% with yaw %number% and pitch %number%location (from|of) %vector% in %world% with yaw %number% and pitch %number%Creates a location from a vector in a world.
set {_loc} to {_v} to location in world "world"set {_loc} to {_v} to location in world "world" with yaw 45 and pitch 90set {_loc} to location of {_v} in "world" with yaw 45 and pitch 90%vector% cross %vector%Gets the cross product between two vectors.
send "%vector 1, 0, 0 cross vector 0, 1, 0%"[a] [new] cylindrical vector [(from|with)] [radius] %number%, [yaw] %number%(,|[,] and) [height] %number%Forms a 'cylindrical shaped' vector using yaw to manipulate the current point.
loop 360 times:
set {_v} to cylindrical vector radius 1, yaw loop-value, height 2set {_v} to cylindrical vector radius 1, yaw 90, height 2%vector% dot %vector%Gets the dot product between two vectors.
set {_dot} to {_v1} dot {_v2}[the] (vector|standard|normal) length[s] of %vectors%%vectors%'[s] (vector|standard|normal) length[s]Gets or sets the length of a vector.
send "%standard length of vector 1, 2, 3%"set {_v} to vector 1, 2, 3set standard length of {_v} to 2send "%standard length of {_v}%"%location% offset by [[the] vectors] %vectors% [using local axes]%location%[ ]~[~][ ]%vectors%Returns the location offset by vectors. Supports both global and local axes. When using local axes, the vector is applied relative to the direction the location is facing.
set {_loc} to {_loc} ~ {_v}# 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}normali(z|s)e[d] %vectors%%vectors% normali(z|s)edReturns the same vector but with length 1.
set {_v} to normalized {_v}set {_v} to normalised {_u}[a] random vectorCreates a random unit vector.
set {_v} to a random vector[a] [new] spherical vector [(from|with)] [radius] %number%, [yaw] %number%(,|[,] and) [pitch] %number%Forms a 'spherical shaped' vector using yaw and pitch to manipulate the current point.
loop 360 times:
set {_v} to spherical vector radius 1, yaw loop-value, pitch loop-valueset {_v} to spherical vector radius 1, yaw 45, pitch 90[the] squared length[s] of %vectors%%vectors%'[s] squared length[s]Gets the squared length of a vector.
send "%squared length of vector 1, 2, 3%"[the] vector (from|between) %location% (to|and) %location%Creates a vector between two locations.
set {_v} to vector between {_loc1} and {_loc2}[the] vector (of|from|to) %locations%%locations%'[s] vectorCreates a vector from a location.
set {_v} to vector of {_loc}[a] [new] vector (from|with) yaw %number% and pitch %number%Creates a vector from a yaw and pitch value.
set {_v} to vector from yaw 45 and pitch 45[vector] projection [of] %vector% on[to] %vector%An expression to get the vector projection of two vectors.
set {_projection} to vector projection of vector(1, 2, 3) onto vector(4, 4, 4)[the] vehicle[s] [of %entities%]%entities%'[s] vehicle[s]The vehicle an entity is in, if any.
This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton.
See also: passenger
set the vehicle of {game::players::*} to a saddled pig
give {game::players::*} a carrot on a stickon vehicle enter:
vehicle is a horse
add 1 to {statistics::horseMounting::%uuid of player%}[the] velocit(y|ies) of %entities/directional particle effects%%entities/directional particle effects%'[s] velocit(y|ies)Gets or changes velocity of an entity or particle.
Setting the velocity of a particle will remove its random dispersion and force it to be a single particle.
set player's velocity to {_v}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([craft]bukkit|minecraft|skript)( |-)versionThe version of Bukkit, Minecraft or Skript respectively.
message "This server is running Minecraft %minecraft version% on Bukkit %bukkit version%"message "This server is powered by Skript %skript version%"[the] [shown|custom] version [string|text]The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this.
This can only be set in a server list ping event.
on server list ping:
set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
set the version string to "<light green>Version: <orange>%minecraft version%"[the] view distance[s] of %players/worlds%%players/worlds%'[s] view distance[s]The view distance of a world or a player.
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.
set view distance of player to 10add 50 to the view distance of world "world"reset the view distance of playerclear the view distance of world "world"[the] client view distance[s] of %players%%players%'[s] client view distance[s]The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.
set {_clientView} to the client view distance of playerset view distance of player to client view distance of player[the] viewer[s] of %objects%%objects%'[s] viewer[s]Represents something that is viewing something.
add {_player} to viewers of event-bossbaron inventory open:
set {_mylist::*} to viewers of event-inventory
send "%size of {_list::*}% other players are viewing this inventory!"[the] villager (level|experience) of %living entities%%living entities%'[s] villager (level|experience)Represents the level/experience of a villager.
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
set {_level} to villager level of {_villager}set villager level of last spawned villager to 2add 1 to villager level of target entityremove 1 from villager level of event-entityreset villager level of event-entityset villager experience of last spawned entity to 100[the] villager profession[s] of %living entities%%living entities%'[s] villager profession[s]Represents the profession of a villager/zombie villager.
set {_p} to villager profession of event-entityvillager profession of event-entity = nitwit professionset villager profession of {_villager} to librarian professiondelete villager profession of event-entity[the] villager type[s] of %living entities%%living entities%'[s] villager type[s]Represents the type of a villager/zombie villager. This usually represents the biome the villager is from.
set {_type} to villager type of {_villager}villager type of {_villager} = plainsset villager type of event-entity to plains[the] anger level [of] %living entities% towards %living entities%%living entities%'[s] anger level towards %living entities%The anger level a warden feels towards an entity.
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.
set the anger level of last spawned warden towards player to 20clear the last spawned warden's anger level towards player[the] most angered entity of %living entities%%living entities%'[s] most angered entityThe entity a warden is most angry at.
A warden can be angry towards multiple entities with different anger levels.
if the most angered entity of last spawned warden is not player:
set the most angered entity of last spawned warden to player[the] world[ ]border warning distance [of %world borders%]%world borders%'[s] world[ ]border warning distanceThe warning distance of a world border. The player's screen will be tinted red when they are within this distance of the border.
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.
set world border warning distance of {_worldborder} to 1[the] world[ ]border warning time [of %world borders%]%world borders%'[s] world[ ]border warning timeThe warning time of a world border. If the border is shrinking, the player's screen will be tinted red once the border will catch the player within this time period.
set world border warning time of {_worldborder} to 1 second[the] weather [(in|of) %players/worlds%][the] (custom|client) weather [of %players%]%players/worlds%'[s] weather%players%'[s] (custom|client) weatherThe weather of a world or player.
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.
set weather to clearweather in "world" is rainyreset custom weather of playerset weather of player to clearwhether <.+>A shorthand for returning the result of a condition (true or false). This is functionally identical to using 'true if <condition> else false'.
Many conditions also support being changed through this expression, typically using 'set'.
set {fly} to whether player can flybroadcast "Flying: %whether player is flying%"set whether the player can fly to truetoggle whether the player can pick up items[the] white[ ]list[ed players]An expression for obtaining and modifying the server's whitelist.
Players may be added and removed from the whitelist.
The whitelist can be enabled or disabled by setting the whitelist to true or false respectively.
set the whitelist to falseadd all players to whitelistreset the whitelist%item types% with[out] fire[ ]resistancefire resistant %item types%Creates a copy of an item with (or without) fire resistance.
set {_x} to diamond sword with fire resistanceequip player with netherite helmet without fire resistancedrop fire resistant stone at player[the] world of %locations/entities/chunks%%locations/entities/chunks%'[s] worldThe world the event occurred in.
world is "world_nether"teleport the player to the world's spawnset the weather in the player's world to rainset {_world} to world of event-chunk[the] world[ ]border [of %worlds/players%]%worlds/players%'[s] world[ ]borderGet the border of a world or a player.
A player's world border is not persistent. Restarts, quitting, death or changing worlds will reset the border.
set {_border} to world border of player's world[the] [world] environment[s] of %worlds%%worlds%'[s] [world] environment[s]The environment of a world
if environment of player's world is nether:
apply fire resistance to player for 10 minutes[the] world [(named|with name)] %text%Returns the world from a string.
world named {game::world-name}the world "world"[the] seed[s] (from|of) %worlds%%worlds%'[s] seed[s]The seed of given world. Note that it will be returned as Minecraft internally treats seeds, not as you specified it in world configuration.
broadcast "Seed: %seed of player's world%"[(all [[of] the]|the)] worldsAll worlds of the server, useful for looping.
loop all worlds:
broadcast "You're in %loop-world%" to loop-world[the] (w|x|y|z)( |-)[component[s]|coord[inate][s]|(pos[ition[s]]|loc[ation][s])] of %objects%%objects%'[s] (w|x|y|z)( |-)[component[s]|coord[inate][s]|(pos[ition[s]]|loc[ation][s])]Gets or changes the W, X, Y or Z component of anything with these components/coordinates, like locations, vectors, or quaternions.
The W axis is only used for quaternions, currently.
set {_v} to vector(1, 2, 3)
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"set {_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%number% of %items/item types/entity types%An expression for using an item or entity type with a different amount.
give level of player of iron pickaxes to the player%number% time[s](once|twice|thrice)Integers between 1 and X, used in loops to loop X times.
loop 20 times:
broadcast "%21 - loop-number% seconds left.."
wait 1 second[the] (yaw|pitch)[s] of %entities/locations%%entities/locations%'[s] (yaw|pitch)[s]The yaw or pitch of a location or vector.
A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise.
A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards.
Only Paper 1.19+ users may directly change the yaw/pitch of players.
log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"set {_yaw} to yaw of playerset {_p} to pitch of target entityset pitch of player to -90 # Makes the player look upwards, Paper 1.19+ onlyadd 180 to yaw of target of player # Makes the target look behind themselvesNo expressions match. Search all syntax
Generated from NeoSkript 0.1.0-SNAPSHOT's registry on Paper 26.3. Descriptions and examples from Skript's documentation (Skript 2.17.0), GPL-3.0. 1172 of 1205 entries matched one of its entries by id, event name or pattern; the rest show only their patterns.