From b37bd2db9c388345839b49a247e2f1e87472daa4 Mon Sep 17 00:00:00 2001 From: Ayham Al-Ali Date: Fri, 28 Oct 2022 15:55:53 +0200 Subject: [PATCH] #4319 - e4cf2e1cda98137754594b4674cb3660c8a6ff51 --- classes.html | 2 +- conditions.html | 2 +- css/styles.css | 32 + docs.html | 2 +- docs.json | 1423 +++++++++++++++--------------------------- effects.html | 2 +- events.html | 2 +- expressions.html | 2 +- functions.html | 2 +- index.html | 4 +- js/functions.js | 353 +++++++++++ js/main.js | 367 +---------- js/theme-switcher.js | 61 +- sections.html | 2 +- text.html | 2 +- tutorials.html | 2 +- 16 files changed, 931 insertions(+), 1329 deletions(-) create mode 100644 js/functions.js diff --git a/classes.html b/classes.html index c3cca4ee54a..c4730d60fe4 100644 --- a/classes.html +++ b/classes.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Types

Attribute Type

🔗

Type

Patterns:
  • generic attack speed, luck, max health, generic movement speed, flying speed, attack damage, horse jump strength, generic attack damage, generic luck, generic armor, generic flying speed, follow range, generic knockback resistance, movement speed, generic follow range, zombie spawn reinforcements, armor, generic attack knockback, attack speed, armor toughness, knockback resistance, generic max health, attack knockback, generic armor toughness
Since: 2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info.

Examples:

Missing examples.

Biome

🔗

Type

Patterns:
  • Biome names; you can use F3 ingame
Since: 1.4.4
All possible biomes Minecraft uses to generate a world.

Examples:

biome at the player is desert

Block

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A block in a world. It has a location and a type, and can also have a direction (mostly a facing), an inventory, or other special properties.

Examples:

Missing examples.

Block Data

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
Requirements: Minecraft 1.13+
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.

Examples:

set block at player to campfire[lit=false]
set target block of player to oak stairs[facing=north;waterlogged=true]
set block at player to grass_block[snowy=true]
set loop-block to minecraft:chest[facing=north]
set block above player to oak_log[axis=y]
set target block of player to minecraft:oak_leaves[distance=2;persistent=false]

Boolean

🔗

Type

Patterns:
  • true/yes/on or false/no/off
Since: 1.0
A boolean is a value that is either true or false. Other accepted names are 'on' and 'yes' for true, and 'off' and 'no' for false.

Examples:

set {config.%player%.use mod} to false

Cat Type

🔗

Type

Patterns:
  • red, all black, british shorthair, ragdoll, white, jellie, siamese, black, tabby, calico, persian
Since: 2.4
Requirements: Minecraft 1.14 or newer
Represents the race/type of a cat entity.

Examples:

Missing examples.

Chunk

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.0
A chunk is a cuboid of 16×16×128 (x×z×y) blocks. Chunks are spread on a fixed rectangular grid in their world.

Examples:

Missing examples.

Click Type

🔗

Type

Patterns:
  • lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since: 2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.

Examples:

Missing examples.

Color

🔗

Type

Patterns:
  • black, dark grey/dark gray, grey/light grey/gray/light gray/silver, white, blue/dark blue, cyan/aqua/dark cyan/dark aqua, light blue/light cyan/light aqua, green/dark green, light green/lime/lime green, yellow/light yellow, orange/gold/dark yellow, red/dark red, pink/light red, purple/dark purple, magenta/light purple, brown/indigo
Since: Unknown
Wool, dye and chat colors.

Examples:

color of the sheep is red or black
set the color of the block to green
message "You're holding a <%color of tool%>%color of tool% wool block"

Command Sender

🔗

Type

Patterns:
Since: 1.0
A player or the console.

Examples:

command /push [<player>]:
    trigger:
        if arg-1 is not set:
            if command sender is console:
                send "You can't push yourself as a console :\" to sender
                stop
            push sender upwards with force 2
            send "Yay!"
        else:
            push arg-1 upwards with force 2
            send "Yay!" to sender and arg-1

Damage Cause

🔗

Type

Patterns:
  • sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, flying into a wall, cramming, poison, sonic boom, suffocate, custom, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since: 2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.

Examples:

Missing examples.

Date

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.4
A date is a certain point in the real world's time which can be obtained with now expression, unix date expression and date function. See time and timespan for the other time types of Skript.

Examples:

set {_yesterday} to now
subtract a day from {_yesterday}
# now {_yesterday} represents the date 24 hours before now

Difficulty

🔗

Type

Patterns:
  • normal, medium, hard, easy, peaceful
Since: 2.3
The difficulty of a world.

Examples:

Missing examples.

Direction

🔗

Type

Patterns:
Since: 2.0
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.

Examples:

set the block below the victim to a chest
loop blocks from the block infront of the player to the block 10 below the player:
    set the block behind the loop-block to water

Enchantment

🔗

Type

Patterns:
  • Frost Walker, Feather Falling, Unbreaking, Swift Sneak, Knockback, Projectile Protection, Respiration, Punch, Protection, Blast Protection, Lure, Impaling, Smite, Silk Touch, Infinity, Luck of The Sea, Thorns, Multishot, Curse of Vanishing, Fire Aspect, Flame, Depth Strider, Piercing, Fire Protection, Sharpness, Power, Sweeping Edge, Aqua Affinity, Curse of Binding, Bane of Arthropods, Soul Speed, Looting, Efficiency, Mending, Riptide, Quick Charge, Fortune, Loyalty, Channeling
Since: 1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway.

Examples:

Missing examples.

Enchantment Offer

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
The enchantmentoffer in an enchant prepare event.

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

Enchantment Type

🔗

Type

Patterns:
  • <enchantment> [<level>]
Since: 1.4.6
An enchantment with an optional level, e.g. 'sharpness 2' or 'fortune'.

Examples:

enchant the player's tool with sharpness 5
helmet is enchanted with waterbreathing

Entity

🔗

Type

Patterns:
  • player, op, wolf, tamed ocelot, powered creeper, zombie, unsaddled pig, fireball, arrow, dropped item, item frame, etc.
Since: 1.0
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.

Examples:

entity is a zombie or creeper
player is an op
projectile is an arrow
shoot a fireball from the player

Entity Type

🔗

Type

Patterns:
  • Detailed usage will be added eventually
Since: 1.3
The type of an entity, e.g. player, wolf, powered creeper, etc.

Examples:

victim is a cow
spawn a creeper

Entity Type with Amount

🔗

Type

Patterns:
Since: 1.3
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.

Examples:

spawn 5 creepers behind the player

Experience

🔗

Type

Patterns:
  • [<number>] ([e]xp|experience [point[s]])
Since: 2.0
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.

Examples:

give 10 xp to the player

Firework Effect

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.4
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Firework Type

🔗

Type

Patterns:
  • small, ball, star shaped, large, star, creeper face, small ball, large ball, burst, ball large, creeper
Since: 2.4
The type of a fireworkeffect.

Examples:

Missing examples.

Game Mode

🔗

Type

Patterns:
  • creative/survival/adventure/spectator
Since: 1.0
The game modes survival, creative, adventure and spectator.

Examples:

player's gamemode is survival
set the player argument's game mode to creative

Gamerule

🔗

Type

Patterns:
  • doWardenSpawning, doFireTick, maxCommandChainLength, fireDamage, reducedDebugInfo, disableElytraMovementCheck, announceAdvancements, drowningDamage, commandBlockOutput, forgiveDeadPlayers, doMobSpawning, maxEntityCramming, disableRaids, doWeatherCycle, doDaylightCycle, showDeathMessages, doTileDrops, universalAnger, playersSleepingPercentage, doInsomnia, doImmediateRespawn, naturalRegeneration, doMobLoot, fallDamage, keepInventory, doEntityDrops, doLimitedCrafting, mobGriefing, randomTickSpeed, spawnRadius, freezeDamage, doTraderSpawning, logAdminCommands, spectatorsGenerateChunks, sendCommandFeedback, doPatrolSpawning
Since: 2.5
Requirements: Minecraft 1.13 or newer
A gamerule

Examples:

Missing examples.

Gamerule Value

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
A wrapper for the value of a gamerule for a world.

Examples:

Missing examples.

Gene

🔗

Type

Patterns:
  • normal, lazy, happy, worried, worrisome, aggressive, brown, brownish, savage, playful, wild, weak
Since: 2.4
Requirements: Minecraft 1.14 or newer
Represents a Panda's main or hidden gene. See genetics for more info.

Examples:

Missing examples.

Heal Reason

🔗

Type

Patterns:
  • an ender crystal, magic, a magic regeneration, magic regeneration, fed, sated, a magic regen, regen potion, a wither spawn, peaceful, unknown, a regeneration potion, consuming, a wither effect, peaceful regeneration, wither summoning, healing potion, wither potion, an end crystal, satiated, regeneration potion, potion, satisfied, ingesting, withered, custom, a wither spawning, end crystal, eating, wither spawning, a wither summoning, wither effect, a plugin, a regen potion, plugin, withering, a potion, wither spawn, a healing potion, ender crystal, magic regen, wither, peaceful regen
Since: 2.5
The heal reason in a heal event.

Examples:

Missing examples.

Inventory

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).

Examples:

Missing examples.

Inventory Action

🔗

Type

Patterns:
  • drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since: 2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.

Examples:

Missing examples.

Inventory Slot

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.

Examples:

set tool of player to dirt
delete helmet of the victim
set the color of the player's tool to green
enchant the player's chestplate with projectile protection 5

Inventory Type

🔗

Type

Patterns:
  • blast furnace inventory, barrel inventory, workbench inventory, smoker inventory, composter inventory, ender chest inventory, dispenser inventory, player inventory, loom inventory, stonecutter inventory, hopper inventory, merchant inventory, cartography table inventory, anvil inventory, beacon inventory, shulker box inventory, lectern inventory, chest inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, grindstone inventory, creative inventory, crafting table inventory, furnace inventory
Since: 2.2-dev32
Minecraft has several different inventory types with their own use cases.

Examples:

Missing examples.

Item / Material

🔗

Type

Patterns:
  • [<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since: 1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.

Examples:

set {_item} to type of the targeted block
{_item} is a torch

Item Type

🔗

Type

Patterns:
  • [<number> [of]] [all/every] <alias> [of <enchantment> [<level>] [,/and <more enchantments...>]]
Since: 1.0
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.

Examples:

give 4 torches to the player
add all slabs to the inventory of the block
player's tool is a diamond sword of sharpness
remove a pickaxes of fortune 4 from {stored items::*}
set {_item} to 10 of every upside-down stair
block is dirt or farmland

Living Entity

🔗

Type

Patterns:
  • see entity, but ignore inanimate objects
Since: 1.0
A living entity, i.e. a mob or player, not inanimate entities like projectiles or dropped items.

Examples:

spawn 5 powered creepers
shoot a zombie from the creeper

Location

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.

Examples:

Missing examples.

Metadata Holder

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.2-dev36
Something that can hold metadata (e.g. an entity or block)

Examples:

set metadata value "super cool" of player to true

Money

🔗

Type

Patterns:
  • <number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since: 2.0
Requirements: Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.

Examples:

add 10£ to the player's account
remove Fr. 9.95 from the player's money
set the victim's money to 0
increase the attacker's balance by the level of the victim * 100

Number

🔗

Type

Patterns:
  • [-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since: 1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.

Examples:

set the player's health to 5.5
set {_temp} to 2*{_temp} - 2.5

Object

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
The supertype of all types, meaning that if %object% is used in e.g. a condition it will accept all kinds of expressions.

Examples:

Missing examples.

Offline Player

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.

Examples:

Missing examples.

Player

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.

Examples:

Missing examples.

Potion Effect

🔗

Type

Patterns:
  • speed of tier 1 for 10 seconds
Since: 2.5.2
A potion effect, including the potion effect type, tier and duration.

Examples:

Missing examples.

Potion Effect Type

🔗

Type

Patterns:
  • null, speed, slowness, haste, mining fatigue, strength, instant health, instant damage, jump boost, nausea, regeneration, resistance, fire resistance, water breathing, invisibility, blindness, night vision, hunger, weakness, poison, wither, health boost, absorption, saturation, glowing, levitation, luck, bad luck, slow falling, conduit power, dolphins grace, bad omen, hero of the village, darkness
Since: Unknown
A potion effect type, e.g. 'strength' or 'swiftness'.

Examples:

apply swiftness 5 to the player
apply potion of speed 2 to the player for 60 seconds
remove invisibility from the victim

Projectile

🔗

Type

Patterns:
  • arrow, fireball, snowball, thrown potion, etc.
Since: 1.0
A projectile, e.g. an arrow, snowball or thrown potion.

Examples:

projectile is a snowball
shoot an arrow at speed 5 from the player

Region

🔗

Type

Patterns:
  • "region name"
Since: 2.1
Requirements: Supported regions plugin
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.

Examples:

Missing examples.

Resource Pack State

🔗

Type

Patterns:
  • refused, rejected, accepted, failed, failed to download, successfully loaded, accept, fail, successfully load, refuse, declined, successfully install, success, reject, decline, successfully installed, download fail
Since: 2.4
The state in a resource pack request response event.

Examples:

Missing examples.

Server Icon

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.3
A server icon that was loaded using the load server icon effect.

Examples:

Missing examples.

Sound Category

🔗

Type

Patterns:
  • hostile creatures category, speech category, records category, friendly creature category, noteblock category, hostile creature category, note block category, voice category, ambient category, noteblocks category, note blocks category, weather category, block category, friendly mob category, jukebox category, hostile mob category, master category, master volume category, hostile category, record category, blocks category, environment category, jukeboxes category, player category, players category, hostile mobs category, friendly mobs category, music category, friendly creatures category, neutral category
Since: 2.4
Requirements: Minecraft 1.11 or newer
The category of a sound, they are used for sound options of Minecraft. See the play sound and stop sound effects.

Examples:

Missing examples.

Spawn Reason

🔗

Type

Patterns:
  • dispense egg, egg, village defense, ocelot baby, silverfish trap, village invading, trap, dispensing egg, shoulder, drowned, metamorphosis, lightning, silverfish reveal, spell, built iron golem, natural, village invasion, frozen, mount, build wither, built wither, iron golem defense, ender pearl, creature spawner, reinforcements, build snowman, build iron golem, breeding, raid, infection, customized, spawn egg, jockey, beehive, default, golem defense, patrol, slime split, infected, sheared, mob spawner, nether portal, shear, perching, custom, built snowman, chunk generation, breed, command, explosion, spawner, cured, customised, piglin zombification
Since: 2.3
The spawn reason in a spawn event.

Examples:

Missing examples.

Teleport Cause

🔗

Type

Patterns:
  • nether portal, ender gateway, chorus fruit, ender portal, command, unknown, plugin, ender pearl, spectator, spectate, end gateway, chorus, gateway, end portal
Since: 2.2-dev35
The teleport cause in a teleport event.

Examples:

Missing examples.

Text

🔗

Type

Patterns:
  • simple: "..."
  • quotes: "...""..."
  • expressions: "...%expression%..."
  • percent signs: "...%%..."
Since: 1.0
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.

Examples:

broadcast "Hello World!"
message "Hello %player%"
message "The id of ""%type of tool%"" is %id of tool%."

Time

🔗

Type

Patterns:
  • ##:##
  • ##[:##][ ]am/pm
Since: 1.0
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.

Examples:

at 20:00:
    time is 8 pm
    broadcast "It's %time%"

Timeperiod

🔗

Type

Patterns:
  • ##:## - ##:##
  • dusk/day/dawn/night
Since: 1.0
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.

Examples:

time in world is night

Timespan

🔗

Type

Patterns:
  • <number> [minecraft/mc/real/rl/irl] ticks/seconds/minutes/hours/days/weeks/months/years [[,/and] <more...>]
  • [###:]##:##[.####] ([hours:]minutes:seconds[.milliseconds])
Since: 1.0, 2.6.1 (weeks, months, years)
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.

Examples:

every 5 minecraft days:
    wait a minecraft second and 5 ticks
every 10 mc days and 12 hours:
    halt for 12.7 irl minutes, 12 hours and 120.5 seconds

Tree Type

🔗

Type

Patterns:
  • [any] <general tree/mushroom type>, e.g. tree/any jungle tree/etc.
  • <specific tree/mushroom species>, e.g. red mushroom/small jungle tree/big regular tree/etc.
Since: Unknown
A tree type represents a tree species or a huge mushroom species. These can be generated in a world with the generate tree effect.

Examples:

grow any regular tree at the block
grow a huge red mushroom above the block

Type

🔗

Type

Patterns:
  • See the type name patterns of all types - including this one
Since: 2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.

Examples:

{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5
{variable} is a type # check whether the variable contains a type, e.g. number or player
{variable} is an object # will always succeed if the variable is set as everything is an object, even types.
disable PvP in the event-world
kill the loop-entity

Vector

🔗

Type

Patterns:
  • vector(x, y, z)
Since: 2.2-dev23
Vector is a collection of numbers. In Minecraft, 3D vectors are used to express velocities of entities.

Examples:

Missing examples.

Visual Effect

🔗

Type

Patterns:
  • smoke, potion break, ender signal, mobspawner flames, arrow particles, jumping rabbit, hurt, wolf smoke, wolf hearts, wolf shaking, sheep eating, iron golem offering rose, villager hearts, angry villager entity, happy villager entity, witch magic, zombie turning to a villager, firework explosion, love hearts, squid rotation reset, entity poof, guardian target, block with shield, shield break, armor stand hit, hurt by thorns, iron golem sheathing rose, resurrection by totem, hurt by drowning, hurt by explosion, explosion, large explosion, huge explosion, firework's spark, water bubble, water splash, water wake, suspended, void fog, critical hit, magical critical hit, smoke particle, large smoke, spell, spell, potion swirl, transparent potion swirl, witch spell, water drip, lava drip, angry villager, happy villager, small smoke, note, portal, flying glyph, flame, lava pop, cloud, coloured dust, snowball break, snow shovel, slime, heart, item crack, block break, block dust, water drop, mob appearance, dragon breath, end rod, damage indicator, sweep attack, falling dust, totem, spit, squid ink, bubble pop, current down, bubble column up, nautilus, dolphin, sneeze, campfire cosy smoke, campfire signal smoke, composter, flash, falling lava, landing lava, falling water, dripping honey, falling honey, landing honey, falling nectar, soul fire flame, ash, crimson spore, warped spore, soul, dripping obsidian tear, falling obsidian tear, landing obsidian tear, reverse portal, white ash, falling spore blossom, spore blossom air, small flame, snowflake, dripping dripstone lava, falling dripstone lava, dripping dripstone water, falling dripstone water, glow squid ink, glow, wax on, wax off, electric spark, scrape, sonic boom, sculk soul, sculk charge, sculk charge pop, shriek
Since: 2.1
A visible effect, e.g. particles.

Examples:

show wolf hearts on the clicked wolf
play mob spawner flames at the targeted block to the player

Weather Type

🔗

Type

Patterns:
  • clear/sun/sunny, rain/rainy/raining, and thunder/thundering/thunderstorm
Since: 1.0
The weather types sunny, rainy, and thundering.

Examples:

is raining
is sunny in the player's world
message "It is %weather in the argument's world% in %world of the argument%"

World

🔗

Type

Patterns:
  • "world_name", e.g. "world"
Since: 1.0, 2.2 (alternate syntax)
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.

Examples:

broadcast "Hello!" to the world "world_nether"
\ No newline at end of file + Skript Documentation - 2.6.3

Types

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.0
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: aliases-rework
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.
\ No newline at end of file diff --git a/conditions.html b/conditions.html index 70fe9698d40..dc21a7bb6b9 100644 --- a/conditions.html +++ b/conditions.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Conditions

Alphanumeric

🔗

Condition

Patterns:
  • %texts% (is|are) alphanumeric
  • %texts% (isn't|is not|aren't|are not) alphanumeric
Since: 2.4
Checks if the given string is alphanumeric.

Examples:

if the argument is not alphanumeric:
    send "Invalid name!"

Can Build

🔗

Condition

Patterns:
Since: 2.0
Requirements: Supported regions plugin
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.

Examples:

command /setblock <material>:
    description: set the block at your crosshair to a different type
    trigger:
        player cannot build at the targeted block:
            message "You do not have permission to change blocks there!"
            stop
        set the targeted block to argument

Can Fly

🔗

Condition

Patterns:
Since: 2.3
Whether a player is allowed to fly.

Examples:

player can fly

Can Hold

🔗

Condition

Patterns:
Since: 1.0
Tests whether a player or a chest can hold the given item.

Examples:

block can hold 200 cobblestone
player has enough space for 64 feathers

Can See

🔗

Condition

Patterns:
Since: 2.3
Checks whether the given players can see another players.

Examples:

if the player can't see the player-argument:
    message "<light red>The player %player-argument% is not online!"

Chance

🔗

Condition

Patterns:
Since: 1.0
A condition that randomly succeeds or fails. Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1.

Examples:

chance of 50%:
    drop a diamond
chance of {chance}% # {chance} between 0 and 100
chance of {chance} # {chance} between 0 and 1

Comparison

🔗

Condition

Patterns:
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above)|>) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as)|>=) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((less|smaller|lower) than|below)|<) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as)|<=) %objects%
  • [(neither)] %objects% ((is|are) (not|neither)|isn't|aren't|!=) [equal to] %objects%
  • [(neither)] %objects% (is|are|=) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (is|are) between %objects% and %objects%
  • [(neither)] %objects% (is not|are not|isn't|aren't) between %objects% and %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((was|were) (not|neither)|wasn't|weren't) [equal to] %objects%
  • [(neither)] %objects% (was|were) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (was|were) between %objects% and %objects%
  • [(neither)] %objects% (was not|were not|wasn't|weren't) between %objects% and %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((will (not|neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects%
  • [(neither)] %objects% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects%
  • [(neither)] %objects% will be between %objects% and %objects%
  • [(neither)] %objects% (will not be|won't be) between %objects% and %objects%
Since: 1.0
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.

Examples:

the clicked block is a stone slab or a double stone slab
time in the player's world is greater than 8:00
the creature is not an enderman or an ender dragon

Contains

🔗

Condition

Patterns:
Since: 1.0
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.

Examples:

block contains 20 cobblestone
player has 4 flint and 2 iron ingots
{list::*} contains 5

Damage Cause

🔗

Condition

Patterns:
  • [the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since: 2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.

Examples:

# make players use their potions of fire resistance whenever they take any kind of fire damage
on damage:
    damage was caused by lava, fire or burning
    victim is a player
    victim has a potion of fire resistance
    cancel event
    apply fire resistance to the victim for 30 seconds
    remove 1 potion of fire resistance from the victim
# prevent mobs from dropping items under certain circumstances
on death:
    entity is not a player
    damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison
    clear drops

Entity is Wet

🔗

Condition

Patterns:
Since: 2.6.1
Requirements: Paper 1.16+
Checks whether an entity is wet or not (in water, rain or a bubble column).

Examples:

if player is wet:

Entity is in Liquid

🔗

Condition

Patterns:
  • %entities% (is|are) in (water|lava|[a] bubble[ ]column|rain)
  • %entities% (isn't|is not|aren't|are not) in (water|lava|[a] bubble[ ]column|rain)
Since: 2.6.1
Requirements: Minecraft 1.16+ (in water), Paper 1.16+ (in rain, lava and bubble column)
Checks whether an entity is in rain, lava, water or a bubble column.

Examples:

if player is in rain:
if player is in water:
player is in lava:
player is in bubble column

Event Cancelled

🔗

Condition

Patterns:
  • [the] event is cancel[l]ed
  • [the] event (is not|isn't) cancel[l]ed
Since: 2.2-dev36
Checks whether or not the event is cancelled.

Examples:

on click:
    if event is cancelled:
        broadcast "no clicks allowed!"

Exists/Is Set

🔗

Condition

Patterns:
  • %~objects% (exist[s]|(is|are) set)
  • %~objects% (do[es](n't| not) exist|(is|are)(n't| not) set)
Since: 1.2
Checks whether a given expression or variable is set.

Examples:

{teams::%player's uuid%::preferred-team} is not set
on damage:
    projectile exists
    broadcast "%attacker% used a %projectile% to attack %victim%!"

Has AI

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity has AI.

Examples:

target entity has ai

Has Client Weather

🔗

Condition

Patterns:
  • %players% (has|have) [a] (client|custom) weather [set]
  • %players% (doesn't|does not|do not|don't) have [a] (client|custom) weather [set]
Since: 2.3
Checks whether the given players have a custom client weather

Examples:

if the player has custom weather:
    message "Your custom weather is %player's weather%"

Has Custom Model Data

🔗

Condition

Patterns:
  • %item types% (has|have) [custom] model data
  • %item types% (doesn't|does not|do not|don't) have [custom] model data
Since: 2.5
Requirements: 1.14+
Check if an item has a custom model data tag

Examples:

player's tool has custom model data

Has Metadata

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether a metadata holder has a metadata tag.

Examples:

if player has metadata value "healer":

Has Permission

🔗

Condition

Patterns:
Since: 1.0
Test whether a player has a certain permission.

Examples:

player has permission "skript.tree"
victim has the permission "admin":
    send "You're attacking an admin!" to attacker

Has Played Before

🔗

Condition

Patterns:
  • %offline players% [(has|have|did)] [already] play[ed] [on (this|the) server] (before|already)
  • %offline players% (has not|hasn't|have not|haven't|did not|didn't) [(already|yet)] play[ed] [on (this|the) server] (before|already|yet)
Since: 1.4, INSERT VERSION (multiple players)
Checks whether a player has played on this server before. You can also use on first join if you want to make triggers for new players.

Examples:

player has played on this server before
player hasn't played before

Has Potion

🔗

Condition

Patterns:
Since: 2.6.1
Checks whether the given living entities have specific potion effects.

Examples:

if player has potion speed:
    send "You are sonic!"

if all players have potion effects speed and haste:
    broadcast "You are ready to MINE!"

Has Resource Pack

🔗

Condition

Patterns:
  • %players% (has|have) [a] resource pack [(loaded|installed)]
  • %players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since: 2.4
Requirements: Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.

Examples:

if the player has a resource pack loaded:

Has Scoreboard Tag

🔗

Condition

Patterns:
  • %entities% (has|have) [the] score[ ]board tag[s] %texts%
  • %entities% (doesn't|does not|do not|don't) have [the] score[ ]board tag[s] %texts%
Since: 2.3
Checks whether the given entities has the given scoreboard tags.

Examples:

if the targeted armor stand has the scoreboard tag "test tag":

Ignition Process

🔗

Condition

Patterns:
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) going to explode
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) in the (ignition|explosion) process
  • creeper[s] %living entities% ((is|are)|(isn't|is not|aren't|are not)) ignited
Since: 2.5
Requirements: Paper 1.13 or newer
Checks if a creeper is going to explode.

Examples:

if the last spawned creeper is going to explode:
    loop all players in radius 3 of the last spawned creeper
        send "RUN!!!" to the loop-player

Is Alive

🔗

Condition

Patterns:
  • %entities% (is|are) (alive|dead)
  • %entities% (isn't|is not|aren't|are not) (alive|dead)
Since: 2.0, 2.4-alpha4 (non-living entity support)
Checks whether an entity is alive. Works for non-living entities too.

Examples:

if {villager-buddy::%player's uuid%} is not dead:

on shoot:
    while the projectile is alive:

Is Banned

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player or IP is banned.

Examples:

player is banned
victim is not IP-banned
"127.0.0.1" is banned

Is Block

🔗

Condition

Patterns:
  • %item types% (is|are) ([a] block|blocks)
  • %item types% (isn't|is not|aren't|are not) ([a] block|blocks)
Since: 2.4
Checks whether an item is a block.

Examples:

player's held item is a block
{list::*} are blocks

Is Block Redstone Powered

🔗

Condition

Patterns:
  • %blocks% (is|are) redstone powered
  • %blocks% (is|are) indirectly redstone powered
  • %blocks% (is|are)(n't| not) redstone powered
  • %blocks% (is|are)(n't| not) indirectly redstone powered
Since: 2.5
Checks if a block is indirectly or directly powered by redstone

Examples:

if clicked block is redstone powered:
    send "This block is well-powered by redstone!"
if clicked block is indirectly redstone powered:
    send "This block is indirectly redstone powered."

Is Blocking

🔗

Condition

Patterns:
  • %players% (is|are) (blocking|defending) [with [a] shield]
  • %players% (isn't|is not|aren't|are not) (blocking|defending) [with [a] shield]
Since: unknown (before 2.1)
Checks whether a player is blocking with their shield.

Examples:

on damage of player:
    victim is blocking
    damage attacker by 0.5 hearts

Is Burning

🔗

Condition

Patterns:
  • %entities% (is|are) (burning|ignited|on fire)
  • %entities% (isn't|is not|aren't|are not) (burning|ignited|on fire)
Since: 1.4.4
Checks whether an entity is on fire, e.g. a zombie due to being in sunlight, or any entity after falling into lava.

Examples:

# increased attack against burning targets
victim is burning:
    increase damage by 2

Is Charged

🔗

Condition

Patterns:
Since: 2.5
Checks if a creeper is charged (powered).

Examples:

if the last spawned creeper is charged:
    broadcast "A charged creeper is at %location of last spawned creeper%"

Is Edible

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is edible.

Examples:

steak is edible
player's tool is edible

Is Empty

🔗

Condition

Patterns:
Since: unknown (before 2.1)
Checks whether an inventory, an inventory slot, or a text is empty.

Examples:

player's inventory is empty

Is Enchanted

🔗

Condition

Patterns:
Since: 1.4.6
Checks whether an item is enchanted.

Examples:

tool of the player is enchanted with efficiency 2
helm, chestplate, leggings or boots are enchanted

Is Flammable

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is flammable.

Examples:

wood is flammable
player's tool is flammable

Is Flying

🔗

Condition

Patterns:
  • %players% (is|are) flying
  • %players% (isn't|is not|aren't|are not) flying
Since: 1.4.4
Checks whether a player is flying.

Examples:

player is not flying

Is Fuel

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11.2+
Checks whether an item can be used as fuel in a furnace.

Examples:

on right click on furnace:
    if player's tool is not fuel:
        send "Please hold a valid fuel item in your hand"
        cancel event

Is Holding

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is holding a specific item. Cannot be used with endermen, use 'entity is [not] an enderman holding <item type>' instead.

Examples:

player is holding a stick
victim isn't holding a sword of sharpness

Is Incendiary

🔗

Condition

Patterns:
  • %entities% ((is|are) incendiary|cause[s] a[n] (incendiary|fiery) explosion)
  • %entities% ((is not|are not|isn't|aren't) incendiary|(does not|do not|doesn't|don't) cause[s] a[n] (incendiary|fiery) explosion)
  • the [event(-| )]explosion (is|(is not|isn't)) (incendiary|fiery)
Since: 2.5
Checks if an entity will create fire when it explodes. This condition is also usable in an explosion prime event.

Examples:

on explosion prime:
    if the explosion is fiery:
        broadcast "A fiery explosive has been ignited!"

Is Interactable

🔗

Condition

Patterns:
Since: 2.5.2
Requirements: Minecraft 1.13+
Checks wether or not a block is interactable.

Examples:

on block break:
    if event-block is interactable:
        cancel event
        send "You cannot break interactable blocks!"

Is Invulnerable

🔗

Condition

Patterns:
  • %entities% (is|are) invulnerable
  • %entities% (isn't|is not|aren't|are not) invulnerable
Since: 2.5
Checks whether an entity is invulnerable.

Examples:

target entity is invulnerable

Is Leashed

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently leashed.

Examples:

target entity is leashed

Is Loaded

🔗

Condition

Patterns:
Since: 2.3, 2.5 (revamp with chunk at location/coords)
Checks whether or not a chunk/world is loaded. 'chunk at 1, 1' uses chunk coords, which are location coords divided by 16.

Examples:

if chunk at {home::%player's uuid%} is loaded:
if chunk 1, 10 in world "world" is loaded:
if world("lobby") is loaded:

Is Member/Owner of Region

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.

Examples:

on region enter:
    player is the owner of the region
    message "Welcome back to %region%!"
    send "%player% just entered %region%!" to all members of the region

Is Normalized

🔗

Condition

Patterns:
  • %vectors% (is|are) normalized
  • %vectors% (isn't|is not|aren't|are not) normalized
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a vector is normalized i.e. length of 1

Examples:

vector of player's location is normalized

Is Occluding

🔗

Condition

Patterns:
Since: 2.5.1
Checks whether an item is a block and completely blocks vision.

Examples:

player's tool is occluding

Is Online

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player is online.

Examples:

player is online
player-argument is offline

Is Passable

🔗

Condition

Patterns:
  • %blocks% (is|are) passable
  • %blocks% (isn't|is not|aren't|are not) passable
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.

Examples:

if player's targeted block is passable

Is Plugin Enabled

🔗

Condition

Patterns:
  • plugin[s] %texts% (is|are) enabled
  • plugin[s] %texts% (is|are)(n't| not) enabled
  • plugin[s] %texts% (is|are) disabled
Since: 2.6
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.

Examples:

if plugin "Vault" is enabled:
if plugin "WorldGuard" is not enabled:
if plugins "Essentials" and "Vault" are enabled:
if plugin "MyBrokenPlugin" is disabled:

Is Poisoned

🔗

Condition

Patterns:
Since: 1.4.4
Checks whether an entity is poisoned.

Examples:

player is poisoned:
    cure the player from poison
    message "You have been cured!"

Is Riding

🔗

Condition

Patterns:
Since: 2.0
Tests whether an entity is riding another or is in a vehicle.

Examples:

player is riding a saddled pig

Is Riptiding

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently using the Riptide enchantment.

Examples:

target entity is riptiding

Is Script Loaded

🔗

Condition

Patterns:
  • script[s] [%texts%] (is|are) loaded
  • script[s] [%texts%] (isn't|is not|aren't|are not) loaded
Since: 2.2-dev31
Check if the current script, or another script, is currently loaded.

Examples:

script is loaded
script "example.sk" is loaded

Is Silent

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity is silent i.e. its sounds are disabled.

Examples:

target entity is silent

Is Sleeping

🔗

Condition

Patterns:
  • %players% (is|are) sleeping
  • %players% (isn't|is not|aren't|are not) sleeping
Since: 1.4.4
Checks whether a player is sleeping.

Examples:

# cut your enemies' throats in their sleep >=)
on attack:
    attacker is holding a sword
    victim is sleeping
    increase the damage by 1000

Is Slime Chunk

🔗

Condition

Patterns:
  • %chunk% (is|are) ([a] slime chunk|slime chunks|slimey)
  • %chunk% (isn't|is not|aren't|are not) ([a] slime chunk|slime chunks|slimey)
Since: 2.3
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.

Examples:

command /slimey:
    trigger:
        if chunk at player is a slime chunk:
            send "Yeah, it is!"
        else:
            send "Nope, it isn't"

Is Sneaking

🔗

Condition

Patterns:
  • %players% (is|are) sneaking
  • %players% (isn't|is not|aren't|are not) sneaking
Since: 1.4.4
Checks whether a player is sneaking.

Examples:

# prevent mobs from seeing sneaking players if they are at least 4 meters apart
on target:
    target is sneaking
    distance of target and the entity is bigger than 4
    cancel the event

Is Solid

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is solid.

Examples:

grass block is solid
player's tool isn't solid

Is Sprinting

🔗

Condition

Patterns:
  • %players% (is|are) sprinting
  • %players% (isn't|is not|aren't|are not) sprinting
Since: 1.4.4
Checks whether a player is sprinting.

Examples:

player is not sprinting

Is Swimming

🔗

Condition

Patterns:
Since: 2.3
Requirements: 1.13 or newer
Checks whether a living entity is swimming.

Examples:

player is swimming

Is Tameable

🔗

Condition

Patterns:
Since: 2.5
Check if an entity is tameable.

Examples:

on damage:
    if victim is tameable:
        cancel event

Is Transparent

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.

Examples:

player's tool is transparent.

Is Unbreakable

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11+
Checks whether an item is unbreakable.

Examples:

if event-item is unbreakable

Is Wearing

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is wearing some armour.

Examples:

player is wearing an iron chestplate and iron leggings
player is wearing all diamond armour

Is Whitelisted

🔗

Condition

Patterns:
  • [the] server (is|is(n't| not)) white[ ]listed
  • %players% (is|are)[(n't| not)] white[ ]listed
Since: 2.5.2
Whether or not the server or a player is whitelisted.

Examples:

if server is whitelisted:
if player is whitelisted

Is a Skript command

🔗

Condition

Patterns:
  • %text% (is|are) [a] s(k|c)ript (command|cmd)
  • %text% (isn't|is not|aren't|are not) [a] s(k|c)ript (command|cmd)
Since: 2.6
Checks whether a command/string is a custom Skript command.

Examples:

# Example 1
on command:
    command is a skript command

# Example 2
"sometext" is a skript command

Is in World

🔗

Condition

Patterns:
Since: 1.4
Checks whether an entity is in a specific world.

Examples:

player is in "world"
argument isn't in world "world_nether"
the player is in the world of the victim

Is of Type

🔗

Condition

Patterns:
Since: 1.4
Checks whether an item of an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').

Examples:

tool is of type {selected type}
victim is of type {villager type}

Is on Ground

🔗

Condition

Patterns:
  • %entities% (is|are) on [the] ground
  • %entities% (isn't|is not|aren't|are not) on [the] ground
Since: 2.2-dev26
Checks whether an entity is on ground.

Examples:

player is not on ground

Matches

🔗

Condition

Patterns:
  • %texts% (match[es]|do[es](n't| not) match) %texts%
  • %texts% (partially match[es]|do[es](n't| not) partially match) %texts%
Since: 2.5.2
Checks whether the defined strings match the input regexes (Regular expressions).

Examples:

on chat:
    if message partially matches "\d":
        send "Message contains a digit!"
    if message doesn't match "[A-Za-z]+":
        send "Message doesn't only contain letters!"

Projectile Can Bounce

🔗

Condition

Patterns:
Since: 2.5.1
Whether or not a projectile can bounce.

Examples:

on shoot:
    send "Boing!" to all players if projectile can bounce

PvP

🔗

Condition

Patterns:
  • (is PvP|PvP is) enabled [in %worlds%]
  • (is PvP|PvP is) disabled [in %worlds%]
Since: 1.3.4
Checks the PvP state of a world.

Examples:

PvP is enabled
PvP is disabled in "world"

Region Contains

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a location is contained in a particular region. This condition requires a supported regions plugin to be installed.

Examples:

player is in the region {regions::3}

on region enter:
    region contains {flags.%world%.red}
    message "The red flag is near!"

Resource Pack

🔗

Condition

Patterns:
Since: 2.4
Usable in events: resource pack request response
Checks state of the resource pack in a resource pack request response event.

Examples:

on resource pack response:
    if the resource pack wasn't accepted:
        kick the player due to "You have to install the resource pack to play in this server!"

Starts/Ends With

🔗

Condition

Patterns:
  • %texts% (start|end)[s] with %texts%
  • %texts% (doesn't|does not|do not|don't) (start|end) with %texts%
Since: 2.2-dev36, 2.5.1 (multiple strings support)
Checks if a text starts or ends with another.

Examples:

if the argument starts with "test" or "debug":
    send "Stop!"

Time

🔗

Condition

Patterns:
Since: 2.0
Tests whether a given real time was more or less than some time span ago.

Examples:

command /command-with-cooldown:
    trigger:
        {command::%player's uuid%::last-usage} was less than a minute ago:
            message "Please wait a minute between uses of this command."
            stop
        set {command::%player's uuid%::last-usage} to now
        # ... actual command trigger here ...
\ No newline at end of file + Skript Documentation - 2.6.3

Conditions

Alphanumeric

🔗

Condition

Patterns:
  • %texts% (is|are) alphanumeric
  • %texts% (isn't|is not|aren't|are not) alphanumeric
Since: 2.4
Checks if the given string is alphanumeric.

Examples:

if the argument is not alphanumeric:
    send "Invalid name!"

Can Build

🔗

Condition

Patterns:
Since: 2.0
Requirements: Supported regions plugin
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.

Examples:

command /setblock <material>:
    description: set the block at your crosshair to a different type
    trigger:
        player cannot build at the targeted block:
            message "You do not have permission to change blocks there!"
            stop
        set the targeted block to argument

Can Fly

🔗

Condition

Patterns:
Since: 2.3
Whether a player is allowed to fly.

Examples:

player can fly

Can Hold

🔗

Condition

Patterns:
Since: 1.0
Tests whether a player or a chest can hold the given item.

Examples:

block can hold 200 cobblestone
player has enough space for 64 feathers

Can See

🔗

Condition

Patterns:
Since: 2.3
Checks whether the given players can see another players.

Examples:

if the player can't see the player-argument:
    message "<light red>The player %player-argument% is not online!"

Chance

🔗

Condition

Patterns:
Since: 1.0
A condition that randomly succeeds or fails. Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1.

Examples:

chance of 50%:
    drop a diamond
chance of {chance}% # {chance} between 0 and 100
chance of {chance} # {chance} between 0 and 1

Comparison

🔗

Condition

Patterns:
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above)|>) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as)|>=) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((less|smaller|lower) than|below)|<) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as)|<=) %objects%
  • [(neither)] %objects% ((is|are) (not|neither)|isn't|aren't|!=) [equal to] %objects%
  • [(neither)] %objects% (is|are|=) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (is|are) between %objects% and %objects%
  • [(neither)] %objects% (is not|are not|isn't|aren't) between %objects% and %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((was|were) (not|neither)|wasn't|weren't) [equal to] %objects%
  • [(neither)] %objects% (was|were) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (was|were) between %objects% and %objects%
  • [(neither)] %objects% (was not|were not|wasn't|weren't) between %objects% and %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((will (not|neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects%
  • [(neither)] %objects% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects%
  • [(neither)] %objects% will be between %objects% and %objects%
  • [(neither)] %objects% (will not be|won't be) between %objects% and %objects%
Since: 1.0
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.

Examples:

the clicked block is a stone slab or a double stone slab
time in the player's world is greater than 8:00
the creature is not an enderman or an ender dragon

Contains

🔗

Condition

Patterns:
Since: 1.0
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.

Examples:

block contains 20 cobblestone
player has 4 flint and 2 iron ingots
{list::*} contains 5

Damage Cause

🔗

Condition

Patterns:
  • [the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since: 2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.

Examples:

# make players use their potions of fire resistance whenever they take any kind of fire damage
on damage:
    damage was caused by lava, fire or burning
    victim is a player
    victim has a potion of fire resistance
    cancel event
    apply fire resistance to the victim for 30 seconds
    remove 1 potion of fire resistance from the victim
# prevent mobs from dropping items under certain circumstances
on death:
    entity is not a player
    damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison
    clear drops

Egg Will Hatch

🔗

Condition

Patterns:
  • [the] egg (will|will not|won't) hatch
Since: INSERT VERSION
Usable in events: Egg Throw
Whether the egg will hatch in a Player Egg Throw event.

Examples:

on player egg throw:
    if an entity won't hatch:
        send "Better luck next time!" to the player

Entity is Wet

🔗

Condition

Patterns:
Since: 2.6.1
Requirements: Paper 1.16+
Checks whether an entity is wet or not (in water, rain or a bubble column).

Examples:

if player is wet:

Entity is in Liquid

🔗

Condition

Patterns:
  • %entities% (is|are) in (water|lava|[a] bubble[ ]column|rain)
  • %entities% (isn't|is not|aren't|are not) in (water|lava|[a] bubble[ ]column|rain)
Since: 2.6.1
Requirements: Minecraft 1.16+ (in water), Paper 1.16+ (in rain, lava and bubble column)
Checks whether an entity is in rain, lava, water or a bubble column.

Examples:

if player is in rain:
if player is in water:
player is in lava:
player is in bubble column

Event Cancelled

🔗

Condition

Patterns:
  • [the] event is cancel[l]ed
  • [the] event (is not|isn't) cancel[l]ed
Since: 2.2-dev36
Checks whether or not the event is cancelled.

Examples:

on click:
    if event is cancelled:
        broadcast "no clicks allowed!"

Exists/Is Set

🔗

Condition

Patterns:
  • %~objects% (exist[s]|(is|are) set)
  • %~objects% (do[es](n't| not) exist|(is|are)(n't| not) set)
Since: 1.2
Checks whether a given expression or variable is set.

Examples:

{teams::%player's uuid%::preferred-team} is not set
on damage:
    projectile exists
    broadcast "%attacker% used a %projectile% to attack %victim%!"

Has AI

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity has AI.

Examples:

target entity has ai

Has Client Weather

🔗

Condition

Patterns:
  • %players% (has|have) [a] (client|custom) weather [set]
  • %players% (doesn't|does not|do not|don't) have [a] (client|custom) weather [set]
Since: 2.3
Checks whether the given players have a custom client weather

Examples:

if the player has custom weather:
    message "Your custom weather is %player's weather%"

Has Custom Model Data

🔗

Condition

Patterns:
  • %item types% (has|have) [custom] model data
  • %item types% (doesn't|does not|do not|don't) have [custom] model data
Since: 2.5
Requirements: 1.14+
Check if an item has a custom model data tag

Examples:

player's tool has custom model data

Has Metadata

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether a metadata holder has a metadata tag.

Examples:

if player has metadata value "healer":

Has Permission

🔗

Condition

Patterns:
Since: 1.0
Test whether a player has a certain permission.

Examples:

player has permission "skript.tree"
victim has the permission "admin":
    send "You're attacking an admin!" to attacker

Has Played Before

🔗

Condition

Patterns:
  • %offline players% [(has|have|did)] [already] play[ed] [on (this|the) server] (before|already)
  • %offline players% (has not|hasn't|have not|haven't|did not|didn't) [(already|yet)] play[ed] [on (this|the) server] (before|already|yet)
Since: 1.4, INSERT VERSION (multiple players)
Checks whether a player has played on this server before. You can also use on first join if you want to make triggers for new players.

Examples:

player has played on this server before
player hasn't played before

Has Potion

🔗

Condition

Patterns:
Since: 2.6.1
Checks whether the given living entities have specific potion effects.

Examples:

if player has potion speed:
    send "You are sonic!"

if all players have potion effects speed and haste:
    broadcast "You are ready to MINE!"

Has Resource Pack

🔗

Condition

Patterns:
  • %players% (has|have) [a] resource pack [(loaded|installed)]
  • %players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since: 2.4
Requirements: Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.

Examples:

if the player has a resource pack loaded:

Has Scoreboard Tag

🔗

Condition

Patterns:
  • %entities% (has|have) [the] score[ ]board tag[s] %texts%
  • %entities% (doesn't|does not|do not|don't) have [the] score[ ]board tag[s] %texts%
Since: 2.3
Checks whether the given entities has the given scoreboard tags.

Examples:

if the targeted armor stand has the scoreboard tag "test tag":

Ignition Process

🔗

Condition

Patterns:
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) going to explode
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) in the (ignition|explosion) process
  • creeper[s] %living entities% ((is|are)|(isn't|is not|aren't|are not)) ignited
Since: 2.5
Requirements: Paper 1.13 or newer
Checks if a creeper is going to explode.

Examples:

if the last spawned creeper is going to explode:
    loop all players in radius 3 of the last spawned creeper
        send "RUN!!!" to the loop-player

Is Alive

🔗

Condition

Patterns:
  • %entities% (is|are) (alive|dead)
  • %entities% (isn't|is not|aren't|are not) (alive|dead)
Since: 2.0, 2.4-alpha4 (non-living entity support)
Checks whether an entity is alive. Works for non-living entities too.

Examples:

if {villager-buddy::%player's uuid%} is not dead:

on shoot:
    while the projectile is alive:

Is Banned

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player or IP is banned.

Examples:

player is banned
victim is not IP-banned
"127.0.0.1" is banned

Is Block

🔗

Condition

Patterns:
  • %item types% (is|are) ([a] block|blocks)
  • %item types% (isn't|is not|aren't|are not) ([a] block|blocks)
Since: 2.4
Checks whether an item is a block.

Examples:

player's held item is a block
{list::*} are blocks

Is Block Redstone Powered

🔗

Condition

Patterns:
  • %blocks% (is|are) redstone powered
  • %blocks% (is|are) indirectly redstone powered
  • %blocks% (is|are)(n't| not) redstone powered
  • %blocks% (is|are)(n't| not) indirectly redstone powered
Since: 2.5
Checks if a block is indirectly or directly powered by redstone

Examples:

if clicked block is redstone powered:
    send "This block is well-powered by redstone!"
if clicked block is indirectly redstone powered:
    send "This block is indirectly redstone powered."

Is Blocking

🔗

Condition

Patterns:
  • %players% (is|are) (blocking|defending) [with [a] shield]
  • %players% (isn't|is not|aren't|are not) (blocking|defending) [with [a] shield]
Since: unknown (before 2.1)
Checks whether a player is blocking with their shield.

Examples:

on damage of player:
    victim is blocking
    damage attacker by 0.5 hearts

Is Burning

🔗

Condition

Patterns:
  • %entities% (is|are) (burning|ignited|on fire)
  • %entities% (isn't|is not|aren't|are not) (burning|ignited|on fire)
Since: 1.4.4
Checks whether an entity is on fire, e.g. a zombie due to being in sunlight, or any entity after falling into lava.

Examples:

# increased attack against burning targets
victim is burning:
    increase damage by 2

Is Charged

🔗

Condition

Patterns:
Since: 2.5
Checks if a creeper is charged (powered).

Examples:

if the last spawned creeper is charged:
    broadcast "A charged creeper is at %location of last spawned creeper%"

Is Edible

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is edible.

Examples:

steak is edible
player's tool is edible

Is Empty

🔗

Condition

Patterns:
Since: unknown (before 2.1)
Checks whether an inventory, an inventory slot, or a text is empty.

Examples:

player's inventory is empty

Is Enchanted

🔗

Condition

Patterns:
Since: 1.4.6
Checks whether an item is enchanted.

Examples:

tool of the player is enchanted with efficiency 2
helm, chestplate, leggings or boots are enchanted

Is Flammable

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is flammable.

Examples:

wood is flammable
player's tool is flammable

Is Flying

🔗

Condition

Patterns:
  • %players% (is|are) flying
  • %players% (isn't|is not|aren't|are not) flying
Since: 1.4.4
Checks whether a player is flying.

Examples:

player is not flying

Is Frozen

🔗

Condition

Patterns:
Since: INSERT VERSION
Checks whether an entity is frozen.

Examples:

if player is frozen:
    kill player

Is Fuel

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11.2+
Checks whether an item can be used as fuel in a furnace.

Examples:

on right click on furnace:
    if player's tool is not fuel:
        send "Please hold a valid fuel item in your hand"
        cancel event

Is Holding

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is holding a specific item. Cannot be used with endermen, use 'entity is [not] an enderman holding <item type>' instead.

Examples:

player is holding a stick
victim isn't holding a sword of sharpness

Is Incendiary

🔗

Condition

Patterns:
  • %entities% ((is|are) incendiary|cause[s] a[n] (incendiary|fiery) explosion)
  • %entities% ((is not|are not|isn't|aren't) incendiary|(does not|do not|doesn't|don't) cause[s] a[n] (incendiary|fiery) explosion)
  • the [event(-| )]explosion (is|(is not|isn't)) (incendiary|fiery)
Since: 2.5
Checks if an entity will create fire when it explodes. This condition is also usable in an explosion prime event.

Examples:

on explosion prime:
    if the explosion is fiery:
        broadcast "A fiery explosive has been ignited!"

Is Interactable

🔗

Condition

Patterns:
Since: 2.5.2
Requirements: Minecraft 1.13+
Checks wether or not a block is interactable.

Examples:

on block break:
    if event-block is interactable:
        cancel event
        send "You cannot break interactable blocks!"

Is Invulnerable

🔗

Condition

Patterns:
  • %entities% (is|are) invulnerable
  • %entities% (isn't|is not|aren't|are not) invulnerable
Since: 2.5
Checks whether an entity is invulnerable.

Examples:

target entity is invulnerable

Is Leashed

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently leashed.

Examples:

target entity is leashed

Is Loaded

🔗

Condition

Patterns:
Since: 2.3, 2.5 (revamp with chunk at location/coords)
Checks whether or not a chunk/world is loaded. 'chunk at 1, 1' uses chunk coords, which are location coords divided by 16.

Examples:

if chunk at {home::%player's uuid%} is loaded:
if chunk 1, 10 in world "world" is loaded:
if world("lobby") is loaded:

Is Member/Owner of Region

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.

Examples:

on region enter:
    player is the owner of the region
    message "Welcome back to %region%!"
    send "%player% just entered %region%!" to all members of the region

Is Normalized

🔗

Condition

Patterns:
  • %vectors% (is|are) normalized
  • %vectors% (isn't|is not|aren't|are not) normalized
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a vector is normalized i.e. length of 1

Examples:

vector of player's location is normalized

Is Occluding

🔗

Condition

Patterns:
Since: 2.5.1
Checks whether an item is a block and completely blocks vision.

Examples:

player's tool is occluding

Is Online

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player is online.

Examples:

player is online
player-argument is offline

Is Passable

🔗

Condition

Patterns:
  • %blocks% (is|are) passable
  • %blocks% (isn't|is not|aren't|are not) passable
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.

Examples:

if player's targeted block is passable

Is Plugin Enabled

🔗

Condition

Patterns:
  • plugin[s] %texts% (is|are) enabled
  • plugin[s] %texts% (is|are)(n't| not) enabled
  • plugin[s] %texts% (is|are) disabled
Since: 2.6
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.

Examples:

if plugin "Vault" is enabled:
if plugin "WorldGuard" is not enabled:
if plugins "Essentials" and "Vault" are enabled:
if plugin "MyBrokenPlugin" is disabled:

Is Poisoned

🔗

Condition

Patterns:
Since: 1.4.4
Checks whether an entity is poisoned.

Examples:

player is poisoned:
    cure the player from poison
    message "You have been cured!"

Is Riding

🔗

Condition

Patterns:
Since: 2.0
Tests whether an entity is riding another or is in a vehicle.

Examples:

player is riding a saddled pig

Is Riptiding

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently using the Riptide enchantment.

Examples:

target entity is riptiding

Is Script Loaded

🔗

Condition

Patterns:
  • script[s] [%texts%] (is|are) loaded
  • script[s] [%texts%] (isn't|is not|aren't|are not) loaded
Since: 2.2-dev31
Check if the current script, or another script, is currently loaded.

Examples:

script is loaded
script "example.sk" is loaded

Is Silent

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity is silent i.e. its sounds are disabled.

Examples:

target entity is silent

Is Sleeping

🔗

Condition

Patterns:
  • %players% (is|are) sleeping
  • %players% (isn't|is not|aren't|are not) sleeping
Since: 1.4.4
Checks whether a player is sleeping.

Examples:

# cut your enemies' throats in their sleep >=)
on attack:
    attacker is holding a sword
    victim is sleeping
    increase the damage by 1000

Is Slime Chunk

🔗

Condition

Patterns:
  • %chunk% (is|are) ([a] slime chunk|slime chunks|slimey)
  • %chunk% (isn't|is not|aren't|are not) ([a] slime chunk|slime chunks|slimey)
Since: 2.3
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.

Examples:

command /slimey:
    trigger:
        if chunk at player is a slime chunk:
            send "Yeah, it is!"
        else:
            send "Nope, it isn't"

Is Sneaking

🔗

Condition

Patterns:
  • %players% (is|are) sneaking
  • %players% (isn't|is not|aren't|are not) sneaking
Since: 1.4.4
Checks whether a player is sneaking.

Examples:

# prevent mobs from seeing sneaking players if they are at least 4 meters apart
on target:
    target is sneaking
    distance of target and the entity is bigger than 4
    cancel the event

Is Solid

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is solid.

Examples:

grass block is solid
player's tool isn't solid

Is Sprinting

🔗

Condition

Patterns:
  • %players% (is|are) sprinting
  • %players% (isn't|is not|aren't|are not) sprinting
Since: 1.4.4
Checks whether a player is sprinting.

Examples:

player is not sprinting

Is Swimming

🔗

Condition

Patterns:
Since: 2.3
Requirements: 1.13 or newer
Checks whether a living entity is swimming.

Examples:

player is swimming

Is Tameable

🔗

Condition

Patterns:
Since: 2.5
Check if an entity is tameable.

Examples:

on damage:
    if victim is tameable:
        cancel event

Is Transparent

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.

Examples:

player's tool is transparent.

Is Unbreakable

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11+
Checks whether an item is unbreakable.

Examples:

if event-item is unbreakable

Is Wearing

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is wearing some armour.

Examples:

player is wearing an iron chestplate and iron leggings
player is wearing all diamond armour

Is Whitelisted

🔗

Condition

Patterns:
  • [the] server (is|is(n't| not)) white[ ]listed
  • %players% (is|are)[(n't| not)] white[ ]listed
Since: 2.5.2
Whether or not the server or a player is whitelisted.

Examples:

if server is whitelisted:
if player is whitelisted

Is a Skript command

🔗

Condition

Patterns:
  • %text% (is|are) [a] s(k|c)ript (command|cmd)
  • %text% (isn't|is not|aren't|are not) [a] s(k|c)ript (command|cmd)
Since: 2.6
Checks whether a command/string is a custom Skript command.

Examples:

# Example 1
on command:
    command is a skript command

# Example 2
"sometext" is a skript command

Is in World

🔗

Condition

Patterns:
Since: 1.4
Checks whether an entity is in a specific world.

Examples:

player is in "world"
argument isn't in world "world_nether"
the player is in the world of the victim

Is of Type

🔗

Condition

Patterns:
Since: 1.4
Checks whether an item of an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').

Examples:

tool is of type {selected type}
victim is of type {villager type}

Is on Ground

🔗

Condition

Patterns:
  • %entities% (is|are) on [the] ground
  • %entities% (isn't|is not|aren't|are not) on [the] ground
Since: 2.2-dev26
Checks whether an entity is on ground.

Examples:

player is not on ground

Matches

🔗

Condition

Patterns:
  • %texts% (match[es]|do[es](n't| not) match) %texts%
  • %texts% (partially match[es]|do[es](n't| not) partially match) %texts%
Since: 2.5.2
Checks whether the defined strings match the input regexes (Regular expressions).

Examples:

on chat:
    if message partially matches "\d":
        send "Message contains a digit!"
    if message doesn't match "[A-Za-z]+":
        send "Message doesn't only contain letters!"

Projectile Can Bounce

🔗

Condition

Patterns:
Since: 2.5.1
Whether or not a projectile can bounce.

Examples:

on shoot:
    send "Boing!" to all players if projectile can bounce

PvP

🔗

Condition

Patterns:
  • (is PvP|PvP is) enabled [in %worlds%]
  • (is PvP|PvP is) disabled [in %worlds%]
Since: 1.3.4
Checks the PvP state of a world.

Examples:

PvP is enabled
PvP is disabled in "world"

Region Contains

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a location is contained in a particular region. This condition requires a supported regions plugin to be installed.

Examples:

player is in the region {regions::3}

on region enter:
    region contains {flags.%world%.red}
    message "The red flag is near!"

Resource Pack

🔗

Condition

Patterns:
Since: 2.4
Usable in events: resource pack request response
Checks state of the resource pack in a resource pack request response event.

Examples:

on resource pack response:
    if the resource pack wasn't accepted:
        kick the player due to "You have to install the resource pack to play in this server!"

Starts/Ends With

🔗

Condition

Patterns:
  • %texts% (start|end)[s] with %texts%
  • %texts% (doesn't|does not|do not|don't) (start|end) with %texts%
Since: 2.2-dev36, 2.5.1 (multiple strings support)
Checks if a text starts or ends with another.

Examples:

if the argument starts with "test" or "debug":
    send "Stop!"

Time

🔗

Condition

Patterns:
Since: 2.0
Tests whether a given real time was more or less than some time span ago.

Examples:

command /command-with-cooldown:
    trigger:
        {command::%player's uuid%::last-usage} was less than a minute ago:
            message "Please wait a minute between uses of this command."
            stop
        set {command::%player's uuid%::last-usage} to now
        # ... actual command trigger here ...
\ No newline at end of file diff --git a/css/styles.css b/css/styles.css index 934999c174d..7329003aa74 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1160,3 +1160,35 @@ pre code { /* override styling for code blocks */ color: rgb(255, 91, 91) !important; font-weight: 600; } + +#cookies-bar { + position: sticky; + right: 8vw; + bottom: 0; + background-color: #353535; + color: white; + width: 100vw; + padding: 10px; + z-index: 100; + display: flex; + align-items: center; + justify-content: center; +} + +#cookies-accept { + padding: 5px 10px; + border: unset; + background-color: rgb(29, 167, 29); + margin: 0 5px; + cursor: pointer; + color: white; +} + +#cookies-deny { + padding: 5px 10px; + border: unset; + background-color: rgb(167, 29, 29); + margin: 0 5px; + cursor: pointer; + color: white; +} \ No newline at end of file diff --git a/docs.html b/docs.html index 7488c33ff6a..7d4c4a2ec56 100644 --- a/docs.html +++ b/docs.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

All Elements

Absorbed blocks

🔗

Expression

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

Examples:

the absorbed blocks

Affected Entities

🔗

Expression

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

Examples:

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

All Groups

🔗

Expression

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

Examples:

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

All Permissions

🔗

Expression

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

Examples:

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

All Scripts

🔗

Expression

Patterns:
  • [all [of the]] scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (enabled|loaded) scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (disabled|unloaded) scripts [(without ([subdirectory] paths|parents))]
Since: 2.5
Return Type: Text
Returns all of the scripts, or just the enabled or disabled ones.

Examples:

command /scripts:
    trigger:
        send "All Scripts: %scripts%" to player
        send "Loaded Scripts: %enabled scripts%" to player
        send "Unloaded Scripts: %disabled scripts%" to player

All commands

🔗

Expression

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

Examples:

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

Alphabetical Sort

🔗

Expression

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

Examples:

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

Altitude

🔗

Expression

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

Examples:

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

Amount

🔗

Expression

Patterns:
  • [the] (amount|number|size) of %objects%
  • [the] recursive (amount|number|size) of %objects%
Since: 1.0
Return Type: long
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.

Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.

 {list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6

Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!

Examples:

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

Amount of Items

🔗

Expression

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

Examples:

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

Applied Enchantments

🔗

Expression

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

Examples:

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

Argument

🔗

Expression

Patterns:
  • [the] last arg[ument][s]
  • [the] arg[ument][s](-| )<(\d+)>
  • [the] <(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th> arg[ument][s]
  • [the] arg[ument][s]
  • [the] %*type%( |-)arg[ument][( |-)<\d+>]
  • [the] arg[ument]( |-)%*type%[( |-)<\d+>]
Since: 1.0
Return Type: Object
Only usable in command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'.

Examples:

give the item-argument to the player-argument
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument

Arithmetic

🔗

Expression

Patterns:
Since: 1.4.2
Return Type: Number
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.

Examples:

set the player's health to 10 - the player's health
loop (argument + 2) / 5 times:
    message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"

Armour Slot

🔗

Expression

Patterns:
  • [the] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)] of %living entities%
  • %living entities%'[s] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)]
Since: 1.0
Return Type: Inventory Slot
A part of a player's armour, i.e. the boots, leggings, chestplate or helmet.

Examples:

set chestplate of the player to a diamond chestplate
helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin

Arrow Knockback Strength

🔗

Expression

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

Examples:

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

Arrows Stuck

🔗

Expression

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

Examples:

set arrows stuck in player to 5

Attack Cooldown

🔗

Expression

Patterns:
Since: 2.6.1
Requirements: Minecraft 1.15+
Return Type: float
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.

Examples:

on damage:
    if attack cooldown of attacker < 1:
        set damage to 0
        send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker

Attacked

🔗

Expression

Patterns:
  • [the] (attacked|damaged|victim) [<(.+)>]
Since: 1.3, 2.6.1 (projectile hit event)
Usable in events: damage, death, projectile hit
Return Type: Entity
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.

Examples:

on damage:
    victim is a creeper
    damage the attacked by 1 heart

Attacker

🔗

Expression

Patterns:
  • [the] (attacker|damager)
Since: 1.3
Usable in events: damage, death, destroy
Return Type: Entity
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.

Examples:

on damage:
    attacker is a player
    health of attacker is less than or equal to 2
    damage victim by 1 heart

Bed

🔗

Expression

Patterns:
  • [the] bed[s] [location[s]] of %players%
  • %players%'[s] bed[s] [location[s]]
Since: 2.0
Return Type: Location
The bed location of a player, i.e. the spawn point of a player if he ever slept in a bed and the bed still exists and is unobstructed.

Examples:

if bed of player exists:
    teleport player the the player's bed
else:
    teleport the player to the world's spawn point

Biome

🔗

Expression

Patterns:
Since: 1.4.4, 2.6.1 (3D biomes)
Return Type: Biome
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).

Examples:

# damage player in deserts constantly
every real minute:
    loop all players:
        biome at loop-player is desert
        damage the loop-player by 1

Block

🔗

Expression

Patterns:
  • [the] [event-]block
Since: 1.0
Return Type: Block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block

🔗

Expression

Patterns:
Since: 1.0
Return Type: Block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block Age

🔗

Expression

Patterns:
  • [the] [max[imum]] age of %block%
  • %block%'[s] [max[imum]] age
Since: INSERT VERSION
Requirements: Minecraft 1.13+
Return Type: integer
Returns the age or max age of a block. '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.

Examples:

set age of targeted block to max age of targeted block

Block Data

🔗

Expression

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

Examples:

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

Block Hardness

🔗

Expression

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

Examples:

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

Block Sphere

🔗

Expression

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

Examples:

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

Blocks

🔗

Expression

Patterns:
Since: 1.0, 2.5.1 (within/cuboid/chunk)
Return Type: Block
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.

Examples:

loop blocks above the player:
loop blocks between the block below the player and the targeted block:
set the blocks below the player, the victim and the targeted block to air
set all blocks within {loc1} and {loc2} to stone
set all blocks within chunk at player to air

Blocks in Region

🔗

Expression

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

Examples:

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

Book Author

🔗

Expression

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

Examples:

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

Book Pages

🔗

Expression

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

Examples:

on book sign:
    message "Book Pages: %pages of event-item%"
    message "Book Page 1: %page 1 of event-item%"

Book Title

🔗

Expression

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

Examples:

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

Burn/Cook Time

🔗

Expression

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

Examples:

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

Case Text

🔗

Expression

Patterns:
  • %texts% in (upper|lower)[ ]case
  • (upper|lower)[ ]case %texts%
  • capitali(s|z)ed %texts%
  • %texts% in [(lenient|strict) ](proper|title)[ ]case
  • [(lenient|strict) ](proper|title)[ ]case %texts%
  • %texts% in [(lenient|strict) ]camel[ ]case
  • [(lenient|strict) ]camel[ ]case %texts%
  • %texts% in [(lenient|strict) ]pascal[ ]case
  • [(lenient|strict) ]pascal[ ]case %texts%
  • %texts% in [(lower|upper|capital|screaming)[ ]]snake[ ]case
  • [(lower|upper|capital|screaming)[ ]]snake[ ]case %texts%
  • %texts% in [(lower|upper|capital)[ ]]kebab[ ]case
  • [(lower|upper|capital)[ ]]kebab[ ]case %texts%
Since: 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases)
Return Type: Text
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case

Examples:

"Oops!" in lowercase # oops!
"oops!" in uppercase # OOPS!
"hellO i'm steve!" in proper case # HellO I'm Steve!
"hellO i'm steve!" in strict proper case # Hello I'm Steve!
"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()
"spAwn neW boSs ()" in strict camel case # spawnNewBoss()
"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()
"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()
"Hello Player!" in snake case # Hello_Player!
"Hello Player!" in lower snake case # hello_player!
"Hello Player!" in upper snake case # HELLO_PLAYER!
"What is your name?" in kebab case # What-is-your-name?
"What is your name?" in lower kebab case # what-is-your-name?
"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?

Chat Format

🔗

Expression

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

Examples:

set the chat format to "<yellow>[player]<light gray>: <green>[message]"

Chat Recipients

🔗

Expression

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

Examples:

chat recipients

Chunk

🔗

Expression

Patterns:
Since: 2.0
Return Type: Chunk
The chunk a block, location or entity is in.

Examples:

add the chunk at the player to {protected chunks::*}

Clicked Block/Entity/Inventory/Slot

🔗

Expression

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

Examples:

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

Color of

🔗

Expression

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

Examples:

on click on wool:
    message "This wool block is <%color of block%>%color of block%!"
    set the color of the block to black

Colored / Uncolored

🔗

Expression

Patterns:
  • (colo[u]r-|colo[u]red )%texts%
  • (format-|formatted )%texts%
  • (un|non)[-](colo[u]r-|colo[u]red |format-|formatted )%texts%
Since: 2.0
Return Type: Text
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.

Examples:

on chat:
    set message to colored message # Safe; only colors get parsed
command /fade <player>:
    trigger:
        set display name of the player-argument to uncolored display name of the player-argument
command /format <text>:
    trigger:
        message formatted text-argument # Safe, because we're sending to whoever used this command

Command

🔗

Expression

Patterns:
  • [the] (full|complete|whole) command
  • [the] command [label]
  • [the] arguments
Since: 2.0
Usable in events: command
Return Type: Text
The command that caused an 'on command' event (excluding the leading slash and all arguments)

Examples:

# prevent any commands except for the /exit command during some game
on command:
    if {game::%player%::playing} is true:
        if the command is not "exit":
            message "You're not allowed to use commands during the game"
            cancel the event

Command Info

🔗

Expression

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

Examples:

main name of command "skript"
description of command "help"
label of command "pl"
usage of command "help"
aliases of command "bukkit:help"
permission of command "/op"
command "op"'s permission message
command "sk"'s plugin owner

Command Sender

🔗

Expression

Patterns:
  • [the] [command['s]] (sender|executor)
Since: 2.0
Usable in events: command
Return Type: Command Sender
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%

Examples:

make the command sender execute "/say hi!"
on command:
    log "%executor% used command /%command% %arguments%" to "commands.log"

Compass Target

🔗

Expression

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

Examples:

# make all player's compasses target a player stored in {compass::target::%player%}
every 5 seconds:
    loop all players:
        set the loop-player's compass target to location of {compass::target::%%loop-player%}

Console

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])
  • [the] last usage [date] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
Since: 2.2-dev33
Return Type: Object
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.

Examples:

command /home:
    cooldown: 10 seconds
    cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
    trigger:
        teleport player to {home::%player%}

Coordinate

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] [event-]<.+>
Since: 1.0
Return Type: Entity
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.

Examples:

give a diamond sword of sharpness 3 to the player
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow

Cursor Slot

🔗

Expression

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

Examples:

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

Custom Chest Inventory

🔗

Expression

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

Examples:

open chest inventory with 1 row named "test" to player
set {_inventory} to chest inventory with 1 row

Custom Model Data

🔗

Expression

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

Examples:

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

Damage

🔗

Expression

Patterns:
  • [the] damage
Since: 1.3.5
Usable in events: damage
Return Type: Number
How much damage is done in a damage event, possibly ignoring armour, criticals and/or enchantments. Can be changed (remember that in Skript '1' is one full heart, not half a heart).

Examples:

increase the damage by 2

Damage Cause

🔗

Expression

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

Examples:

damage cause is lava, fire or burning

Damaged Item

🔗

Expression

Patterns:
Since: 2.4
Return Type: Item Type
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks

Examples:

give player diamond sword with damage value 100
set player's tool to diamond hoe damaged by 250
give player diamond sword with damage 700 named "BROKEN SWORD"
set {_item} to diamond hoe with damage value 50 named "SAD HOE"
set target block of player to wool with data value 1
set target block of player to potato plant with data value 7

Data/Damage Value

🔗

Expression

Patterns:
Since: 1.2
Return Type: long
The data/damage value of an item/block. Data values of blocks are only supported on 1.12.2 and below. You usually don't need this expression as you can check and set items with aliases easily, but this expression can e.g. be used to "add 1 to data of <item>", e.g. for cycling through all wool colors.

Examples:

set damage value of player's tool to 10
set data value of target block of player to 3
add 1 to the data value of the clicked block
reset data value of block at player

Date Ago/Later

🔗

Expression

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

Examples:

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

Default Value

🔗

Expression

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

Examples:

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

Difference

🔗

Expression

Patterns:
Since: 1.4
Return Type: Object
The difference between two values, e.g. numbers, dates or times.

Examples:

if difference between {command::%player%::lastuse} and now is smaller than a minute:
    message "You have to wait a minute before using this command again!"

Difficulty

🔗

Expression

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

Examples:

set the difficulty of "world" to hard

Direction

🔗

Expression

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

Examples:

thrust the player upwards
set the block behind the player to water
loop blocks above the player:
    set {_rand} to a random integer between 1 and 10
    set the block {_rand} meters south east of the loop-block to stone
block in horizontal facing of the clicked entity from the player is air
spawn a creeper 1.5 meters horizontally behind the player
spawn a TNT 5 meters above and 2 meters horizontally behind the player
thrust the last spawned TNT in the horizontal direction of the player with speed 0.2
push the player upwards and horizontally forward at speed 0.5
push the clicked entity in in the direction of the player at speed -0.5
open the inventory of the block 2 blocks below the player to the player
teleport the clicked entity behind the player
grow a regular tree 2 meters horizontally behind the player

Distance

🔗

Expression

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

Examples:

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

Drops

🔗

Expression

Patterns:
  • [the] drops
Since: 1.0
Usable in events: death
Return Type: Item Type
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.

Examples:

clear drops
remove 4 planks from the drops

Drops Of Block

🔗

Expression

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

Examples:

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

Element of

🔗

Expression

Patterns:
  • ([the] first|[the] last|[a] random|%number%(st|nd|rd|th)) element [out] of %objects%
Since: 2.0
Return Type: Object
The first, last or a random element of a set, e.g. a list variable. See also: random

Examples:

give a random element out of {free items::*} to the player

Enchant Item

🔗

Expression

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

Examples:

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

Enchanting Experience Cost

🔗

Expression

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

Examples:

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

Enchantment Bonus

🔗

Expression

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

Examples:

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

Enchantment Level

🔗

Expression

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

Examples:

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

Enchantment Offer

🔗

Expression

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

Examples:

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

Enchantment Offer Cost

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.11 or newer
Return Type: long
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.

Examples:

set cost of enchantment offer 1 to 50

Ender Chest

🔗

Expression

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

Examples:

open the player's ender chest to the player

Entities

🔗

Expression

Patterns:
Since: 1.2.1, 2.5 (chunks)
Return Type: Entity
All entities in all worlds, in a specific world, in a chunk or in a radius around a certain location, e.g. all players, all creepers in the player's world, or players in radius 100 of the player.

Examples:

kill all creepers in the player's world
send "Psst!" to all players within 100 meters of the player
give a diamond to all ops
heal all tamed wolves in radius 2000 around {town center}
delete all monsters in chunk at player

Entity AI

🔗

Expression

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

Examples:

set artificial intelligence of target entity to false

Entity Attribute

🔗

Expression

Patterns:
Since: 2.5, 2.6.1 (final attribute value)
Return Type: Number
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.

Examples:

on damage of player:
    send "You are wounded!"
    set victim's attack speed attribute to 2

Entity Owner

🔗

Expression

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

Examples:

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

Exhaustion

🔗

Expression

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

Examples:

set exhaustion of all players to 1

Experience

🔗

Expression

Patterns:
  • [the] [(spawned|dropped)] [e]xp[erience] [orb[s]]
Since: 2.1, 2.5.3 (block break event)
Usable in events: experience spawn, break / mine
Return Type: Experience
How much experience was spawned in an experience spawn or block break event. Can be changed.

Examples:

on experience spawn:
    add 5 to the spawned experience
on break of coal ore:
    clear dropped experience
on break of diamond ore:
    if tool of player = diamond pickaxe:
        add 100 to dropped experience

Exploded Blocks

🔗

Expression

Patterns:
  • [the] exploded blocks
Since: 2.5
Usable in events: explode
Return Type: Block
Get all the blocks that were destroyed in an explode event

Examples:

on explode:
    loop exploded blocks:
        add loop-block to {exploded::blocks::*}

Explosion Block Yield

🔗

Expression

Patterns:
  • [the] [explosion['s]] block (yield|amount)
  • [the] percentage of blocks dropped
Since: 2.5
Usable in events: explosion
Return Type: Number
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.

Examples:

on explode:
set the explosion's block yield to 10%

Explosion Yield

🔗

Expression

Patterns:
  • [the] explosion (yield|radius|size)
  • [the] (yield|radius|size) of [the] explosion
Since: 2.5
Usable in events: explosion prime
Return Type: Number
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information

Examples:

on explosion prime:
    set the yield of the explosion to 10

Explosive Yield

🔗

Expression

Patterns:
  • [the] explosive (yield|radius|size) of %entities%
  • %entities%'[s] explosive (yield|radius|size)
Since: 2.5
Requirements: Minecraft 1.12 or newer for creepers
Return Type: Number
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information

Examples:

on spawn of a creeper:
    set the explosive yield of the event-entity to 10

Facing

🔗

Expression

Patterns:
Since: 1.4
Return Type: Direction
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')

Examples:

# makes a bridge
loop blocks from the block below the player in the horizontal facing of the player:
    set loop-block to cobblestone

Fall Distance

🔗

Expression

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

Examples:

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

Fertilized Blocks

🔗

Expression

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

Examples:

the fertilized blocks

Filter

🔗

Expression

Patterns:
  • %objects% (where|that match) \[<.+>\]
Since: 2.2-dev36
Return Type: Object
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.

Examples:

send "congrats on being staff!" to all players where [player input has permission "staff"]

Filter Input

🔗

Expression

Patterns:
  • input
  • %*type% input
Since: 2.2-dev36
Return Type: Object
Represents the input in a filter expression. 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.

Examples:

send "congrats on being staff!" to all players where [input has permission "staff"]

Final Damage

🔗

Expression

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

Examples:

send "%final damage%" to victim

Firework Effect

🔗

Expression

Patterns:
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors%
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors% fad(e|ing) [to] %colors%
Since: 2.4
Return Type: Firework Effect
Represents a 'firework effect' which can be used in the launch firework effect.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Flight Mode

🔗

Expression

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

Examples:

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

Food Level

🔗

Expression

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

Examples:

set the player's food level to 10

Formatted Date

🔗

Expression

Patterns:
  • %dates% formatted [human-readable] [(with|as) %text%]
Since: 2.2-dev31
Return Type: Text
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.

Examples:

now formatted human-readable

Former/Future State

🔗

Expression

Patterns:
  • [the] (former|past|old) [state] [of] %~object%
  • %~object% before [the event]
  • [the] (future|to-be|new) [state] [of] %~object%
  • %~object%(-to-be| after[(wards| the event)])
Since: 1.1
Return Type: Object
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.

Examples:

on teleport:
    former world was "world_nether" # or 'world was'
    world will be "world" # or 'world after the event is'
on tool change:
    past tool is an axe
    the tool after the event will be air
on weather change:
    set {weather::%world%::old} to past weather
    set {weather::%world%::current} to the new weather

Furnace Slot

🔗

Expression

Patterns:
  • (fuel|result) [slot]
  • (ore|fuel|result)[s] [slot[s]] of %blocks%
  • %blocks%'[s] (ore|fuel|result)[s] [slot[s]]
Since: 1.0
Usable in events: smelt, fuel burn
Return Type: Inventory Slot
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not 'furnace', as 'furnace' is not an existing expression.

Examples:

set the fuel slot of the clicked block to a lava bucket
set the block's ore slot to 64 iron ore
give the result of the block to the player
clear the result slot of the block

Game Mode

🔗

Expression

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

Examples:

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

Gamerule Value

🔗

Expression

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

Examples:

set the gamerule commandBlockOutput of world "world" to false

Gliding State

🔗

Expression

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

Examples:

set gliding of player to off

Glowing

🔗

Expression

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

Examples:

set glowing of player to true

Gravity

🔗

Expression

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

Examples:

set gravity of player off

Group

🔗

Expression

Patterns:
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: Text
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed.

Examples:

on join:
    broadcast "%group of player%" # this is the player's primary group
    broadcast "%groups of player%" # this is all of the player's groups

Hanging Entity/Remover

🔗

Expression

Patterns:
  • [the] hanging (entity|remover)
Since: 2.6.2
Return Type: Entity
Returns the hanging entity or remover in hanging break and place events.

Examples:

on break of item frame:
    if item of hanging entity is diamond pickaxe:
        cancel event
        if hanging remover is a player:
            send "You can't break that item frame!" to hanging remover

Hash

🔗

Expression

Patterns:
  • %texts% hash[ed] with (MD5|SHA-256)
Since: 2.0, 2.2-dev32 (SHA-256 algorithm)
Return Type: Text
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.

MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!

Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.

Examples:

command /setpass <text>:
    trigger:
        set {password::%uuid of player%} to text-argument hashed with SHA-256
command /login <text>:
    trigger:
        if text-argument hashed with SHA-256 is {password::%uuid of player%}:
            message "Login successful."
        else:
            message "Wrong password!"

Head location

🔗

Expression

Patterns:
Since: 2.0
Return Type: Location
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.

Examples:

set the block at the player's head to air
set the block in front of the player's eyes to glass
loop blocks in front of the player's head:

Heal Amount

🔗

Expression

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

Examples:

increase heal amount by 2
remove 0.5 from heal amount

Heal Reason

🔗

Expression

Patterns:
  • (regen|health regain|heal) (reason|cause)
Since: 2.5
Return Type: Heal Reason
The heal reason of a heal event. Please click on the link for more information.

Examples:

on heal:
    if heal reason = satiated:
        send "You ate enough food and gained health back!" to player

Health

🔗

Expression

Patterns:
Since: 1.0
Usable in events: damage
Return Type: Number
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).

Examples:

message "You have %health% HP left."

Hidden Players

🔗

Expression

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

Examples:

message "<light red>You are currently hiding: <light gray>%hidden players of the player%"

Highest Solid Block

🔗

Expression

Patterns:
  • highest [(solid|non-air)] block at %locations%
Since: 2.2-dev34
Return Type: Block
Returns the highest solid block at the x and z coordinates of the world of a given location.

Examples:

highest block at location of arg-player

Hostname

🔗

Expression

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

Examples:

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

Hotbar Button

🔗

Expression

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

Examples:

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

Hotbar Slot

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] hotbar slot of %players%
  • %players%'[s] [([currently] selected|current)] hotbar slot
Since: 2.2-dev36
Return Type: Inventory Slot
The currently selected hotbar slot. To retrieve its number use Slot Index expression.

Examples:

message "%player's current hotbar slot%"
set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left

Hover List

🔗

Expression

Patterns:
  • [the] [custom] [(player|server)] (hover|sample) ([message] list|message)
  • [the] [custom] player [(hover|sample)] list
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: Text
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.

Examples:

on server list ping:
    clear the hover list
    add "&aWelcome to the &6Minecraft &aserver!" to the hover list
    add "" to the hover list # A blank line
    add "&cThere are &6%online players count% &conline players!" to the hover list

Humidity

🔗

Expression

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

Examples:

set {_humidity} to event-block's humidity

IP

🔗

Expression

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

Examples:

ban the IP address of the player
broadcast "Banned the IP %IP of player%"

on connect:
    log "[%now%] %player% (%ip%) is connected to the server."

on server list ping:
    send "%IP-address%" to the console

Id

🔗

Expression

Patterns:
Since: 1.0
Return Type: long
The id of a specific item. You usually don't need this expression as you can likely do everything with aliases.

Examples:

message "the ID of %type of the clicked block% is %id of the clicked block%."

Index Of

🔗

Expression

Patterns:
  • [the] [(first|last)] index of %text% in %text%
Since: 2.1
Return Type: long
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.

Examples:

set {_first} to the first index of "@" in the text argument
if {_s} contains "abc":
    set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}

Indices of List

🔗

Expression

Patterns:
  • [(the|all [[of] the])] (indexes|indices) of %~objects%
  • %~objects%'[s] (indexes|indices)
  • [sorted] (indices|indexes) of %~objects% in (ascending|descending) order
  • [sorted] %~objects%'[s] (indices|indexes) in (ascending|descending) order
Since: 2.4 (indices), 2.6.1 (sorting)
Return Type: Text
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.

Examples:

set {l::*} to "some", "cool" and "values"
broadcast "%indices of {l::*}%" # result is 1, 2 and 3

set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first

Inventory

🔗

Expression

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

Examples:

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

Inventory Action

🔗

Expression

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

Examples:

inventory action is pickup all

Inventory Holder/Viewers/Rows/Slots

🔗

Expression

Patterns:
  • (holder[s]|viewers|[amount of] rows|[amount of] slots) of %inventories%
  • %inventories%'[s] (holder[s]|viewers|[amount of] rows|[amount of] slots)
Since: 2.2-dev34, 2.5 (slots)
Return Type: Object
Gets the amount of rows/slots, viewers and holder of an inventory.

NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.

Examples:

event-inventory's amount of rows
holder of player's top inventory
{_inventory}'s viewers

Inventory Slot

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: Inventory Slot
Represents a slot in an inventory. It can be used to change the item in an inventory too.

Examples:

if slot 0 of player is air:
    set slot 0 of player to 2 stones
    remove 1 stone from slot 0 of player
    add 2 stones to slot 0 of player
    clear slot 1 of player

Item

🔗

Expression

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

Examples:

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

Item Amount

🔗

Expression

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

Examples:

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

Item Enchantments

🔗

Expression

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

Examples:

clear enchantments of event-item

Item of an Entity

🔗

Expression

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

Examples:

Missing examples.

Item with CustomModelData

🔗

Expression

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

Examples:

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

Item with Lore

🔗

Expression

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

Examples:

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

Items

🔗

Expression

Patterns:
  • [(all [[of] the]|the|every)] item(s|[ ]types)
  • [(all [[of] the]|the)] items of type[s] %item types%
  • [(all [[of] the]|the|every)] block(s|[ ]types)
  • [(all [[of] the]|the)] blocks of type[s] %item types%
Since: unknown (before 2.1)
Return Type: Item / Material
Items or blocks of a specific type, useful for looping.

Examples:

loop items of type ore and log:
    block contains loop-item
    message "Theres at least one %loop-item% in this block"
drop all blocks at the player # drops one of every block at the player

Items In

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
Since: 2.0
Return Type: Inventory Slot
All items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.

Examples:

loop all items in the player's inventory:
    loop-item is enchanted
    remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory

Join & Split

🔗

Expression

Patterns:
  • (concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]
  • split %text% (at|using|by) [[the] delimiter] %text%
  • %text% split (at|using|by) [[the] delimiter] %text%
  • regex split %text% (at|using|by) [[the] delimiter] %text%
  • regex %text% split (at|using|by) [[the] delimiter] %text%
Since: 2.1, 2.5.2 (regex support)
Return Type: Text
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.

Examples:

message "Online players: %join all players with "" | ""%" # %all players% would use the default "x, y, and z"
set {_s::*} to the string argument split at ","

Language

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%
  • %players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]
Since: 2.3
Return Type: Text
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.

Examples:

message player's current language

Last Attacker

🔗

Expression

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

Examples:

send "%last attacker of event-entity%"

Last Color

🔗

Expression

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

Examples:

set {_color} to the last colors of "heyyo"

Last Damage

🔗

Expression

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

Examples:

set last damage of event-entity to 2

Last Damage Cause

🔗

Expression

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

Examples:

set last damage cause of event-entity to fire tick

Last Loaded Server Icon

🔗

Expression

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

Examples:

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

Last Resource Pack Response

🔗

Expression

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

Examples:

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

Last Spawned Entity

🔗

Expression

Patterns:
  • [the] [last[ly]] (spawned|shot) %*entity type%
  • [the] [last[ly]] dropped (item)
Since: 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item)
Return Type: Entity
Holds the entity that was spawned most recently with the spawn effect, drop with the drop effect or shot with the shoot effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.

Examples:

spawn a priest
set {healer::%spawned priest%} to true
shoot an arrow from the last spawned entity
ignite the shot projectile
drop a diamond sword
push last dropped item upwards

Last/First Login Time

🔗

Expression

Patterns:
Since: 2.5
Return Type: Date
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.

Examples:

command /onlinefor:
    trigger:
        send "You have been online for %difference between player's last login and now%."
        send "You first joined the server %difference between player's first login and now% ago."

Leash Holder

🔗

Expression

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

Examples:

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

Length

🔗

Expression

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

Examples:

set {_l} to length of the string argument

Level

🔗

Expression

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

Examples:

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

Level Progress

🔗

Expression

Patterns:
Since: 2.0
Usable in events: level change
Return Type: Number
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.

Examples:

# use the exp bar as mana
on rightclick with a blaze rod:
    player's level progress is larger than 0.2
    shoot a fireball from the player
    reduce the player's level progress by 0.2
every 2 seconds:
    loop all players:
        level progress of loop-player is smaller than 0.9:
            increase level progress of the loop-player by 0.1
        else:
            set level progress of the loop-player to 0.99
on xp spawn:
    cancel event

Light Level

🔗

Expression

Patterns:
Since: 1.3.4
Return Type: byte
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.

Examples:

# set vampire players standing in bright sunlight on fire
every 5 seconds:
    loop all players:
        {vampire::%uuid of loop-player%} is true
        sunlight level at the loop-player is greater than 10
        ignite the loop-player for 5 seconds

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

Patterns:
Since: Unknown
Return Type: Location
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.

Examples:

set {home::%uuid of player%} to the location of the player
message "You home was set to %player's location% in %player's world%."

Location At

🔗

Expression

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

Examples:

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

Loop value

🔗

Expression

Patterns:
  • [the] loop-<.+>
Since: 1.0
Return Type: Object
The currently looped value.

Examples:

# countdown:
loop 10 times:
    message "%11 - loop-number%"
    wait a second
# generate a 10x10 floor made of randomly colored wool below the player:
loop blocks from the block below the player to the block 10 east of the block below the player:
    loop blocks from the loop-block to the block 10 north of the loop-block:
        set loop-block-2 to any wool

Lore

🔗

Expression

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

Examples:

set the 1st line of the item's lore to "<orange>Excalibur 2.0"

MOTD

🔗

Expression

Patterns:
  • [the] [(default)|(shown|displayed)] (MOTD|message of [the] day)
Since: 2.3
Return Type: Text
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.

Examples:

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

Max Durability

🔗

Expression

Patterns:
Since: 2.5
Return Type: long
The maximum durability of an item.

Examples:

maximum durability of diamond sword
if max durability of player's tool is not 0: # Item is damageable

Max Health

🔗

Expression

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

Examples:

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

Max Minecart Speed

🔗

Expression

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

Examples:

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

Max Players

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] player[s] [(count|amount|number|size)]
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] (count|amount|number|size) of players
Since: 2.3
Return Type: long
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server always and can't be changed.

Examples:

on server list ping:
    set the max players count to (online players count + 1)

Maximum Stack Size

🔗

Expression

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

Examples:

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

Me

🔗

Expression

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

Examples:

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

Mending Repair Amount

🔗

Expression

Patterns:
  • [the] [mending] repair amount
Since: 2.5.1
Return Type: long
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.

Examples:

on item mend:
    set the mending repair amount to 100

Message

🔗

Expression

Patterns:
  • [the] [chat( |-)]message
  • [the] (join|log[ ]in)( |-)message
  • [the] (quit|leave|log[ ]out|kick)( |-)message
  • [the] death( |-)message
Since: 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message)
Usable in events: chat, join, quit, death
Return Type: Text
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, or the death message on a death event. This expression is mostly useful for being changed.

Examples:

on chat:
    player has permission "admin"
    set message to "&c%message%"

on first join:
    set join message to "Welcome %player% to our awesome server!"

on join:
    player has played before
    set join message to "Welcome back, %player%!"

on quit:
    set quit message to "%player% left this awesome server!"

on death:
    set the death message to "%player% died!"

Metadata

🔗

Expression

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

Examples:

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

Middle of Location

🔗

Expression

Patterns:
  • [the] (middle|center) [point] of %location%
  • %location%'[s] (middle|center) [point]
Since: 2.6.1
Return Type: Location
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.

Examples:

command /stuck:
    executable by: players
    trigger:
        teleport player to the center of player's location
        send "You're no longer stuck."

Minecart Derailed / Flying Velocity

🔗

Expression

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

Examples:

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

Money

🔗

Expression

Patterns:
Since: 2.0, 2.5 (offline player support)
Requirements: Vault, an economy plugin that supports Vault
Return Type: Money
How much virtual money a player has (can be changed). This expression requires Vault and a compatible economy plugin to be installed.

Examples:

message "You have %player's money%" # the currency name will be added automatically
remove 20$ from the player's balance # replace '$' by whatever currency you use
add 200 to the player's account # or omit the currency alltogether

Moved blocks

🔗

Expression

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

Examples:

the moved blocks

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: Text
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
  • [the] ((player|tab)[ ]list name[s]) of %players%
  • %players%'[s] ((player|tab)[ ]list name[s])
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: Text
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Named Item/Inventory

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev34 (inventories)
Return Type: Object
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.

Examples:

give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player
set tool of player to the player's tool named "<gold>Wand"
set the name of the player's tool to "<gold>Wand"
open hopper inventory named "Magic Hopper" to player

New Line

🔗

Expression

Patterns:
  • n[ew]l[ine]
  • line[ ]break
Since: 2.5
Return Type: Text
Returns a line break separator.

Examples:

send "Hello%nl%Goodbye!" to player

No Damage Ticks

🔗

Expression

Patterns:
Since: 2.5
Return Type: long
The number of ticks that an entity is invulnerable to damage for.

Examples:

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

Now

🔗

Expression

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

Examples:

broadcast "Current server time: %now%"

Number of Characters

🔗

Expression

Patterns:
  • number of upper[ ]case char(acters|s) in %text%
  • number of lower[ ]case char(acters|s) in %text%
  • number of digit char(acters|s) in %text%
Since: 2.5
Return Type: long
The number of uppercase, lowercase, or digit characters in a string.

Examples:

#Simple Chat Filter
on chat:
    if number of uppercase chars in message / length of message > 0.5
        cancel event
        send "<red>Your message has to many caps!" to player

Numbers

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%
Since: 1.4.6 (integers & numbers), 2.5.1 (decimals)
Return Type: Number
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'

Examples:

loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5
loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5
loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4

Offline players

🔗

Expression

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

Examples:

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

Online Player Count

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)
  • [the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online players
Since: 2.3
Return Type: long
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. 'real online player count' always returns the real count of online players and can't be changed.

Fake online player count requires PaperSpigot 1.12.2+.

Examples:

on server list ping:
    # This will make the max players count 5 if there are 4 players online.
    set the fake max players count to (online players count + 1)

Opened Inventory

🔗

Expression

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

Examples:

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

Parse

🔗

Expression

Patterns:
Since: 2.0
Return Type: Object
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.

Examples:

set {var} to line 1 parsed as number
on chat:
    set {var::*} to message parsed as "buying %items% for %money%"
    if parse error is set:
        message "%parse error%"
    else if {var::*} is set:
        cancel event
        remove {var::2} from the player's balance
        give {var::1::*} to the player

Parse Error

🔗

Expression

Patterns:
  • [the] [last] [parse] error
Since: 2.0
Return Type: Text
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.

Examples:

set {var} to line 1 parsed as integer
if {var} is not set:
    parse error is set:
        message "<red>Line 1 is invalid: %last parse error%"
    else:
        message "<red>Please put an integer on line 1!"

Passenger

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)
Return Type: Entity
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle

Examples:

#for 1.11 and lower
passenger of the minecart is a creeper or a cow
the saddled pig's passenger is a player
#for 1.11.2+
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat

Ping

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: long
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).

Examples:

command /ping :
    trigger:
        send "%arg-1%'s ping is %arg-1's ping%"

Plain Item

🔗

Expression

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

Examples:

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

Player List Header and Footer

🔗

Expression

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

Examples:

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

Player Protocol Version

🔗

Expression

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

Examples:

command /protocolversion <player>:
    trigger:
        send "Protocol version of %arg-1%: %protocol version of arg-1%"

Player Skull

🔗

Expression

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

Examples:

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

Player Weather

🔗

Expression

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

Examples:

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

Portal

🔗

Expression

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

Examples:

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

Potion Effect

🔗

Expression

Patterns:
  • [new] potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
  • [new] ambient potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
Since: 2.5.2
Return Type: Potion Effect
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.

Examples:

set {_p} to potion effect of speed of tier 1 without particles for 10 minutes
add {_p} to potion effects of player's tool
add {_p} to potion effects of target entity
add potion effect of speed 1 to potion effects of player

Potion Effects

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: Potion Effect
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.

Examples:

set {_p::*} to active potion effects of player
clear all the potion effects of player
clear all the potion effects of player's tool
add potion effects of player to potion effects of player's tool
add speed to potion effects of target entity
remove speed and night vision from potion effects of player

Prefix/Suffix

🔗

Expression

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

Examples:

on chat:
    cancel event
    broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world

set the player's prefix to "[<red>Admin] "

Projectile Bounce State

🔗

Expression

Patterns:
  • [the] projectile bounce (state|ability|mode) of %projectiles%
  • %projectiles%'[s] projectile bounce (state|ability|mode)
Since: 2.5.1
Return Type: Boolean
A projectile's bounce state.

Examples:

on projectile hit:
    set projectile bounce mode of event-projectile to true

Projectile Critical State

🔗

Expression

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

Examples:

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

Protocol Version

🔗

Expression

Patterns:
  • [the] [server] [(sent|required|fake)] protocol version [number]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: long
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.

This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).

Examples:

on server list ping:
    set the version string to "<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

Random

🔗

Expression

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

Examples:

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

Random Number

🔗

Expression

Patterns:
  • [a] random (integer|number) (from|between) %number% (to|and) %number%
Since: 1.4
Return Type: Number
A random number or integer between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.

Examples:

set the player's health to a random number between 5 and 10
send "You rolled a %random integer from 1 to 6%!" to the player

Random UUID

🔗

Expression

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

Examples:

set {_uuid} to random uuid

Raw Name

🔗

Expression

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

Examples:

raw name of tool of player

Redstone Block Power

🔗

Expression

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

Examples:

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

Region

🔗

Expression

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

Examples:

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

Region Members & Owners

🔗

Expression

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

Examples:

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

Regions At

🔗

Expression

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Return Type: Region
All regions at a particular location. This expression requires a supported regions plugin to be installed.

Examples:

On click on a sign:
    line 1 of the clicked block is "[region info]"
    set {_regions::*} to regions at the clicked block
    if {_regions::*} is empty:
        message "No regions exist at this sign."
    else:
        message "Regions containing this sign: <gold>%{_regions::*}%."

Remaining Air

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: Timespan
How much time a player has left underwater before starting to drown.

Examples:

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

Respawn location

🔗

Expression

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

Examples:

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

Reversed List

🔗

Expression

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

Examples:

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

Rounding

🔗

Expression

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

Examples:

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

Saturation

🔗

Expression

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

Examples:

set saturation of player to 20

Scoreboard Tags

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] scoreboard tags of %entities%
  • %entities%'[s] scoreboard tags
Since: 2.3
Return Type: Text
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.

Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).

Examples:

on spawn of a monster:
    if the spawn reason is mob spawner:
        add "spawned by a spawner" to the scoreboard tags of event-entity

on death of a monster:
    if the attacker is a player:
        if the victim doesn't have the scoreboard tag "spawned by a spawner":
            add 1$ to attacker's balance

Script Name

🔗

Expression

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

Examples:

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

Sea Level

🔗

Expression

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

Examples:

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

Server Icon

🔗

Expression

Patterns:
  • [the] [((default)|(shown|sent))] [server] icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: Server Icon
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.

Examples:

on script load:
    set {server-icons::default} to the default server icon

Shooter

🔗

Expression

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

Examples:

shooter is a skeleton

Shuffled List

🔗

Expression

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

Examples:

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

Sign Text

🔗

Expression

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

Examples:

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

Slot Index

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type: long
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.

Examples:

if index of event-slot is 10:
    send "You bought a pie!"

Sorted List

🔗

Expression

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

Examples:

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

Spawn

🔗

Expression

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

Examples:

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

Spawn Reason

🔗

Expression

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

Examples:

on spawn:
    spawn reason is reinforcements or breeding

Spawner Type

🔗

Expression

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

Examples:

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

Special Number

🔗

Expression

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

Examples:

if {_number} is NaN value:

Spectator Target

🔗

Expression

Patterns:
Since: 2.4
Return Type: Entity
Returns the entity which is followed by the camera of the player when in spectator mode.

Examples:

command /spectate :
    executable by: players
    trigger:
        set gamemode of player to spectator # otherwise below won't do anything
        set spectator target of player to arg-1
        send "Spectating %arg-1%" to player

Speed

🔗

Expression

Patterns:
  • [the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%
  • %players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speed
Since: unknown (before 2.1)
Return Type: Number
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.

Examples:

set the player's walk speed to 1
increase the argument's fly speed by 0.1

Subtext

🔗

Expression

Patterns:
  • [the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%
  • [the] (first|last) [%number%] character[s] of %texts%
  • [the] %number% (first|last) characters of %texts%
  • [the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%
Since: 2.1, 2.5.2 (character at, multiple strings support)
Return Type: Text
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).

Examples:

set {_s} to the first 5 characters of the text argument
message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console
set {_characters::*} to characters at 1, 2 and 7 in player's display name
send the last character of all players' names

TPS (ticks per second)

🔗

Expression

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

Examples:

broadcast "%tps%"

Tamer

🔗

Expression

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

Examples:

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

Target

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: Entity
For players this is the entity at the crosshair, while for mobs and experience orbs it represents the entity they are attacking/following (if any).

Examples:

on entity target:
    entity's target is a player
    send "You're being followed by an %entity%!" to target of entity

Targeted Block

🔗

Expression

Patterns:
  • [the] target[ed] block[s] [of %players%]
  • %players%'[s] target[ed] block[s]
  • [the] actual[ly] target[ed] block[s] [of %players%]
  • %players%'[s] actual[ly] target[ed] block[s]
Since: 1.0
Return Type: Block
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression.

Examples:

# A command to set the block a player looks at to a specific type:
command /setblock <material>:
    trigger:
        set targeted block to argument

Teleport Cause

🔗

Expression

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

Examples:

on teleport
    teleport cause is nether portal, end portal or end gateway

Temperature

🔗

Expression

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

Examples:

message "%temperature of the targeted block%"

Ternary

🔗

Expression

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

Examples:

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

Time

🔗

Expression

Patterns:
  • [the] time[s] [([with]in|of) %worlds%]
  • %worlds%'[s] time[s]
Since: 1.0
Return Type: Time
The time of a world.

Examples:

time in world is between 18:00 and 6:00:
    broadcast "It's night-time, watch out for monsters!"

Time Played

🔗

Expression

Patterns:
Since: 2.5
Return Type: Timespan
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu.

Examples:

set {_t} to time played of player
if player's time played is greater than 10 minutes:
    give player a diamond sword
set player's time played to 0 seconds

Time Since

🔗

Expression

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

Examples:

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

Tool

🔗

Expression

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

Examples:

player's tool is a pickaxe
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow

Type of

🔗

Expression

Patterns:
Since: 1.4, 2.5.2 (potion effect)
Return Type: Object
Type of a block, item, entity, inventory or potion effect. Types of items and blocks are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.

Examples:

on rightclick on an entity:
    message "This is a %type of clicked entity%!"

UUID

🔗

Expression

Patterns:
Since: 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs)
Return Type: Text
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!

Examples:

# prevents people from joining the server if they use the name of a player
# who has played on this server at least once since this script has been added
on login:
    if {uuid::%name of player%} exists:
        {uuid::%name of player%} is not uuid of player
        kick player due to "Someone with your name has played on this server before"
    else:
        set {uuid::%name of player%} to uuid of player

Unbreakable Items

🔗

Expression

Patterns:
Since: 2.2-dev13b
Return Type: Item Type
Creates unbreakable copies of given items.

Examples:

unbreakable iron sword #Creates unbreakable iron sword

Unix Date

🔗

Expression

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

Examples:

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

Unix Timestamp

🔗

Expression

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

Examples:

unix timestamp of now

Vectors - Angle Between

🔗

Expression

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

Examples:

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

Vectors - Arithmetic

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Arithmetic expressions for vectors.

Examples:

set {_v} to vector 1, 2, 3 // 5
set {_v} to {_v} ++ {_v}
set {_v} to {_v} ++ 5
set {_v} to {_v} -- {_v}
set {_v} to {_v} -- 5
set {_v} to {_v} ** {_v}
set {_v} to {_v} ** 5
set {_v} to {_v} // {_v}
set {_v} to {_v} // 5

Vectors - Create from XYZ

🔗

Expression

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

Examples:

set {_v} to vector 0, 1, 0

Vectors - Cross Product

🔗

Expression

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

Examples:

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

Vectors - Cylindrical Shape

🔗

Expression

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

Examples:

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

Vectors - Dot Product

🔗

Expression

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

Examples:

set {_v} to {_v2} dot {_v3}

Vectors - Length

🔗

Expression

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

Examples:

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

Vectors - Location Vector Offset

🔗

Expression

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

Examples:

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

Vectors - Normalized

🔗

Expression

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

Examples:

set {_v} to normalized {_v}

Vectors - Random Vector

🔗

Expression

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

Examples:

set {_v} to a random vector

Vectors - Spherical Shape

🔗

Expression

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

Examples:

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

Vectors - Squared Length

🔗

Expression

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

Examples:

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

Vectors - Vector Between Locations

🔗

Expression

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

Examples:

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

Vectors - Vector from Location

🔗

Expression

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

Examples:

set {_v} to vector of {_loc}

Vectors - Vector from Pitch and Yaw

🔗

Expression

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

Examples:

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

Vectors - Velocity

🔗

Expression

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

Examples:

set player's velocity to {_v}

Vectors - XYZ Component

🔗

Expression

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

Examples:

set {_v} to vector 1, 2, 3
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"

Vehicle

🔗

Expression

Patterns:
Since: 2.0
Return Type: Entity
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger

Examples:

vehicle of the player is a minecart

Version

🔗

Expression

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

Examples:

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

Version String

🔗

Expression

Patterns:
  • [the] [(shown|custom)] version [(string|text)]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: Text
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.

Examples:

on server list ping:
    set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
    set the version string to "<light green>Version: <orange>%minecraft version%"

View Distance of Client

🔗

Expression

Patterns:
  • [the] client view distance[s] of %players%
  • %players%'[s] client view distance[s]
Since: 2.5
Requirements: 1.13.2+
Return Type: long
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.

Examples:

set {_clientView} to the client view distance of player
set view distance of player to client view distance of player

Weather

🔗

Expression

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

Examples:

set weather to clear
weather in "world" is rainy

Whitelist

🔗

Expression

Patterns:
  • [the] white[ ]list
Since: 2.5.2
Return Type: Offline Player
A server's whitelist.This expression can be used to add/remove players to/from the whitelist, to enable it and disable it (set whitelist to true / set whitelist to false), and to empty it (reset whitelist)

Examples:

set whitelist to false
add all players to whitelist
reset the whitelist

World

🔗

Expression

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

Examples:

world is "world_nether"
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk

World Seed

🔗

Expression

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

Examples:

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

World from Name

🔗

Expression

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

Examples:

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

Worlds

🔗

Expression

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

Examples:

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

X Times

🔗

Expression

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

Examples:

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

X of Item

🔗

Expression

Patterns:
Since: 1.2
Return Type: Object
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.

Examples:

give level of player of pickaxes to the player

Yaw / Pitch

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev28 (vector yaw/pitch)
Return Type: Number
The yaw or pitch of a location or vector.

Examples:

log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"
set {_yaw} to yaw of player
set {_p} to pitch of target entity

Action Bar

🔗

Effect

Patterns:
  • send [the] action bar [with text] %text% to %players%
Since: 2.3
Sends an action bar message to the given player(s).

Examples:

send action bar "Hello player!" to player

Ban

🔗

Effect

Patterns:
Since: 1.4, 2.1.1 (ban reason), 2.5 (timespan)
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.

Note that banning people does not kick them from the server. Consider using the kick effect after applying a ban.

Examples:

unban player
ban "127.0.0.1"
IP-ban the player because "he is an idiot"
ban player due to "inappropriate language" for 2 days

Break Block

🔗

Effect

Patterns:
Since: 2.4
Breaks the block and spawns items as if a player had mined it

You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)

Examples:

on right click:
    break clicked block naturally
loop blocks in radius 10 around player:
    break loop-block using player's tool
loop blocks in radius 10 around player:
    break loop-block naturally using diamond pickaxe

Broadcast

🔗

Effect

Patterns:
Since: 1.0, 2.6 (broadcasting objects), 2.6.1 (using advanced formatting)
Broadcasts a message to the server.

Examples:

broadcast "Welcome %player% to the server!"
broadcast "Woah! It's a message!"

Cancel Command Cooldown

🔗

Effect

Patterns:
  • (cancel|ignore) [the] [current] [command] cooldown
  • un(cancel|ignore) [the] [current] [command] cooldown
Since: 2.2-dev34
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.

Examples:

command /nick <text>:
    executable by: players
    cooldown: 10 seconds
    trigger:
        if length of arg-1 is more than 16:
            # Makes it so that invalid arguments don't make you wait for the cooldown again
            cancel the cooldown
            send "Your nickname may be at most 16 characters."
            stop
        set the player's display name to arg-1

Cancel Drops

🔗

Effect

Patterns:
  • (cancel|clear|delete) [the] drops [of (items|[e]xp[erience][s])]
  • (cancel|clear|delete) [the] (item|[e]xp[erience]) drops
Since: 2.4
Usable in events: death, break / mine
Requirements: 1.12.2 or newer (cancelling item drops of blocks)
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.

Examples:

on death of a zombie:
    if name of the entity is "&cSpecial":
        cancel drops of items

on break of a coal ore:
    cancel the experience drops

Cancel Event

🔗

Effect

Patterns:
  • cancel [the] event
  • uncancel [the] event
Since: 1.0
Cancels the event (e.g. prevent blocks from being placed, or damage being taken).

Examples:

on damage:
    victim is a player
    victim has the permission "skript.god"
    cancel the event

Change: Set/Add/Remove/Delete/Reset

🔗

Effect

Patterns:
Since: 1.0 (set, add, remove, delete), 2.0 (remove all)
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.

Examples:

# set:
Set the player's display name to "<red>%name of player%"
set the block above the victim to lava
# add:
add 2 to the player's health # preferably use 'heal' for this
add argument to {blacklist::*}
give a diamond pickaxe of efficiency 5 to the player
increase the data value of the clicked block by 1
# remove:
remove 2 pickaxes from the victim
subtract 2.5 from {points::%uuid of player%}
# remove all:
remove every iron tool from the player
remove all minecarts from {entitylist::*}
# delete:
delete the block below the player
clear drops
delete {variable}
# reset:
reset walk speed of player
reset chunk at the targeted block

Charge Creeper

🔗

Effect

Patterns:
  • make %living entities% [a[n]] (charged|powered|((un|non[-])charged|(un|non[-])powered)) [creeper[s]]
  • (charge|power|(uncharge|unpower)) %living entities%
Since: 2.5
Charges or uncharges a creeper. A creeper is charged when it has been struck by lightning.

Examples:

on spawn of creeper:
    charge the event-entity

Color Items

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev26 (maps and potions)
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.

Examples:

dye player's helmet blue
color the player's tool red

Command

🔗

Effect

Patterns:
Since: 1.0
Executes a command. This can be useful to use other plugins in triggers.

Examples:

make player execute command "/suicide"
execute console command "/say Hello everyone!"

Connect

🔗

Effect

Patterns:
Since: 2.3
Connects a player to another bungeecord server

Examples:

connect all players to "hub"

Continue

🔗

Effect

Patterns:
  • continue [loop]
Since: 2.2-dev37, INSERT VERSION (while loops)
Skips the value currently being looped, moving on to the next value if it exists.

Examples:

loop all players:
    if loop-value does not have permission "moderator":
        continue # filter out non moderators
    broadcast "%loop-player% is a moderator!" # Only moderators get broadcast

Damage/Heal/Repair

🔗

Effect

Patterns:
Since: 1.0
Damage/Heal/Repair an entity, or item.

Examples:

damage player by 5 hearts
heal the player
repair tool of player

Delay

🔗

Effect

Patterns:
Since: 1.4
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!

Examples:

wait 2 minutes
halt for 5 minecraft hours
wait a tick

Do If

🔗

Effect

Patterns:
  • <.+> if <.+>
Since: 2.3
Execute an effect if a condition is true.

Examples:

on join:
    give a diamond to the player if the player has permission "rank.vip"

Drop

🔗

Effect

Patterns:
Since: 1.0
Drops one or more items.

Examples:

on death of creeper:
    drop 1 TNT

Enable/Disable/Reload Script File

🔗

Effect

Patterns:
  • (enable|load|reload|disable|unload) s(c|k)ript [file] %text%
Since: 2.4
Enables, disables, or reloads a script file.

Examples:

reload script "test"
enable script file "testing"
unload script file "script.sk"

Enchant/Disenchant

🔗

Effect

Patterns:
Since: 2.0
Enchant or disenchant an existing item.

Examples:

enchant the player's tool with sharpness 5
disenchant the player's tool

Equip

🔗

Effect

Patterns:
Since: 1.0
Equips an entity with some given armor. This will replace any armor that the entity is wearing.

Examples:

equip player with diamond helmet
equip player with all diamond armor

Exit

🔗

Effect

Patterns:
  • (exit|stop) [trigger]
  • (exit|stop) [(1|a|the|this)] (section|loop|conditional)
  • (exit|stop) <\d+> (section|loop|conditional)s
  • (exit|stop) all (section|loop|conditional)s
Since: unknown (before 2.1)
Exits a given amount of loops and conditionals, or the entire trigger.

Examples:

if player has any ore:
    stop
message "%player% has no ores!"
loop blocks above the player:
    loop-block is not air:
        exit 2 sections
    set loop-block to water

Explode Creeper

🔗

Effect

Patterns:
Since: 2.5
Requirements: Paper 1.13 or newer/Spigot 1.14 or newer. Ignition can be stopped on Paper 1.13 or newer.
Starts the explosion process of a creeper or instantly explodes it.

Examples:

start explosion of the last spawned creeper
stop ignition of the last spawned creeper

Explosion

🔗

Effect

Patterns:
Since: 1.0
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.

Examples:

create an explosion of force 10 at the player
create an explosion of force 0 at the victim

Feed

🔗

Effect

Patterns:
Since: 2.2-dev34
Feeds the specified players.

Examples:

feed all players
feed the player by 5 beefs

Force Attack

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes a living entity attack an entity with a melee attack.

Examples:

spawn a wolf at player's location
make last spawned wolf attack player

Force Respawn

🔗

Effect

Patterns:
Since: 2.2-dev21
Forces player(s) to respawn if they are dead. If this is called without delay from death event, one tick is waited before respawn attempt.

Examples:

on death of player:
    force event-player to respawn

Hide Player from Server List

🔗

Effect

Patterns:
  • hide %players% (in|on|from) [the] server list
  • hide %players%'[s] info[rmation] (in|on|from) [the] server list
Since: 2.3
Hides a player from the hover list and decreases the online players count (only if the player count wasn't changed before).

Examples:

on server list ping:
    hide {vanished::*} from the server list

Ignite/Extinguish

🔗

Effect

Patterns:
Since: 1.4
Lights entities on fire or extinguishes them.

Examples:

ignite the player
extinguish the player

Keep Inventory / Experience

🔗

Effect

Patterns:
  • keep [the] (inventory|items) [(and [e]xp[erience][s] [point[s]])]
  • keep [the] [e]xp[erience][s] [point[s]] [(and (inventory|items))]
Since: 2.4
Usable in events: death
Keeps the inventory or/and experiences of the dead player in a death event.

Examples:

on death of a player:
    if the victim is an op:
        keep the inventory and experiences

Kick

🔗

Effect

Patterns:
  • kick %players% [(by reason of|because [of]|on account of|due to) %text%]
Since: 1.0
Kicks a player from the server.

Examples:

on place of TNT, lava, or obsidian:
    kick the player due to "You may not place %block%!"
    cancel the event

Kill

🔗

Effect

Patterns:
Since: 1.0
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.

Examples:

kill the player
kill all creepers in the player's world
kill all endermen, witches and bats

Launch firework

🔗

Effect

Patterns:
Since: 2.4
Launch firework effects at the given location(s).

Examples:

launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Leash entities

🔗

Effect

Patterns:
Since: 2.3
Leash living entities to other entities.

Examples:

leash the player to the target entity

Lightning

🔗

Effect

Patterns:
Since: 1.4
Strike lightning at a given location. Can use 'lightning effect' to create a lightning that does not harm entities or start fires.

Examples:

strike lightning at the player
strike lightning effect at the victim

Load Server Icon

🔗

Effect

Patterns:
  • load [the] server icon (from|of) [the] [image] [file] %text%
Since: 2.3
Requirements: Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.

Examples:

on load:
    clear {server-icons::*}
    loop 5 times:
        load server icon from file "icons/%loop-number%.png"
        add the last loaded server icon to {server-icons::*}

on server list ping:
    set the icon to a random server icon out of {server-icons::*}

Locally Suppress Warning

🔗

Effect

Patterns:
  • [local[ly]] suppress [the] (conflict|variable save|[missing] conjunction[s]|starting [with] expression[s]) warning[s]
Since: 2.3
Suppresses target warnings from the current script.

Examples:

locally suppress conflict warnings
suppress the variable save warnings

Log

🔗

Effect

Patterns:
Since: 2.0
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.

Examples:

on place of TNT:
    log "%player% placed TNT in %world% at %location of block%" to "tnt/placement.log"

Make Fly

🔗

Effect

Patterns:
Since: 2.2-dev34
Forces a player to start/stop flying.

Examples:

make player fly
force all players to stop flying

Make Incendiary

🔗

Effect

Patterns:
  • make %entities% [not] incendiary
  • make %entities%'[s] explosion [not] (incendiary|fiery)
  • make [the] [event(-| )]explosion [not] (incendiary|fiery)
Since: 2.5
Sets if an entity's explosion will leave behind fire. This effect is also usable in an explosion prime event.

Examples:

on explosion prime:
    make the explosion fiery

Make Invulnerable

🔗

Effect

Patterns:
Since: 2.5
Makes an entity invulnerable/not invulnerable.

Examples:

make target entity invulnerable

Make Say

🔗

Effect

Patterns:
Since: 2.3
Forces a player to send a message to the chat. If the message starts with a slash it will force the player to use command.

Examples:

make the player say "Hello."
force all players to send the message "I love this server"

Message

🔗

Effect

Patterns:
Since: 1.0, 2.2-dev26 (advanced features), 2.5.2 (optional sender), 2.6 (sending objects)
Requirements: Minecraft 1.16.4+ for optional sender
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.

Examples:

message "A wild %player% appeared!"
message "This message is a distraction. Mwahaha!"
send "Your kill streak is %{kill streak::%uuid of player%}%." to player
if the targeted entity exists:
    message "You're currently looking at a %type of the targeted entity%!"
on chat:
    cancel event
    send "[%player%] >> %message%" to all players from player

Open Book

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.14.2+
Opens a written book to a player.

Examples:

open book player's tool to player

Open/Close Inventory

🔗

Effect

Patterns:
  • (open|show) (((crafting [table]|workbench)|chest|anvil|hopper|dropper|dispenser) [(view|window|inventory)]|%inventory/inventory type%) (to|for) %players%
  • close [the] inventory [view] (to|of|for) %players%
  • close %players%'[s] inventory [view]
Since: 2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.

Examples:

show the victim's inventory to the player
open the player's inventory for the player

Play Effect

🔗

Effect

Patterns:
Since: 2.1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.

Examples:

play wolf hearts on the clicked wolf
show mob spawner flames at the targeted block to the player

Play Sound

🔗

Effect

Patterns:
Since: 2.2-dev28, 2.4 (sound categories)
Requirements: Minecraft 1.11+ (sound categories)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

play sound "block.note_block.pling" # It is block.note.pling in 1.12.2
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
play sound "custom.music.1" in jukebox category at {speakerBlock}

Player Info Visibility

🔗

Effect

Patterns:
  • hide [all] player [related] info[rmation] [(in|on|from) [the] server list]
  • (show|reveal) [all] player [related] info[rmation] [(in|to|on|from) [the] server list]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.

Examples:

hide player info
hide player related information in the server list
reveal all player related info

Player Visibility

🔗

Effect

Patterns:
Since: 2.3
Change visibility of a player for the given players. When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.

Note: if a player was hidden and relogs, this player will be visible again.

Examples:

on join:
    if {vanished::%player's uuid%} is true:
        hide the player from all players

reveal hidden players of {_player}

Poison/Cure

🔗

Effect

Patterns:
Since: 1.3.2
Poison or cure a creature.

Examples:

poison the player
poison the victim for 20 seconds
cure the player from poison

Potion Effects

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects)
Apply or remove potion effects to/from entities.

Examples:

apply swiftness 2 to the player
remove haste from the victim
on join:
    apply potion of strength of tier {strength.%player%} to the player for 999 days
apply potion effects of player's tool to player

Push

🔗

Effect

Patterns:
Since: 1.4.6
Push entities around.

Examples:

push the player upwards
push the victim downwards at speed 0.5

PvP

🔗

Effect

Patterns:
Since: 1.3.4
Set the PvP state for a given world.

Examples:

enable PvP #(current world only)
disable PvP in all worlds

Replace

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.

Examples:

replace "" in {textvar} with "%item%"
replace every "&" with "§" in line 1
# The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well:
on chat:
    replace all "kys", "idiot" and "noob" with "****" in the message

replace all stone and dirt in player's inventory and player's top inventory with diamond

Return

🔗

Effect

Patterns:
Since: 2.2
Makes a function return a value

Examples:

function double(i: number) :: number:
    return 2 * {_i}

Send Block Change

🔗

Effect

Patterns:
Since: 2.2-dev37c, 2.5.1 (block data support)
Makes a player see a block as something it really isn't. BlockData support is only for MC 1.13+

Examples:

make player see block at player as dirt
make player see target block as campfire[facing=south]

Send Resource Pack

🔗

Effect

Patterns:
  • send [the] resource pack [from [[the] URL]] %text% to %players%
  • send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since: 2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.

The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.

The resource pack request action can be used to check status of the sent resource pack request.

Examples:

on join:
    send the resource pack from "URL" with hash "hash" to the player

Shear

🔗

Effect

Patterns:
Since: 2.0
Shears or 'un-shears' a sheep. Please note that no wool is dropped, this only sets the 'sheared' state of the sheep.

Examples:

on rightclick on a sheep holding a sword:
    shear the clicked sheep

Shoot

🔗

Effect

Patterns:
Since: 1.4
Shoots a projectile (or any other entity) from a given entity.

Examples:

shoot an arrow
make the player shoot a creeper at speed 10
shoot a pig from the creeper

Silence Entity

🔗

Effect

Patterns:
Since: 2.5
Controls whether or not an entity is silent.

Examples:

make target entity silent

Stop Server

🔗

Effect

Patterns:
  • (stop|shut[ ]down) [the] server
  • restart [the] server
Since: 2.5
Stops or restarts the server. If restart is used when the restart-script spigot.yml option isn't defined, the server will stop instead.

Examples:

stop the server
restart server

Stop Sound

🔗

Effect

Patterns:
Since: 2.4
Requirements: Minecraft 1.10.2+, Minecraft 1.11+ (sound categories)
Stops a sound from playing to the specified players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

stop sound "block.chest.open" for the player
stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player

Swing Hand

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes an entity swing their hand. This does nothing if the entity does not have an animation for swinging their hand.

Examples:

make player swing their main hand

Teleport

🔗

Effect

Patterns:
Since: 1.0
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.

Examples:

teleport the player to {homes.%player%}
teleport the attacker to the victim

Title - Reset

🔗

Effect

Patterns:
  • reset [the] title[s] [of %players%]
  • reset [the] %players%'[s] title[s]
Since: 2.3
Resets the title of the player to the default values.

Examples:

reset the titles of all players
reset the title

Title - Send

🔗

Effect

Patterns:
Since: 2.3
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.

If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.

Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.

Examples:

send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds
send title "Hi %player%" to player
send title "Loot Drop" with subtitle "starts in 3 minutes" to all players
send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second
send subtitle "Party!" to all players

Toggle

🔗

Effect

Patterns:
  • (close|turn off|de[-]activate) %blocks%
  • (toggle|switch) [[the] state of] %blocks%
  • (open|turn on|activate) %blocks%
Since: 1.4
Toggle the state of a block.

Examples:

# use arrows to toggle switches, doors, etc.
on projectile hit:
    projectile is arrow
    toggle the block at the arrow

Toggle Flight

🔗

Effect

Patterns:
  • (allow|enable) (fly|flight) (for|to) %players%
  • (disallow|disable) (fly|flight) (for|to) %players%
Since: 2.3
Toggle the flight mode of a player.

Examples:

allow flight to event-player

Tree

🔗

Effect

Patterns:
Since: 1.0
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.

Examples:

grow a tall redwood tree above the clicked block

Vectors - Rotate Around Vector

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around another vector

Examples:

rotate {_v} around vector 1, 0, 0 by 90

Vectors - Rotate around XYZ

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around x, y, or z axis by some degrees

Examples:

rotate {_v} around x-axis by 90
rotate {_v} around y-axis by 90
rotate {_v} around z-axis by 90 degrees

Vehicle

🔗

Effect

Patterns:
  • (make|let|force) %entities% [to] (ride|mount) [(in|on)] %entities/entity types%
  • (make|let|force) %entities% [to] (dismount|(dismount|leave) [(from|of)] [(any|the[ir]|his|her)] vehicle[s])
  • (eject|dismount) [(any|the)] passenger[s] (of|from) %entities%
Since: 2.0
Makes an entity ride another entity, e.g. a minecart, a saddled pig, an arrow, etc.

Examples:

make the player ride a saddled pig
make the attacker ride the victim

op/deop

🔗

Effect

Patterns:
Since: 1.0
Grant/revoke a user operator state.

Examples:

op the player
deop all players

Spawn

🔗

EffectSection

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""

Alphanumeric

🔗

Condition

Patterns:
  • %texts% (is|are) alphanumeric
  • %texts% (isn't|is not|aren't|are not) alphanumeric
Since: 2.4
Checks if the given string is alphanumeric.

Examples:

if the argument is not alphanumeric:
    send "Invalid name!"

Can Build

🔗

Condition

Patterns:
Since: 2.0
Requirements: Supported regions plugin
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.

Examples:

command /setblock <material>:
    description: set the block at your crosshair to a different type
    trigger:
        player cannot build at the targeted block:
            message "You do not have permission to change blocks there!"
            stop
        set the targeted block to argument

Can Fly

🔗

Condition

Patterns:
Since: 2.3
Whether a player is allowed to fly.

Examples:

player can fly

Can Hold

🔗

Condition

Patterns:
Since: 1.0
Tests whether a player or a chest can hold the given item.

Examples:

block can hold 200 cobblestone
player has enough space for 64 feathers

Can See

🔗

Condition

Patterns:
Since: 2.3
Checks whether the given players can see another players.

Examples:

if the player can't see the player-argument:
    message "<light red>The player %player-argument% is not online!"

Chance

🔗

Condition

Patterns:
Since: 1.0
A condition that randomly succeeds or fails. Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1.

Examples:

chance of 50%:
    drop a diamond
chance of {chance}% # {chance} between 0 and 100
chance of {chance} # {chance} between 0 and 1

Comparison

🔗

Condition

Patterns:
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above)|>) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as)|>=) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((less|smaller|lower) than|below)|<) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as)|<=) %objects%
  • [(neither)] %objects% ((is|are) (not|neither)|isn't|aren't|!=) [equal to] %objects%
  • [(neither)] %objects% (is|are|=) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (is|are) between %objects% and %objects%
  • [(neither)] %objects% (is not|are not|isn't|aren't) between %objects% and %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((was|were) (not|neither)|wasn't|weren't) [equal to] %objects%
  • [(neither)] %objects% (was|were) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (was|were) between %objects% and %objects%
  • [(neither)] %objects% (was not|were not|wasn't|weren't) between %objects% and %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((will (not|neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects%
  • [(neither)] %objects% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects%
  • [(neither)] %objects% will be between %objects% and %objects%
  • [(neither)] %objects% (will not be|won't be) between %objects% and %objects%
Since: 1.0
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.

Examples:

the clicked block is a stone slab or a double stone slab
time in the player's world is greater than 8:00
the creature is not an enderman or an ender dragon

Contains

🔗

Condition

Patterns:
Since: 1.0
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.

Examples:

block contains 20 cobblestone
player has 4 flint and 2 iron ingots
{list::*} contains 5

Damage Cause

🔗

Condition

Patterns:
  • [the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since: 2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.

Examples:

# make players use their potions of fire resistance whenever they take any kind of fire damage
on damage:
    damage was caused by lava, fire or burning
    victim is a player
    victim has a potion of fire resistance
    cancel event
    apply fire resistance to the victim for 30 seconds
    remove 1 potion of fire resistance from the victim
# prevent mobs from dropping items under certain circumstances
on death:
    entity is not a player
    damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison
    clear drops

Entity is Wet

🔗

Condition

Patterns:
Since: 2.6.1
Requirements: Paper 1.16+
Checks whether an entity is wet or not (in water, rain or a bubble column).

Examples:

if player is wet:

Entity is in Liquid

🔗

Condition

Patterns:
  • %entities% (is|are) in (water|lava|[a] bubble[ ]column|rain)
  • %entities% (isn't|is not|aren't|are not) in (water|lava|[a] bubble[ ]column|rain)
Since: 2.6.1
Requirements: Minecraft 1.16+ (in water), Paper 1.16+ (in rain, lava and bubble column)
Checks whether an entity is in rain, lava, water or a bubble column.

Examples:

if player is in rain:
if player is in water:
player is in lava:
player is in bubble column

Event Cancelled

🔗

Condition

Patterns:
  • [the] event is cancel[l]ed
  • [the] event (is not|isn't) cancel[l]ed
Since: 2.2-dev36
Checks whether or not the event is cancelled.

Examples:

on click:
    if event is cancelled:
        broadcast "no clicks allowed!"

Exists/Is Set

🔗

Condition

Patterns:
  • %~objects% (exist[s]|(is|are) set)
  • %~objects% (do[es](n't| not) exist|(is|are)(n't| not) set)
Since: 1.2
Checks whether a given expression or variable is set.

Examples:

{teams::%player's uuid%::preferred-team} is not set
on damage:
    projectile exists
    broadcast "%attacker% used a %projectile% to attack %victim%!"

Has AI

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity has AI.

Examples:

target entity has ai

Has Client Weather

🔗

Condition

Patterns:
  • %players% (has|have) [a] (client|custom) weather [set]
  • %players% (doesn't|does not|do not|don't) have [a] (client|custom) weather [set]
Since: 2.3
Checks whether the given players have a custom client weather

Examples:

if the player has custom weather:
    message "Your custom weather is %player's weather%"

Has Custom Model Data

🔗

Condition

Patterns:
  • %item types% (has|have) [custom] model data
  • %item types% (doesn't|does not|do not|don't) have [custom] model data
Since: 2.5
Requirements: 1.14+
Check if an item has a custom model data tag

Examples:

player's tool has custom model data

Has Metadata

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether a metadata holder has a metadata tag.

Examples:

if player has metadata value "healer":

Has Permission

🔗

Condition

Patterns:
Since: 1.0
Test whether a player has a certain permission.

Examples:

player has permission "skript.tree"
victim has the permission "admin":
    send "You're attacking an admin!" to attacker

Has Played Before

🔗

Condition

Patterns:
  • %offline players% [(has|have|did)] [already] play[ed] [on (this|the) server] (before|already)
  • %offline players% (has not|hasn't|have not|haven't|did not|didn't) [(already|yet)] play[ed] [on (this|the) server] (before|already|yet)
Since: 1.4, INSERT VERSION (multiple players)
Checks whether a player has played on this server before. You can also use on first join if you want to make triggers for new players.

Examples:

player has played on this server before
player hasn't played before

Has Potion

🔗

Condition

Patterns:
Since: 2.6.1
Checks whether the given living entities have specific potion effects.

Examples:

if player has potion speed:
    send "You are sonic!"

if all players have potion effects speed and haste:
    broadcast "You are ready to MINE!"

Has Resource Pack

🔗

Condition

Patterns:
  • %players% (has|have) [a] resource pack [(loaded|installed)]
  • %players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since: 2.4
Requirements: Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.

Examples:

if the player has a resource pack loaded:

Has Scoreboard Tag

🔗

Condition

Patterns:
  • %entities% (has|have) [the] score[ ]board tag[s] %texts%
  • %entities% (doesn't|does not|do not|don't) have [the] score[ ]board tag[s] %texts%
Since: 2.3
Checks whether the given entities has the given scoreboard tags.

Examples:

if the targeted armor stand has the scoreboard tag "test tag":

Ignition Process

🔗

Condition

Patterns:
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) going to explode
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) in the (ignition|explosion) process
  • creeper[s] %living entities% ((is|are)|(isn't|is not|aren't|are not)) ignited
Since: 2.5
Requirements: Paper 1.13 or newer
Checks if a creeper is going to explode.

Examples:

if the last spawned creeper is going to explode:
    loop all players in radius 3 of the last spawned creeper
        send "RUN!!!" to the loop-player

Is Alive

🔗

Condition

Patterns:
  • %entities% (is|are) (alive|dead)
  • %entities% (isn't|is not|aren't|are not) (alive|dead)
Since: 2.0, 2.4-alpha4 (non-living entity support)
Checks whether an entity is alive. Works for non-living entities too.

Examples:

if {villager-buddy::%player's uuid%} is not dead:

on shoot:
    while the projectile is alive:

Is Banned

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player or IP is banned.

Examples:

player is banned
victim is not IP-banned
"127.0.0.1" is banned

Is Block

🔗

Condition

Patterns:
  • %item types% (is|are) ([a] block|blocks)
  • %item types% (isn't|is not|aren't|are not) ([a] block|blocks)
Since: 2.4
Checks whether an item is a block.

Examples:

player's held item is a block
{list::*} are blocks

Is Block Redstone Powered

🔗

Condition

Patterns:
  • %blocks% (is|are) redstone powered
  • %blocks% (is|are) indirectly redstone powered
  • %blocks% (is|are)(n't| not) redstone powered
  • %blocks% (is|are)(n't| not) indirectly redstone powered
Since: 2.5
Checks if a block is indirectly or directly powered by redstone

Examples:

if clicked block is redstone powered:
    send "This block is well-powered by redstone!"
if clicked block is indirectly redstone powered:
    send "This block is indirectly redstone powered."

Is Blocking

🔗

Condition

Patterns:
  • %players% (is|are) (blocking|defending) [with [a] shield]
  • %players% (isn't|is not|aren't|are not) (blocking|defending) [with [a] shield]
Since: unknown (before 2.1)
Checks whether a player is blocking with their shield.

Examples:

on damage of player:
    victim is blocking
    damage attacker by 0.5 hearts

Is Burning

🔗

Condition

Patterns:
  • %entities% (is|are) (burning|ignited|on fire)
  • %entities% (isn't|is not|aren't|are not) (burning|ignited|on fire)
Since: 1.4.4
Checks whether an entity is on fire, e.g. a zombie due to being in sunlight, or any entity after falling into lava.

Examples:

# increased attack against burning targets
victim is burning:
    increase damage by 2

Is Charged

🔗

Condition

Patterns:
Since: 2.5
Checks if a creeper is charged (powered).

Examples:

if the last spawned creeper is charged:
    broadcast "A charged creeper is at %location of last spawned creeper%"

Is Edible

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is edible.

Examples:

steak is edible
player's tool is edible

Is Empty

🔗

Condition

Patterns:
Since: unknown (before 2.1)
Checks whether an inventory, an inventory slot, or a text is empty.

Examples:

player's inventory is empty

Is Enchanted

🔗

Condition

Patterns:
Since: 1.4.6
Checks whether an item is enchanted.

Examples:

tool of the player is enchanted with efficiency 2
helm, chestplate, leggings or boots are enchanted

Is Flammable

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is flammable.

Examples:

wood is flammable
player's tool is flammable

Is Flying

🔗

Condition

Patterns:
  • %players% (is|are) flying
  • %players% (isn't|is not|aren't|are not) flying
Since: 1.4.4
Checks whether a player is flying.

Examples:

player is not flying

Is Fuel

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11.2+
Checks whether an item can be used as fuel in a furnace.

Examples:

on right click on furnace:
    if player's tool is not fuel:
        send "Please hold a valid fuel item in your hand"
        cancel event

Is Holding

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is holding a specific item. Cannot be used with endermen, use 'entity is [not] an enderman holding <item type>' instead.

Examples:

player is holding a stick
victim isn't holding a sword of sharpness

Is Incendiary

🔗

Condition

Patterns:
  • %entities% ((is|are) incendiary|cause[s] a[n] (incendiary|fiery) explosion)
  • %entities% ((is not|are not|isn't|aren't) incendiary|(does not|do not|doesn't|don't) cause[s] a[n] (incendiary|fiery) explosion)
  • the [event(-| )]explosion (is|(is not|isn't)) (incendiary|fiery)
Since: 2.5
Checks if an entity will create fire when it explodes. This condition is also usable in an explosion prime event.

Examples:

on explosion prime:
    if the explosion is fiery:
        broadcast "A fiery explosive has been ignited!"

Is Interactable

🔗

Condition

Patterns:
Since: 2.5.2
Requirements: Minecraft 1.13+
Checks wether or not a block is interactable.

Examples:

on block break:
    if event-block is interactable:
        cancel event
        send "You cannot break interactable blocks!"

Is Invulnerable

🔗

Condition

Patterns:
  • %entities% (is|are) invulnerable
  • %entities% (isn't|is not|aren't|are not) invulnerable
Since: 2.5
Checks whether an entity is invulnerable.

Examples:

target entity is invulnerable

Is Leashed

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently leashed.

Examples:

target entity is leashed

Is Loaded

🔗

Condition

Patterns:
Since: 2.3, 2.5 (revamp with chunk at location/coords)
Checks whether or not a chunk/world is loaded. 'chunk at 1, 1' uses chunk coords, which are location coords divided by 16.

Examples:

if chunk at {home::%player's uuid%} is loaded:
if chunk 1, 10 in world "world" is loaded:
if world("lobby") is loaded:

Is Member/Owner of Region

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.

Examples:

on region enter:
    player is the owner of the region
    message "Welcome back to %region%!"
    send "%player% just entered %region%!" to all members of the region

Is Normalized

🔗

Condition

Patterns:
  • %vectors% (is|are) normalized
  • %vectors% (isn't|is not|aren't|are not) normalized
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a vector is normalized i.e. length of 1

Examples:

vector of player's location is normalized

Is Occluding

🔗

Condition

Patterns:
Since: 2.5.1
Checks whether an item is a block and completely blocks vision.

Examples:

player's tool is occluding

Is Online

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player is online.

Examples:

player is online
player-argument is offline

Is Passable

🔗

Condition

Patterns:
  • %blocks% (is|are) passable
  • %blocks% (isn't|is not|aren't|are not) passable
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.

Examples:

if player's targeted block is passable

Is Plugin Enabled

🔗

Condition

Patterns:
  • plugin[s] %texts% (is|are) enabled
  • plugin[s] %texts% (is|are)(n't| not) enabled
  • plugin[s] %texts% (is|are) disabled
Since: 2.6
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.

Examples:

if plugin "Vault" is enabled:
if plugin "WorldGuard" is not enabled:
if plugins "Essentials" and "Vault" are enabled:
if plugin "MyBrokenPlugin" is disabled:

Is Poisoned

🔗

Condition

Patterns:
Since: 1.4.4
Checks whether an entity is poisoned.

Examples:

player is poisoned:
    cure the player from poison
    message "You have been cured!"

Is Riding

🔗

Condition

Patterns:
Since: 2.0
Tests whether an entity is riding another or is in a vehicle.

Examples:

player is riding a saddled pig

Is Riptiding

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently using the Riptide enchantment.

Examples:

target entity is riptiding

Is Script Loaded

🔗

Condition

Patterns:
  • script[s] [%texts%] (is|are) loaded
  • script[s] [%texts%] (isn't|is not|aren't|are not) loaded
Since: 2.2-dev31
Check if the current script, or another script, is currently loaded.

Examples:

script is loaded
script "example.sk" is loaded

Is Silent

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity is silent i.e. its sounds are disabled.

Examples:

target entity is silent

Is Sleeping

🔗

Condition

Patterns:
  • %players% (is|are) sleeping
  • %players% (isn't|is not|aren't|are not) sleeping
Since: 1.4.4
Checks whether a player is sleeping.

Examples:

# cut your enemies' throats in their sleep >=)
on attack:
    attacker is holding a sword
    victim is sleeping
    increase the damage by 1000

Is Slime Chunk

🔗

Condition

Patterns:
  • %chunk% (is|are) ([a] slime chunk|slime chunks|slimey)
  • %chunk% (isn't|is not|aren't|are not) ([a] slime chunk|slime chunks|slimey)
Since: 2.3
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.

Examples:

command /slimey:
    trigger:
        if chunk at player is a slime chunk:
            send "Yeah, it is!"
        else:
            send "Nope, it isn't"

Is Sneaking

🔗

Condition

Patterns:
  • %players% (is|are) sneaking
  • %players% (isn't|is not|aren't|are not) sneaking
Since: 1.4.4
Checks whether a player is sneaking.

Examples:

# prevent mobs from seeing sneaking players if they are at least 4 meters apart
on target:
    target is sneaking
    distance of target and the entity is bigger than 4
    cancel the event

Is Solid

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is solid.

Examples:

grass block is solid
player's tool isn't solid

Is Sprinting

🔗

Condition

Patterns:
  • %players% (is|are) sprinting
  • %players% (isn't|is not|aren't|are not) sprinting
Since: 1.4.4
Checks whether a player is sprinting.

Examples:

player is not sprinting

Is Swimming

🔗

Condition

Patterns:
Since: 2.3
Requirements: 1.13 or newer
Checks whether a living entity is swimming.

Examples:

player is swimming

Is Tameable

🔗

Condition

Patterns:
Since: 2.5
Check if an entity is tameable.

Examples:

on damage:
    if victim is tameable:
        cancel event

Is Transparent

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.

Examples:

player's tool is transparent.

Is Unbreakable

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11+
Checks whether an item is unbreakable.

Examples:

if event-item is unbreakable

Is Wearing

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is wearing some armour.

Examples:

player is wearing an iron chestplate and iron leggings
player is wearing all diamond armour

Is Whitelisted

🔗

Condition

Patterns:
  • [the] server (is|is(n't| not)) white[ ]listed
  • %players% (is|are)[(n't| not)] white[ ]listed
Since: 2.5.2
Whether or not the server or a player is whitelisted.

Examples:

if server is whitelisted:
if player is whitelisted

Is a Skript command

🔗

Condition

Patterns:
  • %text% (is|are) [a] s(k|c)ript (command|cmd)
  • %text% (isn't|is not|aren't|are not) [a] s(k|c)ript (command|cmd)
Since: 2.6
Checks whether a command/string is a custom Skript command.

Examples:

# Example 1
on command:
    command is a skript command

# Example 2
"sometext" is a skript command

Is in World

🔗

Condition

Patterns:
Since: 1.4
Checks whether an entity is in a specific world.

Examples:

player is in "world"
argument isn't in world "world_nether"
the player is in the world of the victim

Is of Type

🔗

Condition

Patterns:
Since: 1.4
Checks whether an item of an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').

Examples:

tool is of type {selected type}
victim is of type {villager type}

Is on Ground

🔗

Condition

Patterns:
  • %entities% (is|are) on [the] ground
  • %entities% (isn't|is not|aren't|are not) on [the] ground
Since: 2.2-dev26
Checks whether an entity is on ground.

Examples:

player is not on ground

Matches

🔗

Condition

Patterns:
  • %texts% (match[es]|do[es](n't| not) match) %texts%
  • %texts% (partially match[es]|do[es](n't| not) partially match) %texts%
Since: 2.5.2
Checks whether the defined strings match the input regexes (Regular expressions).

Examples:

on chat:
    if message partially matches "\d":
        send "Message contains a digit!"
    if message doesn't match "[A-Za-z]+":
        send "Message doesn't only contain letters!"

Projectile Can Bounce

🔗

Condition

Patterns:
Since: 2.5.1
Whether or not a projectile can bounce.

Examples:

on shoot:
    send "Boing!" to all players if projectile can bounce

PvP

🔗

Condition

Patterns:
  • (is PvP|PvP is) enabled [in %worlds%]
  • (is PvP|PvP is) disabled [in %worlds%]
Since: 1.3.4
Checks the PvP state of a world.

Examples:

PvP is enabled
PvP is disabled in "world"

Region Contains

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a location is contained in a particular region. This condition requires a supported regions plugin to be installed.

Examples:

player is in the region {regions::3}

on region enter:
    region contains {flags.%world%.red}
    message "The red flag is near!"

Resource Pack

🔗

Condition

Patterns:
Since: 2.4
Usable in events: resource pack request response
Checks state of the resource pack in a resource pack request response event.

Examples:

on resource pack response:
    if the resource pack wasn't accepted:
        kick the player due to "You have to install the resource pack to play in this server!"

Starts/Ends With

🔗

Condition

Patterns:
  • %texts% (start|end)[s] with %texts%
  • %texts% (doesn't|does not|do not|don't) (start|end) with %texts%
Since: 2.2-dev36, 2.5.1 (multiple strings support)
Checks if a text starts or ends with another.

Examples:

if the argument starts with "test" or "debug":
    send "Stop!"

Time

🔗

Condition

Patterns:
Since: 2.0
Tests whether a given real time was more or less than some time span ago.

Examples:

command /command-with-cooldown:
    trigger:
        {command::%player's uuid%::last-usage} was less than a minute ago:
            message "Please wait a minute between uses of this command."
            stop
        set {command::%player's uuid%::last-usage} to now
        # ... actual command trigger here ...

Conditionals

🔗

Section

Patterns:
  • else
  • else [parse] if <.+>
  • [(parse if|if)] <.+>
Since: 1.0
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed

parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true

Examples:

if player's health is greater than or equal to 4:
    send "Your health is okay so far but be careful!"

else if player's health is greater than 2:
    send "You need to heal ASAP, your health is very low!"

else: # Less than 2 hearts
    send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"

parse if plugin "SomePluginName" is enabled: # parse if %condition%
    # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section

Loop

🔗

Section

Patterns:
Since: 1.0
Loop sections repeat their code with multiple values.

A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.

Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.

List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).

Examples:

loop all players:
    send "Hello %loop-player%!" to loop-player

loop items in player's inventory:
    if loop-item is dirt:
        set loop-item to air

loop 10 times:
    send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc.
    wait 1 second

loop {Coins::*}:
    set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200

While Loop

🔗

Section

Patterns:
  • [do] while <.+>
Since: 2.0, 2.6 (do while)
While Loop sections are loops that will just keep repeating as long as a condition is met.

Examples:

while size of all players < 5:
    send "More players are needed to begin the adventure" to all players
    wait 5 seconds

set {_counter} to 1
do while {_counter} > 1: # false but will increase {_counter} by 1 then get out
    add 1 to {_counter}

# Be careful when using while loops with conditions that are almost
# always true for a long time without using 'wait %timespan%' inside it,
# otherwise it will probably hang and crash your server.
while player is online:
    give player 1 dirt
    wait 1 second # without using a delay effect the server will crash

At Time

🔗

Event

Patterns:
Since: 1.3.4
An event that occurs at a given minecraft time in every world or only in specific worlds.

Examples:

at 18:00
at 7am in "world"

On AoE Cloud Effect

🔗

Event

Patterns:
  • [on] (area|AoE) [cloud] effect
Since: 2.2-dev21
Called when area effect cloud applies its potion effect. This happens every 5 ticks by default.

Examples:

on area cloud effect:

On Arm Swing

🔗

Event

Patterns:
  • [on] [player] arm swing
Since: 2.5.1
Called when a player swings his arm.

Examples:

on arm swing:
    send "You swung your arm!"

On Armor Change

🔗

Event

Patterns:
  • [on] [player] armor change[d]
Since: 2.5
Requirements: Paper
Called when armor pieces of a player are changed.

Examples:

on armor change:
    send "You equipped %event-item%!"

On Bed Enter

🔗

Event

Patterns:
  • [on] bed enter[ing]
  • [on] [player] enter[ing] [a] bed
Since: 1.0
Called when a player starts sleeping.

Examples:

on bed enter:

On Bed Leave

🔗

Event

Patterns:
  • [on] bed leav(e|ing)
  • [on] [player] leav(e|ing) [a] bed
Since: 1.0
Called when a player leaves a bed.

Examples:

on player leaving a bed:

On Block Damage

🔗

Event

Patterns:
  • [on] block damag(ing|e)
Since: 1.0
Called when a player starts to break a block. You can usually just use the leftclick event for this.

Examples:

on block damaging:
    if block is log:
        send "You can't break the holy log!"

On Block Fertilize

🔗

Event

Patterns:
  • [on] [block] fertilize
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a player fertilizes blocks.

Examples:

on block fertilize:
    send "Fertilized %size of fertilized blocks% blocks got fertilized."

On Block Growth

🔗

Event

Patterns:
  • [on] (plant|crop|block) grow[(th|ing)] [[of] %item types%]
Since: 2.2-Fixes-V10
Called when a crop grows. Alternative to new form of generic grow event.

Examples:

on crop growth:

On Book Edit

🔗

Event

Patterns:
  • [on] book (edit|change|write)
Since: 2.2-dev31
Called when a player edits a book.

Examples:

on book edit:

On Book Sign

🔗

Event

Patterns:
  • [on] book sign[ing]
Since: 2.2-dev31
Called when a player signs a book.

Examples:

on book sign:

On Break / Mine

🔗

Event

Patterns:
Since: 1.0 (break), unknown (mine), 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.

Examples:

on mine:
on break of stone:
on mine of any ore:
on break of chest[facing=north]:
on break of potatoes[age=7]:

On Bucket Empty

🔗

Event

Patterns:
  • [on] bucket empty[ing]
  • [on] [player] empty[ing] [a] bucket
Since: 1.0
Called when a player empties a bucket. You can also use the place event with a check for water or lava.

Examples:

on bucket empty:

On Bucket fill

🔗

Event

Patterns:
  • [on] bucket fill[ing]
  • [on] [player] fill[ing] [a] bucket
Since: 1.0
Called when a player fills a bucket.

Examples:

on player filling a bucket:

On Burn

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is destroyed by fire.

Examples:

on burn:
on burn of wood, fences, or chests:
on burn of oak_log[axis=y]:

On Can Build Check

🔗

Event

Patterns:
  • [on] [block] can build check
Since: 1.0 (basic), 2.0 ([un]cancellable)
Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it. Please note that the data value of the block to be placed is not available in this event, only its ID.

Examples:

on block can build check:
    cancel event

On Chat

🔗

Event

Patterns:
  • [on] chat
Since: 1.4.1
Called whenever a player chats. Use chat format to change message format, use chat recipients to edit chat recipients.

Examples:

on chat:
    if player has permission "owner":
        set chat format to "<red>[player]<light gray>: <light red>[message]"
    else if player has permission "admin":
        set chat format to "<light red>[player]<light gray>: <orange>[message]"
    else: #default message format
        set chat format to "<orange>[player]<light gray>: <white>[message]"

On Chunk Generate

🔗

Event

Patterns:
  • [on] chunk (generat|populat)(e|ing)
Since: 1.0
Called after a new chunk was generated.

Examples:

on chunk generate:

On Chunk Load

🔗

Event

Patterns:
  • [on] chunk load[ing]
Since: 1.0
Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.

Examples:

on chunk load:

On Chunk Unload

🔗

Event

Patterns:
  • [on] chunk unload[ing]
Since: 1.0
Called when a chunk is unloaded due to not being near any player.

Examples:

on chunk unload:

On Click

🔗

Event

Patterns:
Since: 1.0
Called when a user clicks on a block, an entity or air with or without an item in their hand. Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them. Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.

Examples:

on click:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:

On Combust

🔗

Event

Patterns:
  • [on] combust[ing]
Since: 1.0
Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).

Examples:

on combust:

On Command

🔗

Event

Patterns:
  • [on] command [%text%]
Since: 2.0
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.

Examples:

on command:
on command "/stop":
on command "pm Njol ":

On Connect

🔗

Event

Patterns:
  • [on] [player] connect[ing]
Since: 2.0
Called when the player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over on join.

Examples:

on connect:
    player doesn't have permission "VIP"
    number of players is greater than 15
    kick the player due to "The last 5 slots are reserved for VIP players."

On Consume

🔗

Event

Patterns:
  • [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%]
Since: 2.0
Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.

Examples:

on consume:

On Craft

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a player crafts an item.

Examples:

on craft:

On Creeper Power

🔗

Event

Patterns:
  • [on] creeper power
Since: 1.0
Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.

Examples:

on creeper power:

On Damage

🔗

Event

Patterns:
Since: 1.0, INSERT VERSION (by entity)
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.

Examples:

on damage:
on damage of a player:
on damage of player by zombie:

On Death

🔗

Event

Patterns:
Since: 1.0
Called when a living entity (including players) dies.

Examples:

on death:
on death of player:
on death of a wither or ender dragon:
    broadcast "A %entity% has been slain in %world%!"

On Dispense

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a dispenser dispenses an item.

Examples:

on dispense of iron block:
    send "that'd be 19.99 please!"

On Drop

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a player drops an item from their inventory.

Examples:

on drop:

On Enchant

🔗

Event

Patterns:
  • [on] [item] enchant
Since: 2.5
Called when a player successfully enchants an item. To get the enchanted item, see the enchant item expression

Examples:

on enchant:
    if the clicked button is 1: # offer 1
        set the applied enchantments to sharpness 10 and unbreaking 10

On Enchant Prepare

🔗

Event

Patterns:
  • [on] [item] enchant prepare
Since: 2.5
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

On Enderman/Sheep/Silverfish/Falling Block

🔗

Event

Patterns:
  • [on] enderman place
  • [on] enderman pickup
  • [on] sheep eat
  • [on] silverfish enter
  • [on] silverfish exit
  • [on] falling block land[ing]
Since: unknown, 2.5.2 (falling block)
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively.

Examples:

on sheep eat:
    kill entity
    broadcast "A sheep stole some grass!"
on falling block land:
    if event-entity is a falling dirt:
        cancel event

On Entity Dismount

🔗

Event

Patterns:
  • [on] dismount[ing]
Since: 2.2-dev13b
Called when an entity dismounts.

Examples:

on dismount:
    kill event-entity

On Entity Mount

🔗

Event

Patterns:
  • [on] mount[ing]
Since: 2.2-dev13b
Called when entity starts riding another.

Examples:

on mount:
    cancel event

On Entity Portal

🔗

Event

Patterns:
  • [on] entity portal
Since: 2.5.3
Called when an entity uses a nether or end portal. Cancel the event to prevent the entity from teleporting.

Examples:

on entity portal:
    broadcast "A %type of event-entity% has entered a portal!

On Experience Spawn

🔗

Event

Patterns:
  • [on] [e]xp[erience] [orb] spawn
  • [on] spawn of [a[n]] [e]xp[erience] [orb]
Since: 2.0
Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event. Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)

Examples:

on xp spawn:
    world is "minigame_world"
    cancel event

On Explode

🔗

Event

Patterns:
  • [on] explo(d(e|ing)|sion)
Since: 1.0
Called when an entity (a primed TNT or a creeper) explodes.

Examples:

on explosion:

On Explosion Prime

🔗

Event

Patterns:
  • [on] explosion prime
Since: 1.0
Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.

Examples:

on explosion prime:

On Fade

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block 'fades away', e.g. ice or snow melts.

Examples:

on fade of snow or ice:
on fade of snow[layers=2]

On Firework Explode

🔗

Event

Patterns:
  • [on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%]
Since: 2.4
Called when a firework explodes.

Examples:

on firework explode
on firework exploding colored red, light green and black
on firework explosion colored light green:
    broadcast "A firework colored %colors% was exploded at %location%!"

On First Join

🔗

Event

Patterns:
  • [on] first (join|login)
Since: 1.3.7
Called when a player joins the server for the first time.

Examples:

on first join:
    broadcast "Welcome %player% to the server!"

On Fishing

🔗

Event

Patterns:
  • [on] [player] fish[ing]
Since: 1.0
Called when a player fishes something. This is not of much use yet.

Examples:

on fish:

On Flight Toggle

🔗

Event

Patterns:
  • [on] [player] flight toggl(e|ing)
  • [on] [player] toggl(e|ing) flight
Since: 2.2-dev36
Called when a players stops/starts flying.

Examples:

on flight toggle:
    if {game::%player%::playing} exists:
        cancel event

On Flow

🔗

Event

Patterns:
  • [on] [block] flow[ing]
  • [on] block mov(e|ing)
Since: 1.0
Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.

Examples:

on block flow:
    if event-block is water:
        broadcast "Build more dams! It's starting to get wet in here"

On Form

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).

Examples:

on form of snow:
on form of a mushroom:

On Fuel Burn

🔗

Event

Patterns:
  • [on] fuel burn[ing]
Since: 1.0
Called when a furnace burns an item from its fuel slot.

Examples:

on fuel burning:

On Gamemode Change

🔗

Event

Patterns:
  • [on] game[ ]mode change [to %gamemode%]
Since: 1.0
Called when a player's gamemode changes.

Examples:

on gamemode change:
on gamemode change to adventure:

On Gliding State Change

🔗

Event

Patterns:
  • [on] (gliding state change|toggl(e|ing) gliding)
Since: 2.2-dev21
Called when an entity toggles glider on or off, or when server toggles gliding state of an entity forcibly.

Examples:

on toggling gliding:
    cancel the event # bad idea, but you CAN do it!

On Grow

🔗

Event

Patterns:
Since: 1.0 (2.2-dev20 for plants)
Called when a tree, giant mushroom or plant grows to next stage.

Examples:

on grow:
on grow of a tree:
on grow of a huge jungle tree:

On Hand Item Swap

🔗

Event

Patterns:
  • [on] swap[ping of] [(hand|held)] item[s]
Since: 2.3
Called whenever a player swaps the items in their main- and offhand slots. Works also when one or both of the slots are empty. The event is called before the items are actually swapped, so when you use the player's tool or player's offtool expressions, they will return the values before the swap - this enables you to cancel the event before anything happens.

Examples:

on swap hand items:
    event-player's tool is a diamond sword
    cancel event

On Heal

🔗

Event

Patterns:
  • [on] heal[ing]
Since: 1.0
Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).

Examples:

on heal:

On Horse Jump

🔗

Event

Patterns:
  • [on] horse jump
Since: 2.5.1
Called when a horse jumps.

Examples:

on horse jump:
    push event-entity upwards at speed 2

On Hunger Meter Change

🔗

Event

Patterns:
  • [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing)
Since: 1.4.4
Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.

Examples:

on food bar change:

On Ignition

🔗

Event

Patterns:
  • [on] [block] ignit(e|ion)
Since: 1.0
Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable. The burn event will be called when the block is about do be destroyed by the fire.

Examples:

on block ignite:
    if event-block is a ladder:
        cancel event

On Inventory Click

🔗

Event

Patterns:
  • [on] [player] inventory(-| )click[ing] [[at] %item types%]
Since: 2.2-Fixes-V10
Called when clicking on inventory slot.

Examples:

on inventory click:
    if event-item is stone:
        give player 1 stone
        remove 20$ from player's balance

On Inventory Close

🔗

Event

Patterns:
  • [on] inventory clos(ing|e[d])
Since: 2.2-dev21
Called when player's currently viewed inventory is closed.

Examples:

on inventory close:
    if player's location is {location}:
        send "You exited the shop!"

On Inventory Open

🔗

Event

Patterns:
  • [on] inventory open[ed]
Since: 2.2-dev21
Called when an inventory is opened for player.

Examples:

on inventory open:
    close player's inventory

On Inventory Pickup

🔗

Event

Patterns:
  • [on] inventory pick[ ]up
Since: 2.5.1
Called when an inventory (a hopper, a hopper minecart, etc.) picks up an item

Examples:

on inventory pickup:

On Item Break

🔗

Event

Patterns:
  • [on] [player] tool break[ing]
  • [on] [player] break[ing] [(a|the)] tool
Since: 2.1.1
Called when a player breaks their tool because its damage reached the maximum value. This event cannot be cancelled.

Examples:

on tool break:

On Item Damage

🔗

Event

Patterns:
  • [on] item damag(e|ing)
Since: 2.5
Called when an item is damaged. Most tools are damaged by using them; armor is damaged when the wearer takes damage.

Examples:

on item damage:
    cancel event

On Item Despawn

🔗

Event

Patterns:
  • [on] (item[ ][stack]|[item] %item types%) despawn[ing]
  • [on] [item[ ][stack]] despawn[ing] [[of] %item types%]
Since: 2.2-dev35
Called when an item is about to be despawned from the world, usually 5 minutes after it was dropped.

Examples:

on item despawn of diamond:
    send "Not my precious!"
    cancel event

On Item Mend

🔗

Event

Patterns:
  • [on] item mend[ing]
Since: 2.5.1
Requirements: Minecraft 1.13 or newer
Called when a player has an item repaired via the Mending enchantment.

Examples:

on item mend:
    chance of 50%:
        cancel the event
        send "Oops! Mending failed!" to player

On Item Merge

🔗

Event

Patterns:
  • [on] (item[ ][stack]|[item] %item types%) merg(e|ing)
  • [on] item[ ][stack] merg(e|ing) [[of] %item types%]
Since: 2.2-dev35
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.

Examples:

on item merge of gold blocks:
    cancel event

On Item Spawn

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of their inventory, or a dispenser dispensing an item (not shooting it).

Examples:

on item spawn of iron sword:
    broadcast "Someone dropped an iron sword!"

On Join

🔗

Event

Patterns:
  • [on] [player] (login|logging in|join[ing])
Since: 1.0
Called when the player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer on connect over this event.

Examples:

on join:
    message "Welcome on our awesome server!"
    broadcast "%player% just joined the server!"

On Jump

🔗

Event

Patterns:
  • [on] [player] jump[ing]
Since: 2.3
Called whenever a player jumps. This event requires PaperSpigot.

Examples:

on jump:
    event-player does not have permission "jump"
    cancel event

On Kick

🔗

Event

Patterns:
  • [on] [player] (kick|being kicked)
Since: 1.0
Called when a player is kicked from the server. You can change the kick message or cancel the event entirely.

Examples:

on kick:

On Language Change

🔗

Event

Patterns:
  • [on] [player] (language|locale) chang(e|ing)
  • [on] [player] chang(e|ing) (language|locale)
Since: 2.3
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.

Examples:

on language change:
    if player's language starts with "en":
        send "Hello!"

On Leaves Decay

🔗

Event

Patterns:
  • [on] leaves decay[ing]
Since: 1.0
Called when a leaf block decays due to not being connected to a tree.

Examples:

on leaves decay:

On Level Change

🔗

Event

Patterns:
  • [on] [player] level (change|up|down)
Since: 1.0, 2.4 (level up/down)
Called when a player's level changes, e.g. by gathering experience or by enchanting something.

Examples:

on level change:

On Lightning Strike

🔗

Event

Patterns:
  • [on] lightning [strike]
Since: 1.0
Called when lightning strikes.

Examples:

on lightning:
    spawn a zombie at location of event-entity

On Move

🔗

Event

Patterns:
Since: 2.6
Requirements: Paper 1.16.5+ (entity move)
Called when a player or entity moves. NOTE: Move event will only be called when the entity/player moves position, not orientation (ie: looking around). NOTE: These events can be performance heavy as they are called quite often. If you use these events, and later remove them, a server restart is recommended to clear registered events from Skript.

Examples:

on player move:
    if player does not have permission "player.can.move":
        cancel event
on skeleton move:
    if event-entity is not in world "world":
        kill event-entity

On Move On

🔗

Event

Patterns:
Since: 2.0
Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.

Examples:

on walking on dirt or grass:
on stepping on stone:

On Physics

🔗

Event

Patterns:
  • [on] [block] physics
Since: 1.4.6
Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.Please note that using this event might cause quite some lag since it gets called extremely often.

Examples:

# prevents sand from falling
on block physics:
    block is sand
    cancel event

On Pick Up

🔗

Event

Patterns:
  • [on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%]
Since: unknown (before 2.1), 2.5 (entity)
Requirements: 1.12.2+ for entity
Called when a player/entity picks up an item. Please note that the item is still on the ground when this event is called.

Examples:

on pick up:
on entity pickup of wheat:

On Pig Zap

🔗

Event

Patterns:
  • [on] pig[ ]zap
Since: 1.0
Called when a pig is stroke by lightning and transformed into a zombie pigman. Cancel the event to prevent the transformation.

Examples:

on pig zap:

On Piston Extend

🔗

Event

Patterns:
  • [on] piston extend[ing]
Since: 1.0
Called when a piston is about to extend.

Examples:

on piston extend:
    broadcast "A piston is extending!"

On Piston Retract

🔗

Event

Patterns:
  • [on] piston retract[ing]
Since: 1.0
Called when a piston is about to retract.

Examples:

on piston retract:
    broadcast "A piston is retracting!"

On Place

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a player places a block.

Examples:

on place:
on place of a furnace, workbench or chest:
on place of chest[type=right] or chest[type=left]

On Player World Change

🔗

Event

Patterns:
  • [on] [player] world chang(ing|e[d])
Since: 2.2-dev28
Called when a player enters a world. Does not work with other entities!

Examples:

on player world change:
    world is "city"
    send "Welcome to the City!"

On Portal

🔗

Event

Patterns:
  • [on] [player] portal
Since: 1.0
Called when a player uses a nether or end portal. Cancel the event to prevent the player from teleporting.

Examples:

on player portal:

On Portal Create

🔗

Event

Patterns:
  • [on] portal creat(e|ion)
Since: 1.0, 2.5.3 (event-entity support)
Requirements: Minecraft 1.14+ (event-entity support)
Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld. In Minecraft 1.14+, you can use the player in this event. Please note that there may not always be a player (or other entity) in this event.

Examples:

on portal create:

On Portal Enter

🔗

Event

Patterns:
  • [on] portal enter[ing]
  • [on] entering [a] portal
Since: 1.0
Called when an entity enters a nether portal or an end portal. Please note that this event will be fired many times for a nether portal.

Examples:

on portal enter:

On Prepare Craft

🔗

Event

Patterns:
  • [on] [player] (preparing|beginning) craft[ing] [[of] %item types%]
Since: 2.2-Fixes-V10
Called just before displaying crafting result to player. Note that setting the result item might or might not work due to Bukkit bugs.

Examples:

on preparing craft of torch:

On Pressure Plate / Trip

🔗

Event

Patterns:
  • [on] [step[ping] on] [a] [pressure] plate
  • [on] (trip|[step[ping] on] [a] tripwire)
Since: 1.0 (pressure plate), 1.4.4 (tripwire)
Called when a player steps on a pressure plate or tripwire respectively.

Examples:

on step on pressure plate:

On Projectile Collide

🔗

Event

Patterns:
  • [on] projectile collide
Since: 2.5
Requirements: Paper
Called when a projectile collides with an entity.

Examples:

on projectile collide:
    teleport shooter of event-projectile to event-entity

On Projectile Hit

🔗

Event

Patterns:
  • [on] projectile hit
Since: 1.0
Called when a projectile hits an entity or a block. Use the damage event with a check for a projectile to be able to use the entity that got hit in the case when the projectile hit a living entity. A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.

Examples:

on projectile hit:
    event-projectile is arrow
    delete event-projectile

On Quit

🔗

Event

Patterns:
  • [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing))
Since: 1.0 (simple disconnection)
Called when a player leaves the server.

Examples:

on quit:
on disconnect:

On Redstone

🔗

Event

Patterns:
  • [on] redstone [current] [chang(e|ing)]
Since: 1.0
Called when the redstone current of a block changes. This event is of not much use yet.

Examples:

on redstone change:
    send "someone is using redstone" to console

On Region Enter/Leave

🔗

Event

Patterns:
  • [on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%)
  • [on] region (enter[ing]|leav(e|ing)|exit[ing])
Since: 2.1
Requirements: Supported regions plugin
Called when a player enters or leaves a region. This event requires a supported regions plugin to be installed.

Examples:

on region exit:
    message "Leaving %region%."

On Resource Pack Request Response

🔗

Event

Patterns:
Since: 2.4
Called when a player takes action on a resource pack request sent via the send resource pack effect. The resource pack condition can be used to check the resource pack state.

This event will be triggered once when the player accepts or declines the resource pack request, and once when the resource pack is successfully installed or failed to download.

Examples:

on resource pack request response:
    if the resource pack was declined or failed to download:

on resource pack deny:
    kick the player due to "You have to install the resource pack to play in this server!"

On Respawn

🔗

Event

Patterns:
  • [on] [player] respawn[ing]
Since: 1.0
Called when a player respawns. You should prefer this event over the death event as the player is technically alive when this event is called.

Examples:

on respawn:

On Resurrect Attempt

🔗

Event

Patterns:
  • [on] [entity] resurrect[ion] [attempt]
Since: 2.2-dev28
Called when an entity dies, always. If they are not holding a totem, this is cancelled - you can, however, uncancel it.

Examples:

on resurrect attempt:
    entity is player
    entity has permission "admin.undying"
    uncancel the event

On Riptide

🔗

Event

Patterns:
  • [on] [use of] riptide [enchant[ment]]
Since: 2.5
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.

Examples:

on riptide:
    send "You are riptiding!"

On Script Load/Unload

🔗

Event

Patterns:
  • [on] [async] [script] (load|init|enable)
  • [on] [async] [script] (unload|stop|disable)
Since: 2.0
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,

Examples:

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

On Server List Ping

🔗

Event

Patterns:
  • [on] server [list] ping
Since: 2.3
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. The IP expression can be used to get the IP adress of the pinger. This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).

Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.

Examples:

on server list ping:
    set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
    set the fake max players count to (online players count + 1)
    set the shown icon to a random server icon out of {server-icons::*}

On Server Start/Stop

🔗

Event

Patterns:
  • [on] (server|skript) (start|load|enable)
  • [on] (server|skript) (stop|unload|disable)
Since: 2.0
Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).

Examples:

on skript start:
on server stop:

On Sheep Regrow Wool

🔗

Event

Patterns:
  • [on] sheep [re]grow[ing] wool
Since: 2.2-dev21
Called when sheep regrows its sheared wool back.

Examples:

on sheep grow wool:
    cancel event

On Shoot

🔗

Event

Patterns:
  • [on] [projectile] shoot
Since: 1.0
Called whenever a projectile is shot. Use the shooter expression to get who shot the projectile.

Examples:

on shoot:
    if projectile is an arrow:
        send "you shot an arrow!" to shooter

On Sign Change

🔗

Event

Patterns:
  • [on] sign (chang[e]|edit)[ing]
  • [on] [player] (chang[e]|edit)[ing] [a] sign
Since: 1.0
As signs are placed empty, this event is called when a player is done editing a sign.

Examples:

on sign change:
    line 2 is empty
    set line 1 to "<red>%line 1%"

On Slime Split

🔗

Event

Patterns:
  • [on] slime split[ting]
Since: 2.2-dev26
Called when a slime splits. Usually this happens when a big slime dies.

Examples:

on slime split:

On Smelt

🔗

Event

Patterns:
  • [on] [ore] smelt[ing]
  • [on] smelt[ing] of ore
Since: 1.0
Called when a furnace smelts an item in its ore slot.

Examples:

on smelt:

On Sneak Toggle

🔗

Event

Patterns:
  • [on] [player] toggl(e|ing) sneak
  • [on] [player] sneak toggl(e|ing)
Since: 1.0
Called when a player starts or stops sneaking. Use is sneaking to get whether the player was sneaking before the event was called.

Examples:

# make players that stop sneaking jump
on sneak toggle:
    player is sneaking
    push the player upwards at speed 0.5

On Spawn

🔗

Event

Patterns:
Since: 1.0, 2.5.1 (non-living entities)
Called when an entity spawns (excluding players).

Examples:

on spawn of a zombie:
on spawn of an ender dragon:
    broadcast "A dragon has been sighted in %world%!"

On Spawn Change

🔗

Event

Patterns:
  • [on] [world] spawn change
Since: 1.0
Called when the spawn point of a world changes.

Examples:

on spawn change:
    broadcast "someone changed the spawn!"

On Sponge Absorb

🔗

Event

Patterns:
  • [on] sponge absorb
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a sponge absorbs blocks.

Examples:

on sponge absorb:
    loop absorbed blocks:
        broadcast "%loop-block% was absorbed by a sponge"!

On Spread

🔗

Event

Patterns:
  • [on] spread[ing]
Since: 1.0
Called when a new block forms as a result of a block that can spread, e.g. water or mushrooms.

Examples:

on spread:

On Sprint Toggle

🔗

Event

Patterns:
  • [on] [player] toggl(e|ing) sprint
  • [on] [player] sprint toggl(e|ing)
Since: 1.0
Called when a player starts or stops sprinting. Use is sprinting to get whether the player was sprinting before the event was called.

Examples:

on sprint toggle:
    player is not sprinting
    send "Run!"

On Swim Toggle

🔗

Event

Patterns:
  • [on] [entity] toggl(e|ing) swim
  • [on] [entity] swim toggl(e|ing)
Since: 2.3
Requirements: 1.13 or newer
Called when an entity swims or stops swimming.

Examples:

on swim toggle:
    event-entity does not have permission "swim"
    cancel event

On Tame

🔗

Event

Patterns:
  • [on] [entity] tam(e|ing)
Since: 1.0
Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.

Examples:

on tame:

On Target

🔗

Event

Patterns:
  • [on] [entity] target
  • [on] [entity] un[-]target
Since: 1.0
Called when a mob starts/stops following/attacking another entity, usually a player.

Examples:

on entity target:
    target is a player

On Teleport

🔗

Event

Patterns:
  • [on] [player] teleport[ing]
Since: 1.0
Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).

Examples:

on teleport:

On Throwing of an Egg

🔗

Event

Patterns:
  • [on] throw[ing] [of] [an] egg
  • [on] [player] egg throw
Since: 1.0
Called when a player throws an egg. You can just use the shoot event in most cases, as this event is intended to support changing the hatched mob and its chance to hatch, but Skript does not yet support that.

Examples:

on throw of an egg:

On Tool Change

🔗

Event

Patterns:
  • [on] [player['s]] (tool|item held|held item) chang(e|ing)
Since: 1.0
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.

Examples:

on player's held item change:

On Vehicle Create

🔗

Event

Patterns:
  • [on] vehicle create
  • [on] creat(e|ing|ion of) [a] vehicle
Since: 1.0
Called when a new vehicle is created, e.g. when a player places a boat or minecart.

Examples:

on vehicle create:

On Vehicle Damage

🔗

Event

Patterns:
  • [on] vehicle damage
  • [on] damag(e|ing) [a] vehicle
Since: 1.0
Called when a vehicle gets damage. Too much damage will destroy the vehicle.

Examples:

on vehicle damage:

On Vehicle Destroy

🔗

Event

Patterns:
  • [on] vehicle destroy
  • [on] destr(oy[ing]|uction of) [a] vehicle
Since: 1.0
Called when a vehicle is destroyed. Any passenger will be ejected and the vehicle might drop some item(s).

Examples:

on vehicle destroy:
    cancel event

On Vehicle Enter

🔗

Event

Patterns:
  • [on] vehicle enter
  • [on] enter[ing] [a] vehicle
Since: 1.0
Called when an entity enters a vehicle, either deliberately (players) or by falling into them (mobs).

Examples:

on vehicle enter:
    entity is a player
    cancel event

On Vehicle Exit

🔗

Event

Patterns:
  • [on] vehicle exit
  • [on] exit[ing] [a] vehicle
Since: 1.0
Called when an entity exits a vehicle.

Examples:

on vehicle exit:
    if event-entity is a spider:
        kill event-entity

On Weather Change

🔗

Event

Patterns:
Since: 1.0
Called when a world's weather changes.

Examples:

on weather change:
on weather change to sunny:

On World Init

🔗

Event

Patterns:
  • [on] world init[ialization]
Since: 1.0
Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds. World management plugins might change the behaviour of this event though.

Examples:

on world init:

On World Load

🔗

Event

Patterns:
  • [on] world load[ing]
Since: 1.0
Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).

Examples:

on world load:
    send "World is loading..." to console

On World Save

🔗

Event

Patterns:
  • [on] world sav(e|ing)
Since: 1.0
Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.

Examples:

on world saving:
    broadcast "World has been saved!"

On World Unload

🔗

Event

Patterns:
  • [on] world unload[ing]
Since: 1.0
Called when a world is unloaded. This event might never be called if you don't have a world management plugin.

Examples:

on world unload:
    cancel event

On Zombie Break Door

🔗

Event

Patterns:
  • [on] zombie break[ing] [a] [wood[en]] door
Since: 1.0
Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.

Examples:

on zombie breaking a wood door:

Periodical

🔗

Event

Patterns:
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days:

Periodical

🔗

Event

Patterns:
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds in "world":
every minecraft hour in "flatworld":
every tick in "world": # can cause lag depending on the code inside the event
every minecraft days in "plots":

Attribute Type

🔗

Type

Patterns:
  • generic attack speed, luck, max health, generic movement speed, flying speed, attack damage, horse jump strength, generic attack damage, generic luck, generic armor, generic flying speed, follow range, generic knockback resistance, movement speed, generic follow range, zombie spawn reinforcements, armor, generic attack knockback, attack speed, armor toughness, knockback resistance, generic max health, attack knockback, generic armor toughness
Since: 2.5
Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info.

Examples:

Missing examples.

Biome

🔗

Type

Patterns:
  • Biome names; you can use F3 ingame
Since: 1.4.4
All possible biomes Minecraft uses to generate a world.

Examples:

biome at the player is desert

Block

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A block in a world. It has a location and a type, and can also have a direction (mostly a facing), an inventory, or other special properties.

Examples:

Missing examples.

Block Data

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
Requirements: Minecraft 1.13+
Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.

Examples:

set block at player to campfire[lit=false]
set target block of player to oak stairs[facing=north;waterlogged=true]
set block at player to grass_block[snowy=true]
set loop-block to minecraft:chest[facing=north]
set block above player to oak_log[axis=y]
set target block of player to minecraft:oak_leaves[distance=2;persistent=false]

Boolean

🔗

Type

Patterns:
  • true/yes/on or false/no/off
Since: 1.0
A boolean is a value that is either true or false. Other accepted names are 'on' and 'yes' for true, and 'off' and 'no' for false.

Examples:

set {config.%player%.use mod} to false

Cat Type

🔗

Type

Patterns:
  • red, all black, british shorthair, ragdoll, white, jellie, siamese, black, tabby, calico, persian
Since: 2.4
Requirements: Minecraft 1.14 or newer
Represents the race/type of a cat entity.

Examples:

Missing examples.

Chunk

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.0
A chunk is a cuboid of 16×16×128 (x×z×y) blocks. Chunks are spread on a fixed rectangular grid in their world.

Examples:

Missing examples.

Click Type

🔗

Type

Patterns:
  • lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action
Since: 2.2-dev16b, 2.2-dev35 (renamed to click type)
Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.

Examples:

Missing examples.

Color

🔗

Type

Patterns:
  • black, dark grey/dark gray, grey/light grey/gray/light gray/silver, white, blue/dark blue, cyan/aqua/dark cyan/dark aqua, light blue/light cyan/light aqua, green/dark green, light green/lime/lime green, yellow/light yellow, orange/gold/dark yellow, red/dark red, pink/light red, purple/dark purple, magenta/light purple, brown/indigo
Since: Unknown
Wool, dye and chat colors.

Examples:

color of the sheep is red or black
set the color of the block to green
message "You're holding a <%color of tool%>%color of tool% wool block"

Command Sender

🔗

Type

Patterns:
Since: 1.0
A player or the console.

Examples:

command /push [<player>]:
    trigger:
        if arg-1 is not set:
            if command sender is console:
                send "You can't push yourself as a console :\" to sender
                stop
            push sender upwards with force 2
            send "Yay!"
        else:
            push arg-1 upwards with force 2
            send "Yay!" to sender and arg-1

Damage Cause

🔗

Type

Patterns:
  • sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, flying into a wall, cramming, poison, sonic boom, suffocate, custom, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath
Since: 2.0
The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc. Please note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.

Examples:

Missing examples.

Date

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.4
A date is a certain point in the real world's time which can be obtained with now expression, unix date expression and date function. See time and timespan for the other time types of Skript.

Examples:

set {_yesterday} to now
subtract a day from {_yesterday}
# now {_yesterday} represents the date 24 hours before now

Difficulty

🔗

Type

Patterns:
  • normal, medium, hard, easy, peaceful
Since: 2.3
The difficulty of a world.

Examples:

Missing examples.

Direction

🔗

Type

Patterns:
Since: 2.0
A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc. Locations and some blocks also have a direction, but without a length. Please note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.

Examples:

set the block below the victim to a chest
loop blocks from the block infront of the player to the block 10 below the player:
    set the block behind the loop-block to water

Enchantment

🔗

Type

Patterns:
  • Frost Walker, Feather Falling, Unbreaking, Swift Sneak, Knockback, Projectile Protection, Respiration, Punch, Protection, Blast Protection, Lure, Impaling, Smite, Silk Touch, Infinity, Luck of The Sea, Thorns, Multishot, Curse of Vanishing, Fire Aspect, Flame, Depth Strider, Piercing, Fire Protection, Sharpness, Power, Sweeping Edge, Aqua Affinity, Curse of Binding, Bane of Arthropods, Soul Speed, Looting, Efficiency, Mending, Riptide, Quick Charge, Fortune, Loyalty, Channeling
Since: 1.4.6
An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway.

Examples:

Missing examples.

Enchantment Offer

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
The enchantmentoffer in an enchant prepare event.

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

Enchantment Type

🔗

Type

Patterns:
  • <enchantment> [<level>]
Since: 1.4.6
An enchantment with an optional level, e.g. 'sharpness 2' or 'fortune'.

Examples:

enchant the player's tool with sharpness 5
helmet is enchanted with waterbreathing

Entity

🔗

Type

Patterns:
  • player, op, wolf, tamed ocelot, powered creeper, zombie, unsaddled pig, fireball, arrow, dropped item, item frame, etc.
Since: 1.0
An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.

Examples:

entity is a zombie or creeper
player is an op
projectile is an arrow
shoot a fireball from the player

Entity Type

🔗

Type

Patterns:
  • Detailed usage will be added eventually
Since: 1.3
The type of an entity, e.g. player, wolf, powered creeper, etc.

Examples:

victim is a cow
spawn a creeper

Entity Type with Amount

🔗

Type

Patterns:
Since: 1.3
An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.

Examples:

spawn 5 creepers behind the player

Experience

🔗

Type

Patterns:
  • [<number>] ([e]xp|experience [point[s]])
Since: 2.0
Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.

Examples:

give 10 xp to the player

Firework Effect

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.4
A configuration of effects that defines the firework when exploded which can be used in the launch firework effect. See the firework effect expression for detailed patterns.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Firework Type

🔗

Type

Patterns:
  • small, ball, star shaped, large, star, creeper face, small ball, large ball, burst, ball large, creeper
Since: 2.4
The type of a fireworkeffect.

Examples:

Missing examples.

Game Mode

🔗

Type

Patterns:
  • creative/survival/adventure/spectator
Since: 1.0
The game modes survival, creative, adventure and spectator.

Examples:

player's gamemode is survival
set the player argument's game mode to creative

Gamerule

🔗

Type

Patterns:
  • doWardenSpawning, doFireTick, maxCommandChainLength, fireDamage, reducedDebugInfo, disableElytraMovementCheck, announceAdvancements, drowningDamage, commandBlockOutput, forgiveDeadPlayers, doMobSpawning, maxEntityCramming, disableRaids, doWeatherCycle, doDaylightCycle, showDeathMessages, doTileDrops, universalAnger, playersSleepingPercentage, doInsomnia, doImmediateRespawn, naturalRegeneration, doMobLoot, fallDamage, keepInventory, doEntityDrops, doLimitedCrafting, mobGriefing, randomTickSpeed, spawnRadius, freezeDamage, doTraderSpawning, logAdminCommands, spectatorsGenerateChunks, sendCommandFeedback, doPatrolSpawning
Since: 2.5
Requirements: Minecraft 1.13 or newer
A gamerule

Examples:

Missing examples.

Gamerule Value

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.5
A wrapper for the value of a gamerule for a world.

Examples:

Missing examples.

Gene

🔗

Type

Patterns:
  • normal, lazy, happy, worried, worrisome, aggressive, brown, brownish, savage, playful, wild, weak
Since: 2.4
Requirements: Minecraft 1.14 or newer
Represents a Panda's main or hidden gene. See genetics for more info.

Examples:

Missing examples.

Heal Reason

🔗

Type

Patterns:
  • an ender crystal, magic, a magic regeneration, magic regeneration, fed, sated, a magic regen, regen potion, a wither spawn, peaceful, unknown, a regeneration potion, consuming, a wither effect, peaceful regeneration, wither summoning, healing potion, wither potion, an end crystal, satiated, regeneration potion, potion, satisfied, ingesting, withered, custom, a wither spawning, end crystal, eating, wither spawning, a wither summoning, wither effect, a plugin, a regen potion, plugin, withering, a potion, wither spawn, a healing potion, ender crystal, magic regen, wither, peaceful regen
Since: 2.5
The heal reason in a heal event.

Examples:

Missing examples.

Inventory

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
An inventory of a player or block. Inventories have many effects and conditions regarding the items contained. An inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).

Examples:

Missing examples.

Inventory Action

🔗

Type

Patterns:
  • drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap
Since: 2.2-dev16
What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.

Examples:

Missing examples.

Inventory Slot

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. The most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set). Please note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.

Examples:

set tool of player to dirt
delete helmet of the victim
set the color of the player's tool to green
enchant the player's chestplate with projectile protection 5

Inventory Type

🔗

Type

Patterns:
  • blast furnace inventory, barrel inventory, workbench inventory, smoker inventory, composter inventory, ender chest inventory, dispenser inventory, player inventory, loom inventory, stonecutter inventory, hopper inventory, merchant inventory, cartography table inventory, anvil inventory, beacon inventory, shulker box inventory, lectern inventory, chest inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, grindstone inventory, creative inventory, crafting table inventory, furnace inventory
Since: 2.2-dev32
Minecraft has several different inventory types with their own use cases.

Examples:

Missing examples.

Item / Material

🔗

Type

Patterns:
  • [<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')
Since: 1.0
An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction). You don't usually need this type except when you want to make a command that only accepts an exact item. Please note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.

Examples:

set {_item} to type of the targeted block
{_item} is a torch

Item Type

🔗

Type

Patterns:
  • [<number> [of]] [all/every] <alias> [of <enchantment> [<level>] [,/and <more enchantments...>]]
Since: 1.0
An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type. An item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.

Examples:

give 4 torches to the player
add all slabs to the inventory of the block
player's tool is a diamond sword of sharpness
remove a pickaxes of fortune 4 from {stored items::*}
set {_item} to 10 of every upside-down stair
block is dirt or farmland

Living Entity

🔗

Type

Patterns:
  • see entity, but ignore inanimate objects
Since: 1.0
A living entity, i.e. a mob or player, not inanimate entities like projectiles or dropped items.

Examples:

spawn 5 powered creepers
shoot a zombie from the creeper

Location

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.

Examples:

Missing examples.

Metadata Holder

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.2-dev36
Something that can hold metadata (e.g. an entity or block)

Examples:

set metadata value "super cool" of player to true

Money

🔗

Type

Patterns:
  • <number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'
Since: 2.0
Requirements: Vault, an economy plugin that supports Vault
A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.

Examples:

add 10£ to the player's account
remove Fr. 9.95 from the player's money
set the victim's money to 0
increase the attacker's balance by the level of the victim * 100

Number

🔗

Type

Patterns:
  • [-]###[.###] (any amount of digits; very large numbers will be truncated though)
Since: 1.0
A number, e.g. 2.5, 3, or -9812454. Please note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.

Examples:

set the player's health to 5.5
set {_temp} to 2*{_temp} - 2.5

Object

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
The supertype of all types, meaning that if %object% is used in e.g. a condition it will accept all kinds of expressions.

Examples:

Missing examples.

Offline Player

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.

Examples:

Missing examples.

Player

🔗

Type

Patterns:
  • Missing patterns.
Since: 1.0
A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.

Examples:

Missing examples.

Potion Effect

🔗

Type

Patterns:
  • speed of tier 1 for 10 seconds
Since: 2.5.2
A potion effect, including the potion effect type, tier and duration.

Examples:

Missing examples.

Potion Effect Type

🔗

Type

Patterns:
  • null, speed, slowness, haste, mining fatigue, strength, instant health, instant damage, jump boost, nausea, regeneration, resistance, fire resistance, water breathing, invisibility, blindness, night vision, hunger, weakness, poison, wither, health boost, absorption, saturation, glowing, levitation, luck, bad luck, slow falling, conduit power, dolphins grace, bad omen, hero of the village, darkness
Since: Unknown
A potion effect type, e.g. 'strength' or 'swiftness'.

Examples:

apply swiftness 5 to the player
apply potion of speed 2 to the player for 60 seconds
remove invisibility from the victim

Projectile

🔗

Type

Patterns:
  • arrow, fireball, snowball, thrown potion, etc.
Since: 1.0
A projectile, e.g. an arrow, snowball or thrown potion.

Examples:

projectile is a snowball
shoot an arrow at speed 5 from the player

Region

🔗

Type

Patterns:
  • "region name"
Since: 2.1
Requirements: Supported regions plugin
A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones. Please note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like "region name" in scripts may or may not work.

Examples:

Missing examples.

Resource Pack State

🔗

Type

Patterns:
  • refused, rejected, accepted, failed, failed to download, successfully loaded, accept, fail, successfully load, refuse, declined, successfully install, success, reject, decline, successfully installed, download fail
Since: 2.4
The state in a resource pack request response event.

Examples:

Missing examples.

Server Icon

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.3
A server icon that was loaded using the load server icon effect.

Examples:

Missing examples.

Sound Category

🔗

Type

Patterns:
  • hostile creatures category, speech category, records category, friendly creature category, noteblock category, hostile creature category, note block category, voice category, ambient category, noteblocks category, note blocks category, weather category, block category, friendly mob category, jukebox category, hostile mob category, master category, master volume category, hostile category, record category, blocks category, environment category, jukeboxes category, player category, players category, hostile mobs category, friendly mobs category, music category, friendly creatures category, neutral category
Since: 2.4
Requirements: Minecraft 1.11 or newer
The category of a sound, they are used for sound options of Minecraft. See the play sound and stop sound effects.

Examples:

Missing examples.

Spawn Reason

🔗

Type

Patterns:
  • dispense egg, egg, village defense, ocelot baby, silverfish trap, village invading, trap, dispensing egg, shoulder, drowned, metamorphosis, lightning, silverfish reveal, spell, built iron golem, natural, village invasion, frozen, mount, build wither, built wither, iron golem defense, ender pearl, creature spawner, reinforcements, build snowman, build iron golem, breeding, raid, infection, customized, spawn egg, jockey, beehive, default, golem defense, patrol, slime split, infected, sheared, mob spawner, nether portal, shear, perching, custom, built snowman, chunk generation, breed, command, explosion, spawner, cured, customised, piglin zombification
Since: 2.3
The spawn reason in a spawn event.

Examples:

Missing examples.

Teleport Cause

🔗

Type

Patterns:
  • nether portal, ender gateway, chorus fruit, ender portal, command, unknown, plugin, ender pearl, spectator, spectate, end gateway, chorus, gateway, end portal
Since: 2.2-dev35
The teleport cause in a teleport event.

Examples:

Missing examples.

Text

🔗

Type

Patterns:
  • simple: "..."
  • quotes: "...""..."
  • expressions: "...%expression%..."
  • percent signs: "...%%..."
Since: 1.0
Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name). Because scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text. Please read the article on Texts and Variable Names to learn more.

Examples:

broadcast "Hello World!"
message "Hello %player%"
message "The id of ""%type of tool%"" is %id of tool%."

Time

🔗

Type

Patterns:
  • ##:##
  • ##[:##][ ]am/pm
Since: 1.0
A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world. See date and timespan for the other time types of Skript.

Examples:

at 20:00:
    time is 8 pm
    broadcast "It's %time%"

Timeperiod

🔗

Type

Patterns:
  • ##:## - ##:##
  • dusk/day/dawn/night
Since: 1.0
A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world. This type might be removed in the future as you can use 'time of world is between x and y' as a replacement.

Examples:

time in world is night

Timespan

🔗

Type

Patterns:
  • <number> [minecraft/mc/real/rl/irl] ticks/seconds/minutes/hours/days/weeks/months/years [[,/and] <more...>]
  • [###:]##:##[.####] ([hours:]minutes:seconds[.milliseconds])
Since: 1.0, 2.6.1 (weeks, months, years)
A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'. NOTE: Months always have the value of 30 days, and years of 365 days. See date and time for the other time types of Skript.

Examples:

every 5 minecraft days:
    wait a minecraft second and 5 ticks
every 10 mc days and 12 hours:
    halt for 12.7 irl minutes, 12 hours and 120.5 seconds

Tree Type

🔗

Type

Patterns:
  • [any] <general tree/mushroom type>, e.g. tree/any jungle tree/etc.
  • <specific tree/mushroom species>, e.g. red mushroom/small jungle tree/big regular tree/etc.
Since: Unknown
A tree type represents a tree species or a huge mushroom species. These can be generated in a world with the generate tree effect.

Examples:

grow any regular tree at the block
grow a huge red mushroom above the block

Type

🔗

Type

Patterns:
  • See the type name patterns of all types - including this one
Since: 2.0
Represents a type, e.g. number, object, item type, location, block, world, entity type, etc. This is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.

Examples:

{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5
{variable} is a type # check whether the variable contains a type, e.g. number or player
{variable} is an object # will always succeed if the variable is set as everything is an object, even types.
disable PvP in the event-world
kill the loop-entity

Vector

🔗

Type

Patterns:
  • vector(x, y, z)
Since: 2.2-dev23
Vector is a collection of numbers. In Minecraft, 3D vectors are used to express velocities of entities.

Examples:

Missing examples.

Visual Effect

🔗

Type

Patterns:
  • smoke, potion break, ender signal, mobspawner flames, arrow particles, jumping rabbit, hurt, wolf smoke, wolf hearts, wolf shaking, sheep eating, iron golem offering rose, villager hearts, angry villager entity, happy villager entity, witch magic, zombie turning to a villager, firework explosion, love hearts, squid rotation reset, entity poof, guardian target, block with shield, shield break, armor stand hit, hurt by thorns, iron golem sheathing rose, resurrection by totem, hurt by drowning, hurt by explosion, explosion, large explosion, huge explosion, firework's spark, water bubble, water splash, water wake, suspended, void fog, critical hit, magical critical hit, smoke particle, large smoke, spell, spell, potion swirl, transparent potion swirl, witch spell, water drip, lava drip, angry villager, happy villager, small smoke, note, portal, flying glyph, flame, lava pop, cloud, coloured dust, snowball break, snow shovel, slime, heart, item crack, block break, block dust, water drop, mob appearance, dragon breath, end rod, damage indicator, sweep attack, falling dust, totem, spit, squid ink, bubble pop, current down, bubble column up, nautilus, dolphin, sneeze, campfire cosy smoke, campfire signal smoke, composter, flash, falling lava, landing lava, falling water, dripping honey, falling honey, landing honey, falling nectar, soul fire flame, ash, crimson spore, warped spore, soul, dripping obsidian tear, falling obsidian tear, landing obsidian tear, reverse portal, white ash, falling spore blossom, spore blossom air, small flame, snowflake, dripping dripstone lava, falling dripstone lava, dripping dripstone water, falling dripstone water, glow squid ink, glow, wax on, wax off, electric spark, scrape, sonic boom, sculk soul, sculk charge, sculk charge pop, shriek
Since: 2.1
A visible effect, e.g. particles.

Examples:

show wolf hearts on the clicked wolf
play mob spawner flames at the targeted block to the player

Weather Type

🔗

Type

Patterns:
  • clear/sun/sunny, rain/rainy/raining, and thunder/thundering/thunderstorm
Since: 1.0
The weather types sunny, rainy, and thundering.

Examples:

is raining
is sunny in the player's world
message "It is %weather in the argument's world% in %world of the argument%"

World

🔗

Type

Patterns:
  • "world_name", e.g. "world"
Since: 1.0, 2.2 (alternate syntax)
One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. "world_nether", but this might not work reliably as text uses the same syntax.

Examples:

broadcast "Hello!" to the world "world_nether"

abs

🔗

Function

Patterns:
  • abs(n: number)
Since: 2.2
Return Type: Number
Returns the absolute value of the argument, i.e. makes the argument positive.

Examples:

abs(3) = 3
abs(-2) = 2

acos

🔗

Function

Patterns:
  • acos(n: number)
Since: 2.2
Return Type: Number
The inverse of the cosine, also called arccos. Returns result in degrees, not radians. Only returns values from 0 to 180.

Examples:

acos(0) = 90
acos(1) = 0
acos(0.5) = 30

asin

🔗

Function

Patterns:
  • asin(n: number)
Since: 2.2
Return Type: Number
The inverse of the sine, also called arcsin. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

asin(0) = 0
asin(1) = 90
asin(0.5) = 30

atan

🔗

Function

Patterns:
  • atan(n: number)
Since: 2.2
Return Type: Number
The inverse of the tangent, also called arctan. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

atan(0) = 0
atan(1) = 45
atan(10000) = 89.9943

atan2

🔗

Function

Patterns:
  • atan2(x: number, y: number)
Since: 2.2
Return Type: Number
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).

Examples:

atan2(0, 1) = 0
atan2(10, 0) = 90
atan2(-10, 5) = -63.4349

calcExperience

🔗

Function

Patterns:
  • calcExperience(level: long)
Since: 2.2-dev32
Return Type: long
Calculates the total amount of experience needed to achieve given level from scratch in Minecraft.

Examples:

Missing examples.

ceil

🔗

Function

Patterns:
  • ceil(n: number)
Since: 2.2
Return Type: long
Rounds a number up, i.e. returns the closest integer larger than or equal to the argument.

Examples:

ceil(2.34) = 3
ceil(2) = 2
ceil(2.99) = 3

ceiling

🔗

Function

Patterns:
  • ceiling(n: number)
Since: 2.2
Return Type: long
Alias of ceil.

Examples:

ceiling(2.34) = 3
ceiling(2) = 2
ceiling(2.99) = 3

cos

🔗

Function

Patterns:
  • cos(n: number)
Since: 2.2
Return Type: Number
The cosine function. This is basically the sine shifted by 90°, i.e. cos(a) = sin(a + 90°), for any number a. Uses degrees, not radians.

Examples:

cos(0) = 1
cos(90) = 0

date

🔗

Function

Patterns:
  • date(year: number, month: number, day: number, hour: number = [[integer:0]], minute: number = [[integer:0]], second: number = [[integer:0]], millisecond: number = [[integer:0]], zone_offset: number = [[double:NaN]], dst_offset: number = [[double:NaN]])
Since: 2.2
Return Type: Date
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).

Examples:

date(2014, 10, 1) # 0:00, 1st October 2014
date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990
date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)

exp

🔗

Function

Patterns:
  • exp(n: number)
Since: 2.2
Return Type: Number
The exponential function. You probably don't need this if you don't know what this is.

Examples:

exp(0) = 1
exp(1) = 2.7183

floor

🔗

Function

Patterns:
  • floor(n: number)
Since: 2.2
Return Type: long
Rounds a number down, i.e. returns the closest integer smaller than or equal to the argument.

Examples:

floor(2.34) = 2
floor(2) = 2
floor(2.99) = 2

ln

🔗

Function

Patterns:
  • ln(n: number)
Since: 2.2
Return Type: Number
The natural logarithm. You probably don't need this if you don't know what this is. Returns NaN (not a number) if the argument is negative.

Examples:

ln(1) = 0
ln(exp(5)) = 5
ln(2) = 0.6931

location

🔗

Function

Patterns:
  • location(x: number, y: number, z: number, world: world = event-world, yaw: number = [[integer:0]], pitch: number = [[integer:0]])
Since: 2.2
Return Type: Location
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.

Examples:

location(0, 128, 0)
location(player's x-coordinate, player's y-coordinate + 5, player's z-coordinate, player's world, 0, 90)
location(0, 64, 0, world "world_nether")
location(100, 110, -145, world("my_custom_world"))

log

🔗

Function

Patterns:
  • log(n: number, base: number = [[integer:10]])
Since: 2.2
Return Type: Number
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.

Examples:

log(100) = 2 # 10^2 = 100
log(16, 2) = 4 # 2^4 = 16

max

🔗

Function

Patterns:
  • max(ns: numbers)
Since: 2.2
Return Type: Number
Returns the maximum number from a list of numbers.

Examples:

max(1) = 1
max(1, 2, 3, 4) = 4
max({some list variable::*})

min

🔗

Function

Patterns:
  • min(ns: numbers)
Since: 2.2
Return Type: Number
Returns the minimum number from a list of numbers.

Examples:

min(1) = 1
min(1, 2, 3, 4) = 1
min({some list variable::*})

mod

🔗

Function

Patterns:
  • mod(d: number, m: number)
Since: 2.2
Return Type: Number
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.

Examples:

mod(3, 2) = 1
mod(256436, 100) = 36
mod(-1, 10) = 9

product

🔗

Function

Patterns:
  • product(ns: numbers)
Since: 2.2
Return Type: Number
Calculates the product of a list of numbers.

Examples:

product(1) = 1
product(2, 3, 4) = 24
product({some list variable::*})
product(2, {_v::*}, and the player's y-coordinate)

rgb

🔗

Function

Patterns:
  • rgb(red: long, green: long, blue: long)
Since: 2.5
Return Type: Color
Returns a RGB color from the given red, green and blue parameters.

Examples:

dye player's leggings rgb(120, 30, 45)

round

🔗

Function

Patterns:
  • round(n: number)
Since: 2.2
Return Type: long
Rounds a number, i.e. returns the closest integer to the argument.

Examples:

round(2.34) = 2
round(2) = 2
round(2.99) = 3
round(2.5) = 3

sin

🔗

Function

Patterns:
  • sin(n: number)
Since: 2.2
Return Type: Number
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.

Examples:

sin(90) = 1
sin(60) = 0.866

sqrt

🔗

Function

Patterns:
  • sqrt(n: number)
Since: 2.2
Return Type: Number
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.

Examples:

sqrt(4) = 2
sqrt(2) = 1.4142
sqrt(-1) = NaN

sum

🔗

Function

Patterns:
  • sum(ns: numbers)
Since: 2.2
Return Type: Number
Sums a list of numbers.

Examples:

sum(1) = 1
sum(2, 3, 4) = 9
sum({some list variable::*})
sum(2, {_v::*}, and the player's y-coordinate)

tan

🔗

Function

Patterns:
  • tan(n: number)
Since: 2.2
Return Type: Number
The tangent function. This is basically sin(arg)/cos(arg). Uses degrees, not radians.

Examples:

tan(0) = 0
tan(45) = 1
tan(89.99) = 5729.5779

vector

🔗

Function

Patterns:
  • vector(x: number, y: number, z: number)
Since: 2.2-dev23
Return Type: Vector
Creates a new vector, which can be used with various expressions, effects and functions.

Examples:

vector(0, 0, 0)

world

🔗

Function

Patterns:
  • world(name: string)
Since: 2.2
Return Type: World
Gets a world from its name.

Examples:

set {_nether} to world("%{_world}%_nether")
\ No newline at end of file + Skript Documentation - 2.6.3

All Elements

Absorbed blocks

🔗

Expression

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

Examples:

the absorbed blocks

Affected Entities

🔗

Expression

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

Examples:

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

Age of Block/Entity

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type:
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.

Examples:

# Set targeted crop to fully grown crop
set age of targeted block to maximum age of targeted block

# Spawn a baby cow that will only need 1 minute to become an adult
spawn a baby cow at player
set age of last spawned entity to -1200 # in ticks = 60 seconds

All Groups

🔗

Expression

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

Examples:

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

All Permissions

🔗

Expression

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

Examples:

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

All Scripts

🔗

Expression

Patterns:
  • [all [of the]] scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (enabled|loaded) scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (disabled|unloaded) scripts [(without ([subdirectory] paths|parents))]
Since: 2.5
Return Type: string
Returns all of the scripts, or just the enabled or disabled ones.

Examples:

command /scripts:
    trigger:
        send "All Scripts: %scripts%" to player
        send "Loaded Scripts: %enabled scripts%" to player
        send "Unloaded Scripts: %disabled scripts%" to player

All commands

🔗

Expression

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

Examples:

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

Alphabetical Sort

🔗

Expression

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

Examples:

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

Altitude

🔗

Expression

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

Examples:

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

Amount

🔗

Expression

Patterns:
  • [the] (amount|number|size) of %objects%
  • [the] recursive (amount|number|size) of %objects%
Since: 1.0
Return Type:
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.

Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.

 {list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6

Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!

Examples:

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

Amount of Items

🔗

Expression

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

Examples:

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

Applied Enchantments

🔗

Expression

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

Examples:

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

Argument

🔗

Expression

Patterns:
  • [the] last arg[ument]
  • [the] arg[ument](-| )<(\d+)>
  • [the] <(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th> arg[ument][s]
  • [(all [[of] the]|the)] arg[ument][s]
  • [the] %*type%( |-)arg[ument][( |-)<\d+>]
  • [the] arg[ument]( |-)%*type%[( |-)<\d+>]
Since: 1.0, INSERT VERSION (support for command events)
Return Type: object
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.

Examples:

give the item-argument to the player-argument
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument

Arithmetic

🔗

Expression

Patterns:
Since: 1.4.2
Return Type: number
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.

Examples:

set the player's health to 10 - the player's health
loop (argument + 2) / 5 times:
    message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"

Armour Slot

🔗

Expression

Patterns:
  • [the] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)] of %living entities%
  • %living entities%'[s] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)]
Since: 1.0
Return Type: slot
A part of a player's armour, i.e. the boots, leggings, chestplate or helmet.

Examples:

set chestplate of the player to a diamond chestplate
helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin

Arrow Knockback Strength

🔗

Expression

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

Examples:

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

Arrows Stuck

🔗

Expression

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

Examples:

set arrows stuck in player to 5

Attack Cooldown

🔗

Expression

Patterns:
Since: 2.6.1
Requirements: Minecraft 1.15+
Return Type:
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.

Examples:

on damage:
    if attack cooldown of attacker < 1:
        set damage to 0
        send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker

Attacked

🔗

Expression

Patterns:
  • [the] (attacked|damaged|victim) [<(.+)>]
Since: 1.3, 2.6.1 (projectile hit event)
Usable in events: damage, death, projectile hit
Return Type: entity
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.

Examples:

on damage:
    victim is a creeper
    damage the attacked by 1 heart

Attacker

🔗

Expression

Patterns:
  • [the] (attacker|damager)
Since: 1.3
Usable in events: damage, death, destroy
Return Type: entity
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.

Examples:

on damage:
    attacker is a player
    health of attacker is less than or equal to 2
    damage victim by 1 heart

Bed

🔗

Expression

Patterns:
  • [the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offline players%
  • %offline players%'[s] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]]
Since: 2.0, INSERT VERSION (offlineplayers, safe bed)
Return Type: location
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.

NOTE: Offline players can not have their bed location changed, only online players.

Examples:

if bed of player exists:
    teleport player the the player's bed
else:
    teleport the player to the world's spawn point

set the bed location of player to spawn location of world("world") # unsafe/invalid bed location
set the safe bed location of player to spawn location of world("world") # safe/valid bed location

Biome

🔗

Expression

Patterns:
Since: 1.4.4, 2.6.1 (3D biomes)
Return Type: biome
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).

Examples:

# damage player in deserts constantly
every real minute:
    loop all players:
        biome at loop-player is desert
        damage the loop-player by 1

Block

🔗

Expression

Patterns:
  • [the] [event-]block
Since: 1.0
Return Type: block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block

🔗

Expression

Patterns:
Since: 1.0
Return Type: block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block Data

🔗

Expression

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

Examples:

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

Block Hardness

🔗

Expression

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

Examples:

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

Block Sphere

🔗

Expression

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

Examples:

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

Blocks

🔗

Expression

Patterns:
Since: 1.0, 2.5.1 (within/cuboid/chunk)
Return Type: block
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.

Examples:

loop blocks above the player:
loop blocks between the block below the player and the targeted block:
set the blocks below the player, the victim and the targeted block to air
set all blocks within {loc1} and {loc2} to stone
set all blocks within chunk at player to air

Blocks in Region

🔗

Expression

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

Examples:

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

Book Author

🔗

Expression

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

Examples:

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

Book Pages

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: string
The pages of a book.

Examples:

on book sign:
    message "Book Pages: %pages of event-item%"
    message "Book Page 1: %page 1 of event-item%"

Book Title

🔗

Expression

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

Examples:

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

Burn/Cook Time

🔗

Expression

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

Examples:

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

Case Text

🔗

Expression

Patterns:
  • %texts% in (upper|lower)[ ]case
  • (upper|lower)[ ]case %texts%
  • capitali(s|z)ed %texts%
  • %texts% in [(lenient|strict) ](proper|title)[ ]case
  • [(lenient|strict) ](proper|title)[ ]case %texts%
  • %texts% in [(lenient|strict) ]camel[ ]case
  • [(lenient|strict) ]camel[ ]case %texts%
  • %texts% in [(lenient|strict) ]pascal[ ]case
  • [(lenient|strict) ]pascal[ ]case %texts%
  • %texts% in [(lower|upper|capital|screaming)[ ]]snake[ ]case
  • [(lower|upper|capital|screaming)[ ]]snake[ ]case %texts%
  • %texts% in [(lower|upper|capital)[ ]]kebab[ ]case
  • [(lower|upper|capital)[ ]]kebab[ ]case %texts%
Since: 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases)
Return Type: string
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case

Examples:

"Oops!" in lowercase # oops!
"oops!" in uppercase # OOPS!
"hellO i'm steve!" in proper case # HellO I'm Steve!
"hellO i'm steve!" in strict proper case # Hello I'm Steve!
"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()
"spAwn neW boSs ()" in strict camel case # spawnNewBoss()
"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()
"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()
"Hello Player!" in snake case # Hello_Player!
"Hello Player!" in lower snake case # hello_player!
"Hello Player!" in upper snake case # HELLO_PLAYER!
"What is your name?" in kebab case # What-is-your-name?
"What is your name?" in lower kebab case # what-is-your-name?
"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?

Chat Format

🔗

Expression

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

Examples:

set the chat format to "<yellow>[player]<light gray>: <green>[message]"

Chat Recipients

🔗

Expression

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

Examples:

chat recipients

Chunk

🔗

Expression

Patterns:
Since: 2.0
Return Type: chunk
The chunk a block, location or entity is in.

Examples:

add the chunk at the player to {protected chunks::*}

Clicked Block/Entity/Inventory/Slot

🔗

Expression

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

Examples:

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

Color of

🔗

Expression

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

Examples:

on click on wool:
    message "This wool block is <%color of block%>%color of block%!"
    set the color of the block to black

Colored / Uncolored

🔗

Expression

Patterns:
  • (colo[u]r-|colo[u]red )%texts%
  • (format-|formatted )%texts%
  • (un|non)[-](colo[u]r-|colo[u]red |format-|formatted )%texts%
Since: 2.0
Return Type: string
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.

Examples:

on chat:
    set message to colored message # Safe; only colors get parsed
command /fade <player>:
    trigger:
        set display name of the player-argument to uncolored display name of the player-argument
command /format <text>:
    trigger:
        message formatted text-argument # Safe, because we're sending to whoever used this command

Command

🔗

Expression

Patterns:
  • [the] (full|complete|whole) command
  • [the] command [(label|alias)]
Since: 2.0, INSERT VERSION (support for script commands)
Usable in events: command
Return Type: string
The command that caused an 'on command' event (excluding the leading slash and all arguments)

Examples:

# prevent any commands except for the /exit command during some game
on command:
    if {game::%player%::playing} is true:
        if the command is not "exit":
            message "You're not allowed to use commands during the game"
            cancel the event

Command Info

🔗

Expression

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

Examples:

main name of command "skript"
description of command "help"
label of command "pl"
usage of command "help"
aliases of command "bukkit:help"
permission of command "/op"
command "op"'s permission message
command "sk"'s plugin owner

Command Sender

🔗

Expression

Patterns:
  • [the] [command['s]] (sender|executor)
Since: 2.0
Usable in events: command
Return Type: commandsender
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%

Examples:

make the command sender execute "/say hi!"
on command:
    log "%executor% used command /%command% %arguments%" to "commands.log"

Compass Target

🔗

Expression

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

Examples:

# make all player's compasses target a player stored in {compass::target::%player%}
every 5 seconds:
    loop all players:
        set the loop-player's compass target to location of {compass::target::%%loop-player%}

Console

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])
  • [the] last usage [date] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
Since: 2.2-dev33
Return Type: object
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.

Examples:

command /home:
    cooldown: 10 seconds
    cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
    trigger:
        teleport player to {home::%player%}

Coordinate

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] [event-]<.+>
Since: 1.0
Return Type: entity
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.

Examples:

give a diamond sword of sharpness 3 to the player
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow

Cursor Slot

🔗

Expression

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

Examples:

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

Custom Chest Inventory

🔗

Expression

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

Examples:

open chest inventory with 1 row named "test" to player
set {_inventory} to chest inventory with 1 row

Custom Model Data

🔗

Expression

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

Examples:

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

Damage

🔗

Expression

Patterns:
  • [the] damage
Since: 1.3.5
Usable in events: damage
Return Type: number
How much damage is done in a damage event, possibly ignoring armour, criticals and/or enchantments. Can be changed (remember that in Skript '1' is one full heart, not half a heart).

Examples:

increase the damage by 2

Damage Cause

🔗

Expression

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

Examples:

damage cause is lava, fire or burning

Damaged Item

🔗

Expression

Patterns:
Since: 2.4
Return Type: itemtype
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks

Examples:

give player diamond sword with damage value 100
set player's tool to diamond hoe damaged by 250
give player diamond sword with damage 700 named "BROKEN SWORD"
set {_item} to diamond hoe with damage value 50 named "SAD HOE"
set target block of player to wool with data value 1
set target block of player to potato plant with data value 7

Data/Damage Value

🔗

Expression

Patterns:
Since: 1.2
Return Type:
The data/damage value of an item/block. Data values of blocks are only supported on 1.12.2 and below. You usually don't need this expression as you can check and set items with aliases easily, but this expression can e.g. be used to "add 1 to data of <item>", e.g. for cycling through all wool colors.

Examples:

set damage value of player's tool to 10
set data value of target block of player to 3
add 1 to the data value of the clicked block
reset data value of block at player

Date Ago/Later

🔗

Expression

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

Examples:

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

Default Value

🔗

Expression

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

Examples:

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

Difference

🔗

Expression

Patterns:
Since: 1.4
Return Type: object
The difference between two values, e.g. numbers, dates or times.

Examples:

if difference between {command::%player%::lastuse} and now is smaller than a minute:
    message "You have to wait a minute before using this command again!"

Difficulty

🔗

Expression

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

Examples:

set the difficulty of "world" to hard

Direction

🔗

Expression

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

Examples:

thrust the player upwards
set the block behind the player to water
loop blocks above the player:
    set {_rand} to a random integer between 1 and 10
    set the block {_rand} meters south east of the loop-block to stone
block in horizontal facing of the clicked entity from the player is air
spawn a creeper 1.5 meters horizontally behind the player
spawn a TNT 5 meters above and 2 meters horizontally behind the player
thrust the last spawned TNT in the horizontal direction of the player with speed 0.2
push the player upwards and horizontally forward at speed 0.5
push the clicked entity in in the direction of the player at speed -0.5
open the inventory of the block 2 blocks below the player to the player
teleport the clicked entity behind the player
grow a regular tree 2 meters horizontally behind the player

Distance

🔗

Expression

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

Examples:

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

Drops

🔗

Expression

Patterns:
  • [the] drops
Since: 1.0
Usable in events: death
Return Type: itemtype
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.

Examples:

clear drops
remove 4 planks from the drops

Drops Of Block

🔗

Expression

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

Examples:

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

Element of

🔗

Expression

Patterns:
  • ([the] first|[the] last|[a] random|%number%(st|nd|rd|th)) element [out] of %objects%
Since: 2.0
Return Type: object
The first, last or a random element of a set, e.g. a list variable. See also: random

Examples:

give a random element out of {free items::*} to the player

Enchant Item

🔗

Expression

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

Examples:

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

Enchanting Experience Cost

🔗

Expression

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

Examples:

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

Enchantment Bonus

🔗

Expression

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

Examples:

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

Enchantment Level

🔗

Expression

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

Examples:

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

Enchantment Offer

🔗

Expression

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

Examples:

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

Enchantment Offer Cost

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.11 or newer
Return Type:
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.

Examples:

set cost of enchantment offer 1 to 50

Ender Chest

🔗

Expression

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

Examples:

open the player's ender chest to the player

Entities

🔗

Expression

Patterns:
Since: 1.2.1, 2.5 (chunks)
Return Type: entity
All entities in all worlds, in a specific world, in a chunk or in a radius around a certain location, e.g. all players, all creepers in the player's world, or players in radius 100 of the player.

Examples:

kill all creepers in the player's world
send "Psst!" to all players within 100 meters of the player
give a diamond to all ops
heal all tamed wolves in radius 2000 around {town center}
delete all monsters in chunk at player

Entity AI

🔗

Expression

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

Examples:

set artificial intelligence of target entity to false

Entity Attribute

🔗

Expression

Patterns:
Since: 2.5, 2.6.1 (final attribute value)
Return Type: number
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.

Examples:

on damage of player:
    send "You are wounded!"
    set victim's attack speed attribute to 2

Entity Owner

🔗

Expression

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

Examples:

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

Exhaustion

🔗

Expression

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

Examples:

set exhaustion of all players to 1

Experience

🔗

Expression

Patterns:
  • [the] [(spawned|dropped)] [e]xp[erience] [orb[s]]
Since: 2.1, 2.5.3 (block break event)
Usable in events: experience spawn, break / mine
Return Type: experience
How much experience was spawned in an experience spawn or block break event. Can be changed.

Examples:

on experience spawn:
    add 5 to the spawned experience
on break of coal ore:
    clear dropped experience
on break of diamond ore:
    if tool of player = diamond pickaxe:
        add 100 to dropped experience

Exploded Blocks

🔗

Expression

Patterns:
  • [the] exploded blocks
Since: 2.5
Usable in events: explode
Return Type: block
Get all the blocks that were destroyed in an explode event

Examples:

on explode:
    loop exploded blocks:
        add loop-block to {exploded::blocks::*}

Explosion Block Yield

🔗

Expression

Patterns:
  • [the] [explosion['s]] block (yield|amount)
  • [the] percentage of blocks dropped
Since: 2.5
Usable in events: explosion
Return Type: number
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.

Examples:

on explode:
set the explosion's block yield to 10%

Explosion Yield

🔗

Expression

Patterns:
  • [the] explosion (yield|radius|size)
  • [the] (yield|radius|size) of [the] explosion
Since: 2.5
Usable in events: explosion prime
Return Type: number
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information

Examples:

on explosion prime:
    set the yield of the explosion to 10

Explosive Yield

🔗

Expression

Patterns:
  • [the] explosive (yield|radius|size) of %entities%
  • %entities%'[s] explosive (yield|radius|size)
Since: 2.5
Requirements: Minecraft 1.12 or newer for creepers
Return Type: number
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information

Examples:

on spawn of a creeper:
    set the explosive yield of the event-entity to 10

Facing

🔗

Expression

Patterns:
Since: 1.4
Return Type: direction
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')

Examples:

# makes a bridge
loop blocks from the block below the player in the horizontal facing of the player:
    set loop-block to cobblestone

Fall Distance

🔗

Expression

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

Examples:

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

Fertilized Blocks

🔗

Expression

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

Examples:

the fertilized blocks

Filter

🔗

Expression

Patterns:
  • %objects% (where|that match) \[<.+>\]
Since: 2.2-dev36
Return Type: object
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.

Examples:

send "congrats on being staff!" to all players where [player input has permission "staff"]

Filter Input

🔗

Expression

Patterns:
  • input
  • %*type% input
Since: 2.2-dev36
Return Type: object
Represents the input in a filter expression. 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.

Examples:

send "congrats on being staff!" to all players where [input has permission "staff"]

Final Damage

🔗

Expression

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

Examples:

send "%final damage%" to victim

Firework Effect

🔗

Expression

Patterns:
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors%
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors% fad(e|ing) [to] %colors%
Since: 2.4
Return Type: fireworkeffect
Represents a 'firework effect' which can be used in the launch firework effect.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Flight Mode

🔗

Expression

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

Examples:

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

Food Level

🔗

Expression

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

Examples:

set the player's food level to 10

Formatted Date

🔗

Expression

Patterns:
  • %dates% formatted [human-readable] [(with|as) %text%]
  • [human-readable] formatted %dates% [(with|as) %text%]
Since: 2.2-dev31, INSERT VERSION (support variables in format)
Return Type: string
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.

Examples:

command /date:
    trigger:
        send "Full date: %now formatted human-readable%" to sender
        send "Short date: %now formatted as ""yyyy-MM-dd""%" to sender

Former/Future State

🔗

Expression

Patterns:
  • [the] (former|past|old) [state] [of] %~object%
  • %~object% before [the event]
  • [the] (future|to-be|new) [state] [of] %~object%
  • %~object%(-to-be| after[(wards| the event)])
Since: 1.1
Return Type: object
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.

Examples:

on teleport:
    former world was "world_nether" # or 'world was'
    world will be "world" # or 'world after the event is'
on tool change:
    past tool is an axe
    the tool after the event will be air
on weather change:
    set {weather::%world%::old} to past weather
    set {weather::%world%::current} to the new weather

Freeze Time

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type: timespan
How much time an entity has been in powdered snow for.

Examples:

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

Furnace Slot

🔗

Expression

Patterns:
  • (fuel|result) [slot]
  • (ore|fuel|result)[s] [slot[s]] of %blocks%
  • %blocks%'[s] (ore|fuel|result)[s] [slot[s]]
Since: 1.0
Usable in events: smelt, fuel burn
Return Type: slot
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not 'furnace', as 'furnace' is not an existing expression.

Examples:

set the fuel slot of the clicked block to a lava bucket
set the block's ore slot to 64 iron ore
give the result of the block to the player
clear the result slot of the block

Game Mode

🔗

Expression

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

Examples:

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

Gamerule Value

🔗

Expression

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

Examples:

set the gamerule commandBlockOutput of world "world" to false

Gliding State

🔗

Expression

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

Examples:

set gliding of player to off

Glowing

🔗

Expression

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

Examples:

set glowing of player to true

Gravity

🔗

Expression

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

Examples:

set gravity of player off

Group

🔗

Expression

Patterns:
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: string
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed.

Examples:

on join:
    broadcast "%group of player%" # this is the player's primary group
    broadcast "%groups of player%" # this is all of the player's groups

Hanging Entity/Remover

🔗

Expression

Patterns:
  • [the] hanging (entity|remover)
Since: 2.6.2
Return Type: entity
Returns the hanging entity or remover in hanging break and place events.

Examples:

on break of item frame:
    if item of hanging entity is diamond pickaxe:
        cancel event
        if hanging remover is a player:
            send "You can't break that item frame!" to hanging remover

Hash

🔗

Expression

Patterns:
  • %texts% hash[ed] with (MD5|SHA-256)
Since: 2.0, 2.2-dev32 (SHA-256 algorithm)
Return Type: string
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.

MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!

Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.

Examples:

command /setpass <text>:
    trigger:
        set {password::%uuid of player%} to text-argument hashed with SHA-256
command /login <text>:
    trigger:
        if text-argument hashed with SHA-256 is {password::%uuid of player%}:
            message "Login successful."
        else:
            message "Wrong password!"

Hatching Entity Type

🔗

Expression

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

Examples:

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

Hatching Number

🔗

Expression

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

Examples:

on player egg throw:
    set the hatching number to 10

Head location

🔗

Expression

Patterns:
Since: 2.0
Return Type: location
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.

Examples:

set the block at the player's head to air
set the block in front of the player's eyes to glass
loop blocks in front of the player's head:

Heal Amount

🔗

Expression

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

Examples:

increase heal amount by 2
remove 0.5 from heal amount

Heal Reason

🔗

Expression

Patterns:
  • (regen|health regain|heal) (reason|cause)
Since: 2.5
Return Type: healreason
The heal reason of a heal event. Please click on the link for more information.

Examples:

on heal:
    if heal reason = satiated:
        send "You ate enough food and gained health back!" to player

Health

🔗

Expression

Patterns:
Since: 1.0
Usable in events: damage
Return Type: number
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).

Examples:

message "You have %health% HP left."

Hidden Players

🔗

Expression

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

Examples:

message "<light red>You are currently hiding: <light gray>%hidden players of the player%"

Highest Solid Block

🔗

Expression

Patterns:
  • highest [(solid|non-air)] block at %locations%
Since: 2.2-dev34
Return Type: block
Returns the highest solid block at the x and z coordinates of the world of a given location.

Examples:

highest block at location of arg-player

Hostname

🔗

Expression

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

Examples:

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

Hotbar Button

🔗

Expression

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

Examples:

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

Hotbar Slot

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] hotbar slot of %players%
  • %players%'[s] [([currently] selected|current)] hotbar slot
Since: 2.2-dev36
Return Type: slot
The currently selected hotbar slot. To retrieve its number use Slot Index expression.

Examples:

message "%player's current hotbar slot%"
set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left

Hover List

🔗

Expression

Patterns:
  • [the] [custom] [(player|server)] (hover|sample) ([message] list|message)
  • [the] [custom] player [(hover|sample)] list
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: string
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.

Examples:

on server list ping:
    clear the hover list
    add "&aWelcome to the &6Minecraft &aserver!" to the hover list
    add "" to the hover list # A blank line
    add "&cThere are &6%online players count% &conline players!" to the hover list

Humidity

🔗

Expression

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

Examples:

set {_humidity} to event-block's humidity

IP

🔗

Expression

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

Examples:

ban the IP address of the player
broadcast "Banned the IP %IP of player%"

on connect:
    log "[%now%] %player% (%ip%) is connected to the server."

on server list ping:
    send "%IP-address%" to the console

Id

🔗

Expression

Patterns:
Since: 1.0
Return Type:
The id of a specific item. You usually don't need this expression as you can likely do everything with aliases.

Examples:

message "the ID of %type of the clicked block% is %id of the clicked block%."

Index Of

🔗

Expression

Patterns:
  • [the] [(first|last)] index of %text% in %text%
Since: 2.1
Return Type:
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.

Examples:

set {_first} to the first index of "@" in the text argument
if {_s} contains "abc":
    set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}

Indices of List

🔗

Expression

Patterns:
  • [(the|all [[of] the])] (indexes|indices) of %~objects%
  • %~objects%'[s] (indexes|indices)
  • [sorted] (indices|indexes) of %~objects% in (ascending|descending) order
  • [sorted] %~objects%'[s] (indices|indexes) in (ascending|descending) order
Since: 2.4 (indices), 2.6.1 (sorting)
Return Type: string
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.

Examples:

set {l::*} to "some", "cool" and "values"
broadcast "%indices of {l::*}%" # result is 1, 2 and 3

set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first

Inventory

🔗

Expression

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

Examples:

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

Inventory Action

🔗

Expression

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

Examples:

inventory action is pickup all

Inventory Holder/Viewers/Rows/Slots

🔗

Expression

Patterns:
  • (holder[s]|viewers|[amount of] rows|[amount of] slots) of %inventories%
  • %inventories%'[s] (holder[s]|viewers|[amount of] rows|[amount of] slots)
Since: 2.2-dev34, 2.5 (slots)
Return Type: object
Gets the amount of rows/slots, viewers and holder of an inventory.

NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.

Examples:

event-inventory's amount of rows
holder of player's top inventory
{_inventory}'s viewers

Inventory Slot

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: slot
Represents a slot in an inventory. It can be used to change the item in an inventory too.

Examples:

if slot 0 of player is air:
    set slot 0 of player to 2 stones
    remove 1 stone from slot 0 of player
    add 2 stones to slot 0 of player
    clear slot 1 of player

Item

🔗

Expression

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

Examples:

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

Item Amount

🔗

Expression

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

Examples:

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

Item Enchantments

🔗

Expression

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

Examples:

clear enchantments of event-item

Item of an Entity

🔗

Expression

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

Examples:

Missing examples.

Item with CustomModelData

🔗

Expression

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

Examples:

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

Item with Lore

🔗

Expression

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

Examples:

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

Items In

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
Since: 2.0
Return Type: slot
All items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.

Examples:

loop all items in the player's inventory:
    loop-item is enchanted
    remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory

Join & Split

🔗

Expression

Patterns:
  • (concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]
  • split %text% (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • %text% split (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • regex split %text% (at|using|by) [[the] delimiter] %text%
  • regex %text% split (at|using|by) [[the] delimiter] %text%
Since: 2.1, 2.5.2 (regex support), INSERT VERSION (case sensitivity)
Return Type: string
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.

Examples:

message "Online players: %join all players with "" | ""%" # %all players% would use the default "x, y, and z"
set {_s::*} to the string argument split at ","

Language

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%
  • %players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]
Since: 2.3
Return Type: string
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.

Examples:

message player's current language

Last Attacker

🔗

Expression

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

Examples:

send "%last attacker of event-entity%"

Last Color

🔗

Expression

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

Examples:

set {_color} to the last colors of "heyyo"

Last Damage

🔗

Expression

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

Examples:

set last damage of event-entity to 2

Last Damage Cause

🔗

Expression

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

Examples:

set last damage cause of event-entity to fire tick

Last Loaded Server Icon

🔗

Expression

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

Examples:

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

Last Resource Pack Response

🔗

Expression

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

Examples:

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

Last Spawned Entity

🔗

Expression

Patterns:
  • [the] [last[ly]] (spawned|shot) %*entity type%
  • [the] [last[ly]] dropped (item)
  • [the] [last[ly]] (created|struck) (lightning)
  • [the] [last[ly]] (launched|deployed) (firework)
Since: 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), INSERT VERSION (struck lightning, firework)
Return Type: entity
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.

Examples:

spawn a priest
set {healer::%spawned priest%} to true
shoot an arrow from the last spawned entity
ignite the shot projectile
drop a diamond sword
push last dropped item upwards
teleport player to last struck lightning
delete last launched firework

Last/First Login Time

🔗

Expression

Patterns:
Since: 2.5
Return Type: date
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.

Examples:

command /onlinefor:
    trigger:
        send "You have been online for %difference between player's last login and now%."
        send "You first joined the server %difference between player's first login and now% ago."

Leash Holder

🔗

Expression

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

Examples:

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

Length

🔗

Expression

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

Examples:

set {_l} to length of the string argument

Level

🔗

Expression

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

Examples:

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

Level Progress

🔗

Expression

Patterns:
Since: 2.0
Usable in events: level change
Return Type: number
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.

Examples:

# use the exp bar as mana
on rightclick with a blaze rod:
    player's level progress is larger than 0.2
    shoot a fireball from the player
    reduce the player's level progress by 0.2
every 2 seconds:
    loop all players:
        level progress of loop-player is smaller than 0.9:
            increase level progress of the loop-player by 0.1
        else:
            set level progress of the loop-player to 0.99
on xp spawn:
    cancel event

Light Level

🔗

Expression

Patterns:
Since: 1.3.4
Return Type:
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.

Examples:

# set vampire players standing in bright sunlight on fire
every 5 seconds:
    loop all players:
        {vampire::%uuid of loop-player%} is true
        sunlight level at the loop-player is greater than 10
        ignite the loop-player for 5 seconds

Loaded Plugins

🔗

Expression

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

Examples:

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

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

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

Patterns:
Since: Unknown
Return Type: location
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.

Examples:

set {home::%uuid of player%} to the location of the player
message "You home was set to %player's location% in %player's world%."

Location At

🔗

Expression

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

Examples:

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

Loop value

🔗

Expression

Patterns:
  • [the] loop-<.+>
Since: 1.0
Return Type: object
The currently looped value.

Examples:

# countdown:
loop 10 times:
    message "%11 - loop-number%"
    wait a second
# generate a 10x10 floor made of randomly colored wool below the player:
loop blocks from the block below the player to the block 10 east of the block below the player:
    loop blocks from the loop-block to the block 10 north of the loop-block:
        set loop-block-2 to any wool

Lore

🔗

Expression

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

Examples:

set the 1st line of the item's lore to "<orange>Excalibur 2.0"

MOTD

🔗

Expression

Patterns:
  • [the] [(default)|(shown|displayed)] (MOTD|message of [the] day)
Since: 2.3
Return Type: string
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.

Examples:

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

Max Durability

🔗

Expression

Patterns:
Since: 2.5
Return Type:
The maximum durability of an item.

Examples:

maximum durability of diamond sword
if max durability of player's tool is not 0: # Item is damageable

Max Health

🔗

Expression

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

Examples:

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

Max Minecart Speed

🔗

Expression

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

Examples:

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

Max Players

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] player[s] [(count|amount|number|size)]
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] (count|amount|number|size) of players
Since: 2.3
Return Type:
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server always and can't be changed.

Examples:

on server list ping:
    set the max players count to (online players count + 1)

Maximum Freeze Time

🔗

Expression

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

Examples:

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

Maximum Stack Size

🔗

Expression

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

Examples:

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

Me

🔗

Expression

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

Examples:

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

Mending Repair Amount

🔗

Expression

Patterns:
  • [the] [mending] repair amount
Since: 2.5.1
Return Type:
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.

Examples:

on item mend:
    set the mending repair amount to 100

Message

🔗

Expression

Patterns:
  • [the] [chat( |-)]message
  • [the] (join|log[ ]in)( |-)message
  • [the] (quit|leave|log[ ]out|kick)( |-)message
  • [the] death( |-)message
Since: 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message)
Usable in events: chat, join, quit, death
Return Type: string
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, or the death message on a death event. This expression is mostly useful for being changed.

Examples:

on chat:
    player has permission "admin"
    set message to "&c%message%"

on first join:
    set join message to "Welcome %player% to our awesome server!"

on join:
    player has played before
    set join message to "Welcome back, %player%!"

on quit:
    set quit message to "%player% left this awesome server!"

on death:
    set the death message to "%player% died!"

Metadata

🔗

Expression

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

Examples:

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

Middle of Location

🔗

Expression

Patterns:
  • [the] (middle|center) [point] of %location%
  • %location%'[s] (middle|center) [point]
Since: 2.6.1
Return Type: location
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.

Examples:

command /stuck:
    executable by: players
    trigger:
        teleport player to the center of player's location
        send "You're no longer stuck."

Minecart Derailed / Flying Velocity

🔗

Expression

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

Examples:

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

Money

🔗

Expression

Patterns:
Since: 2.0, 2.5 (offline players)
Requirements: Vault, an economy plugin that supports Vault
Return Type: money
How much virtual money a player has (can be changed).

Examples:

message "You have %player's money%" # the currency name will be added automatically
remove 20$ from the player's balance # replace '$' by whatever currency you use
add 200 to the player's account # or omit the currency altogether

Moved blocks

🔗

Expression

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

Examples:

the moved blocks

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: string
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
  • [the] ((player|tab)[ ]list name[s]) of %players%
  • %players%'[s] ((player|tab)[ ]list name[s])
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: string
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Named Item/Inventory

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev34 (inventories)
Return Type: object
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.

Examples:

give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player
set tool of player to the player's tool named "<gold>Wand"
set the name of the player's tool to "<gold>Wand"
open hopper inventory named "Magic Hopper" to player

New Line

🔗

Expression

Patterns:
  • n[ew]l[ine]
  • line[ ]break
Since: 2.5
Return Type: string
Returns a line break separator.

Examples:

send "Hello%nl%Goodbye!" to player

No Damage Ticks

🔗

Expression

Patterns:
Since: 2.5
Return Type:
The number of ticks that an entity is invulnerable to damage for.

Examples:

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

Now

🔗

Expression

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

Examples:

broadcast "Current server time: %now%"

Number of Characters

🔗

Expression

Patterns:
  • number of upper[ ]case char(acters|s) in %text%
  • number of lower[ ]case char(acters|s) in %text%
  • number of digit char(acters|s) in %text%
Since: 2.5
Return Type:
The number of uppercase, lowercase, or digit characters in a string.

Examples:

#Simple Chat Filter
on chat:
    if number of uppercase chars in message / length of message > 0.5
        cancel event
        send "<red>Your message has to many caps!" to player

Numbers

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%
Since: 1.4.6 (integers & numbers), 2.5.1 (decimals)
Return Type: number
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'

Examples:

loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5
loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5
loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4

Offline players

🔗

Expression

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

Examples:

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

Online Player Count

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)
  • [the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online players
Since: 2.3
Return Type:
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. 'real online player count' always returns the real count of online players and can't be changed.

Fake online player count requires PaperSpigot 1.12.2+.

Examples:

on server list ping:
    # This will make the max players count 5 if there are 4 players online.
    set the fake max players count to (online players count + 1)

Opened Inventory

🔗

Expression

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

Examples:

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

Parse

🔗

Expression

Patterns:
Since: 2.0
Return Type: object
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.

Examples:

set {var} to line 1 parsed as number
on chat:
    set {var::*} to message parsed as "buying %items% for %money%"
    if parse error is set:
        message "%parse error%"
    else if {var::*} is set:
        cancel event
        remove {var::2} from the player's balance
        give {var::1::*} to the player

Parse Error

🔗

Expression

Patterns:
  • [the] [last] [parse] error
Since: 2.0
Return Type: string
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.

Examples:

set {var} to line 1 parsed as integer
if {var} is not set:
    parse error is set:
        message "<red>Line 1 is invalid: %last parse error%"
    else:
        message "<red>Please put an integer on line 1!"

Passenger

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)
Return Type: entity
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle

Examples:

#for 1.11 and lower
passenger of the minecart is a creeper or a cow
the saddled pig's passenger is a player
#for 1.11.2+
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat

Pickup Delay

🔗

Expression

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

Examples:

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

Ping

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type:
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).

Examples:

command /ping :
    trigger:
        send "%arg-1%'s ping is %arg-1's ping%"

Plain Item

🔗

Expression

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

Examples:

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

Player List Header and Footer

🔗

Expression

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

Examples:

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

Player Protocol Version

🔗

Expression

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

Examples:

command /protocolversion <player>:
    trigger:
        send "Protocol version of %arg-1%: %protocol version of arg-1%"

Player Skull

🔗

Expression

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

Examples:

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

Player Weather

🔗

Expression

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

Examples:

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

Portal

🔗

Expression

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

Examples:

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

Potion Effect

🔗

Expression

Patterns:
  • [new] potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
  • [new] ambient potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
Since: 2.5.2
Return Type: potioneffect
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.

Examples:

set {_p} to potion effect of speed of tier 1 without particles for 10 minutes
add {_p} to potion effects of player's tool
add {_p} to potion effects of target entity
add potion effect of speed 1 to potion effects of player

Potion Effect Tier

🔗

Expression

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

Examples:

if the amplifier of haste of player >= 3:

Potion Effects

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: potioneffect
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.

Examples:

set {_p::*} to active potion effects of player
clear all the potion effects of player
clear all the potion effects of player's tool
add potion effects of player to potion effects of player's tool
add speed to potion effects of target entity
remove speed and night vision from potion effects of player

Prefix/Suffix

🔗

Expression

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

Examples:

on chat:
    cancel event
    broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world

set the player's prefix to "[<red>Admin] "

Projectile Bounce State

🔗

Expression

Patterns:
  • [the] projectile bounce (state|ability|mode) of %projectiles%
  • %projectiles%'[s] projectile bounce (state|ability|mode)
Since: 2.5.1
Return Type: boolean
A projectile's bounce state.

Examples:

on projectile hit:
    set projectile bounce mode of event-projectile to true

Projectile Critical State

🔗

Expression

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

Examples:

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

Protocol Version

🔗

Expression

Patterns:
  • [the] [server] [(sent|required|fake)] protocol version [number]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type:
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.

This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).

Examples:

on server list ping:
    set the version string to "<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

Random

🔗

Expression

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

Examples:

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

Random Number

🔗

Expression

Patterns:
  • [a] random (integer|number) (from|between) %number% (to|and) %number%
Since: 1.4
Return Type: number
A random number or integer between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.

Examples:

set the player's health to a random number between 5 and 10
send "You rolled a %random integer from 1 to 6%!" to the player

Random UUID

🔗

Expression

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

Examples:

set {_uuid} to random uuid

Raw Name

🔗

Expression

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

Examples:

raw name of tool of player

Raw String

🔗

Expression

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

Examples:

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

Redstone Block Power

🔗

Expression

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

Examples:

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

Region

🔗

Expression

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

Examples:

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

Region Members & Owners

🔗

Expression

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

Examples:

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

Regions At

🔗

Expression

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Return Type: region
All regions at a particular location. This expression requires a supported regions plugin to be installed.

Examples:

On click on a sign:
    line 1 of the clicked block is "[region info]"
    set {_regions::*} to regions at the clicked block
    if {_regions::*} is empty:
        message "No regions exist at this sign."
    else:
        message "Regions containing this sign: <gold>%{_regions::*}%."

Remaining Air

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: timespan
How much time a player has left underwater before starting to drown.

Examples:

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

Respawn location

🔗

Expression

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

Examples:

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

Reversed List

🔗

Expression

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

Examples:

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

Rounding

🔗

Expression

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

Examples:

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

Saturation

🔗

Expression

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

Examples:

set saturation of player to 20

Scoreboard Tags

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] scoreboard tags of %entities%
  • %entities%'[s] scoreboard tags
Since: 2.3
Return Type: string
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.

Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).

Examples:

on spawn of a monster:
    if the spawn reason is mob spawner:
        add "spawned by a spawner" to the scoreboard tags of event-entity

on death of a monster:
    if the attacker is a player:
        if the victim doesn't have the scoreboard tag "spawned by a spawner":
            add 1$ to attacker's balance

Script Name

🔗

Expression

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

Examples:

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

Sea Level

🔗

Expression

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

Examples:

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

Server Icon

🔗

Expression

Patterns:
  • [the] [((default)|(shown|sent))] [server] icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: cachedservericon
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.

Examples:

on script load:
    set {server-icons::default} to the default server icon

Sets

🔗

Expression

Patterns:
  • [(all [[of] the]|the|every)] item(s|[ ]types)
  • [(all [[of] the]|the)] items of type[s] %item types%
  • [(all [[of] the]|the|every)] block(s|[ ]types)
  • [(all [[of] the]|the)] blocks of type[s] %item types%
  • ([all [[of] the]] colo[u]rs|(the|every) colo[u]r)
Since: unknown (before 1.4.2), INSERT VERSION (colors)
Return Type: object
Collection sets of items or blocks of a specific type or colours, useful for looping.

Examples:

loop items of type ore and log:
    block contains loop-item
    message "Theres at least one %loop-item% in this block"
drop all blocks at the player # drops one of every block at the player

Shooter

🔗

Expression

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

Examples:

shooter is a skeleton

Shuffled List

🔗

Expression

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

Examples:

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

Sign Text

🔗

Expression

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

Examples:

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

Slot Index

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type:
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.

Examples:

if index of event-slot is 10:
    send "You bought a pie!"

Sorted List

🔗

Expression

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

Examples:

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

Spawn

🔗

Expression

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

Examples:

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

Spawn Reason

🔗

Expression

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

Examples:

on spawn:
    spawn reason is reinforcements or breeding

Spawner Type

🔗

Expression

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

Examples:

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

Special Number

🔗

Expression

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

Examples:

if {_number} is NaN value:

Spectator Target

🔗

Expression

Patterns:
Since: 2.4
Return Type: entity
Returns the entity which is followed by the camera of the player when in spectator mode.

Examples:

command /spectate :
    executable by: players
    trigger:
        set gamemode of player to spectator # otherwise below won't do anything
        set spectator target of player to arg-1
        send "Spectating %arg-1%" to player

Speed

🔗

Expression

Patterns:
  • [the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%
  • %players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speed
Since: unknown (before 2.1)
Return Type: number
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.

Examples:

set the player's walk speed to 1
increase the argument's fly speed by 0.1

Subtext

🔗

Expression

Patterns:
  • [the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%
  • [the] (first|last) [%number%] character[s] of %texts%
  • [the] %number% (first|last) characters of %texts%
  • [the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%
Since: 2.1, 2.5.2 (character at, multiple strings support)
Return Type: string
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).

Examples:

set {_s} to the first 5 characters of the text argument
message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console
set {_characters::*} to characters at 1, 2 and 7 in player's display name
send the last character of all players' names

TPS (ticks per second)

🔗

Expression

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

Examples:

broadcast "%tps%"

Tamer

🔗

Expression

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

Examples:

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

Target

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: entity
For players this is the entity at the crosshair, while for mobs and experience orbs it represents the entity they are attacking/following (if any).

Examples:

on entity target:
    entity's target is a player
    send "You're being followed by an %entity%!" to target of entity

Targeted Block

🔗

Expression

Patterns:
  • [the] target[ed] block[s] [of %players%]
  • %players%'[s] target[ed] block[s]
  • [the] actual[ly] target[ed] block[s] [of %players%]
  • %players%'[s] actual[ly] target[ed] block[s]
Since: 1.0
Return Type: block
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression.

Examples:

# A command to set the block a player looks at to a specific type:
command /setblock <material>:
    trigger:
        set targeted block to argument

Teleport Cause

🔗

Expression

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

Examples:

on teleport
    teleport cause is nether portal, end portal or end gateway

Temperature

🔗

Expression

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

Examples:

message "%temperature of the targeted block%"

Ternary

🔗

Expression

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

Examples:

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

The Egg

🔗

Expression

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

Examples:

spawn an egg at the egg

Time

🔗

Expression

Patterns:
  • [the] time[s] [([with]in|of) %worlds%]
  • %worlds%'[s] time[s]
Since: 1.0
Return Type: time
The time of a world.

Examples:

time in world is between 18:00 and 6:00:
    broadcast "It's night-time, watch out for monsters!"

Time Played

🔗

Expression

Patterns:
Since: 2.5, INSERT VERSION (offline players)
Requirements: MC 1.15+ (offline players)
Return Type: timespan
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.

Examples:

set {_t} to time played of player
if player's time played is greater than 10 minutes:
    give player a diamond sword

set player's time played to 0 seconds

Time Since

🔗

Expression

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

Examples:

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

Tool

🔗

Expression

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

Examples:

player's tool is a pickaxe
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow

Type of

🔗

Expression

Patterns:
Since: 1.4, 2.5.2 (potion effect)
Return Type: object
Type of a block, item, entity, inventory or potion effect. Types of items and blocks are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.

Examples:

on rightclick on an entity:
    message "This is a %type of clicked entity%!"

UUID

🔗

Expression

Patterns:
Since: 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs)
Return Type: string
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!

Examples:

# prevents people from joining the server if they use the name of a player
# who has played on this server at least once since this script has been added
on login:
    if {uuid::%name of player%} exists:
        {uuid::%name of player%} is not uuid of player
        kick player due to "Someone with your name has played on this server before"
    else:
        set {uuid::%name of player%} to uuid of player

Unbreakable Items

🔗

Expression

Patterns:
Since: 2.2-dev13b
Return Type: itemtype
Creates unbreakable copies of given items.

Examples:

unbreakable iron sword #Creates unbreakable iron sword

Unix Date

🔗

Expression

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

Examples:

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

Unix Timestamp

🔗

Expression

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

Examples:

unix timestamp of now

Vectors - Angle Between

🔗

Expression

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

Examples:

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

Vectors - Arithmetic

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Arithmetic expressions for vectors.

Examples:

set {_v} to vector 1, 2, 3 // 5
set {_v} to {_v} ++ {_v}
set {_v} to {_v} ++ 5
set {_v} to {_v} -- {_v}
set {_v} to {_v} -- 5
set {_v} to {_v} ** {_v}
set {_v} to {_v} ** 5
set {_v} to {_v} // {_v}
set {_v} to {_v} // 5

Vectors - Create from XYZ

🔗

Expression

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

Examples:

set {_v} to vector 0, 1, 0

Vectors - Cross Product

🔗

Expression

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

Examples:

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

Vectors - Cylindrical Shape

🔗

Expression

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

Examples:

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

Vectors - Dot Product

🔗

Expression

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

Examples:

set {_v} to {_v2} dot {_v3}

Vectors - Length

🔗

Expression

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

Examples:

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

Vectors - Location Vector Offset

🔗

Expression

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

Examples:

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

Vectors - Normalized

🔗

Expression

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

Examples:

set {_v} to normalized {_v}

Vectors - Random Vector

🔗

Expression

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

Examples:

set {_v} to a random vector

Vectors - Spherical Shape

🔗

Expression

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

Examples:

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

Vectors - Squared Length

🔗

Expression

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

Examples:

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

Vectors - Vector Between Locations

🔗

Expression

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

Examples:

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

Vectors - Vector from Location

🔗

Expression

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

Examples:

set {_v} to vector of {_loc}

Vectors - Vector from Pitch and Yaw

🔗

Expression

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

Examples:

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

Vectors - Velocity

🔗

Expression

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

Examples:

set player's velocity to {_v}

Vectors - XYZ Component

🔗

Expression

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

Examples:

set {_v} to vector 1, 2, 3
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"

Vehicle

🔗

Expression

Patterns:
Since: 2.0
Return Type: entity
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger

Examples:

vehicle of the player is a minecart

Version

🔗

Expression

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

Examples:

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

Version String

🔗

Expression

Patterns:
  • [the] [(shown|custom)] version [(string|text)]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: string
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.

Examples:

on server list ping:
    set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
    set the version string to "<light green>Version: <orange>%minecraft version%"

View Distance of Client

🔗

Expression

Patterns:
  • [the] client view distance[s] of %players%
  • %players%'[s] client view distance[s]
Since: 2.5
Requirements: 1.13.2+
Return Type:
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.

Examples:

set {_clientView} to the client view distance of player
set view distance of player to client view distance of player

Weather

🔗

Expression

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

Examples:

set weather to clear
weather in "world" is rainy

Whitelist

🔗

Expression

Patterns:
  • [the] white[ ]list
Since: 2.5.2
Return Type: offlineplayer
A server's whitelist.This expression can be used to add/remove players to/from the whitelist, to enable it and disable it (set whitelist to true / set whitelist to false), and to empty it (reset whitelist)

Examples:

set whitelist to false
add all players to whitelist
reset the whitelist

World

🔗

Expression

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

Examples:

world is "world_nether"
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk

World Environment

🔗

Expression

Patterns:
  • [the] [world] environment of %worlds%
  • %worlds%'[s] [world] environment
Since: INSERT VERSION
Return Type: environment
The environment of a world

Examples:

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

World Seed

🔗

Expression

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

Examples:

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

World from Name

🔗

Expression

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

Examples:

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

Worlds

🔗

Expression

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

Examples:

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

X Times

🔗

Expression

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

Examples:

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

X of Item

🔗

Expression

Patterns:
Since: 1.2
Return Type: object
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.

Examples:

give level of player of pickaxes to the player

Yaw / Pitch

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev28 (vector yaw/pitch)
Return Type: number
The yaw or pitch of a location or vector.

Examples:

log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"
set {_yaw} to yaw of player
set {_p} to pitch of target entity

Action Bar

🔗

Effect

Patterns:
  • send [the] action bar [with text] %text% to %players%
Since: 2.3
Sends an action bar message to the given player(s).

Examples:

send action bar "Hello player!" to player

Ban

🔗

Effect

Patterns:
Since: 1.4, 2.1.1 (ban reason), 2.5 (timespan)
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.

Note that banning people does not kick them from the server. Consider using the kick effect after applying a ban.

Examples:

unban player
ban "127.0.0.1"
IP-ban the player because "he is an idiot"
ban player due to "inappropriate language" for 2 days

Break Block

🔗

Effect

Patterns:
Since: 2.4
Breaks the block and spawns items as if a player had mined it

You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)

Examples:

on right click:
    break clicked block naturally
loop blocks in radius 10 around player:
    break loop-block using player's tool
loop blocks in radius 10 around player:
    break loop-block naturally using diamond pickaxe

Broadcast

🔗

Effect

Patterns:
Since: 1.0, 2.6 (broadcasting objects), 2.6.1 (using advanced formatting)
Broadcasts a message to the server.

Examples:

broadcast "Welcome %player% to the server!"
broadcast "Woah! It's a message!"

Cancel Command Cooldown

🔗

Effect

Patterns:
  • (cancel|ignore) [the] [current] [command] cooldown
  • un(cancel|ignore) [the] [current] [command] cooldown
Since: 2.2-dev34
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.

Examples:

command /nick <text>:
    executable by: players
    cooldown: 10 seconds
    trigger:
        if length of arg-1 is more than 16:
            # Makes it so that invalid arguments don't make you wait for the cooldown again
            cancel the cooldown
            send "Your nickname may be at most 16 characters."
            stop
        set the player's display name to arg-1

Cancel Drops

🔗

Effect

Patterns:
  • (cancel|clear|delete) [the] drops [of (items|[e]xp[erience][s])]
  • (cancel|clear|delete) [the] (item|[e]xp[erience]) drops
Since: 2.4
Usable in events: death, break / mine
Requirements: 1.12.2 or newer (cancelling item drops of blocks)
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.

Examples:

on death of a zombie:
    if name of the entity is "&cSpecial":
        cancel drops of items

on break of a coal ore:
    cancel the experience drops

Cancel Event

🔗

Effect

Patterns:
  • cancel [the] event
  • uncancel [the] event
Since: 1.0
Cancels the event (e.g. prevent blocks from being placed, or damage being taken).

Examples:

on damage:
    victim is a player
    victim has the permission "skript.god"
    cancel the event

Change: Set/Add/Remove/Delete/Reset

🔗

Effect

Patterns:
Since: 1.0 (set, add, remove, delete), 2.0 (remove all)
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.

Examples:

# set:
Set the player's display name to "<red>%name of player%"
set the block above the victim to lava
# add:
add 2 to the player's health # preferably use 'heal' for this
add argument to {blacklist::*}
give a diamond pickaxe of efficiency 5 to the player
increase the data value of the clicked block by 1
# remove:
remove 2 pickaxes from the victim
subtract 2.5 from {points::%uuid of player%}
# remove all:
remove every iron tool from the player
remove all minecarts from {entitylist::*}
# delete:
delete the block below the player
clear drops
delete {variable}
# reset:
reset walk speed of player
reset chunk at the targeted block

Charge Creeper

🔗

Effect

Patterns:
  • make %living entities% [a[n]] (charged|powered|((un|non[-])charged|(un|non[-])powered)) [creeper[s]]
  • (charge|power|(uncharge|unpower)) %living entities%
Since: 2.5
Charges or uncharges a creeper. A creeper is charged when it has been struck by lightning.

Examples:

on spawn of creeper:
    charge the event-entity

Color Items

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev26 (maps and potions)
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.

Examples:

dye player's helmet blue
color the player's tool red

Command

🔗

Effect

Patterns:
Since: 1.0
Executes a command. This can be useful to use other plugins in triggers.

Examples:

make player execute command "/suicide"
execute console command "/say Hello everyone!"

Connect

🔗

Effect

Patterns:
Since: 2.3
Connects a player to another bungeecord server

Examples:

connect all players to "hub"

Continue

🔗

Effect

Patterns:
  • continue [loop]
Since: 2.2-dev37, INSERT VERSION (while loops)
Skips the value currently being looped, moving on to the next value if it exists.

Examples:

loop all players:
    if loop-value does not have permission "moderator":
        continue # filter out non moderators
    broadcast "%loop-player% is a moderator!" # Only moderators get broadcast

Damage/Heal/Repair

🔗

Effect

Patterns:
Since: 1.0
Damage/Heal/Repair an entity, or item.

Examples:

damage player by 5 hearts
heal the player
repair tool of player

Delay

🔗

Effect

Patterns:
Since: 1.4
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!

Examples:

wait 2 minutes
halt for 5 minecraft hours
wait a tick

Do If

🔗

Effect

Patterns:
  • <.+> if <.+>
Since: 2.3
Execute an effect if a condition is true.

Examples:

on join:
    give a diamond to the player if the player has permission "rank.vip"

Drop

🔗

Effect

Patterns:
Since: 1.0
Drops one or more items.

Examples:

on death of creeper:
    drop 1 TNT

Enable/Disable/Reload Script File

🔗

Effect

Patterns:
  • ((enable|load)|reload|(disable|unload)) s(c|k)ript [file] %text%
Since: 2.4
Enables, disables, or reloads a script file.

Examples:

reload script "test"
enable script file "testing"
unload script file "script.sk"

Enchant/Disenchant

🔗

Effect

Patterns:
Since: 2.0
Enchant or disenchant an existing item.

Examples:

enchant the player's tool with sharpness 5
disenchant the player's tool

Equip

🔗

Effect

Patterns:
Since: 1.0, INSERT VERSION (multiple entities)
Equips an entity with some given armor. This will replace any armor that the entity is wearing.

Examples:

equip player with diamond helmet
equip player with all diamond armor

Exit

🔗

Effect

Patterns:
  • (exit|stop) [trigger]
  • (exit|stop) [(1|a|the|this)] (section|loop|conditional)
  • (exit|stop) <\d+> (section|loop|conditional)s
  • (exit|stop) all (section|loop|conditional)s
Since: unknown (before 2.1)
Exits a given amount of loops and conditionals, or the entire trigger.

Examples:

if player has any ore:
    stop
message "%player% has no ores!"
loop blocks above the player:
    loop-block is not air:
        exit 2 sections
    set loop-block to water

Explode Creeper

🔗

Effect

Patterns:
Since: 2.5
Requirements: Paper 1.13 or newer/Spigot 1.14 or newer. Ignition can be stopped on Paper 1.13 or newer.
Starts the explosion process of a creeper or instantly explodes it.

Examples:

start explosion of the last spawned creeper
stop ignition of the last spawned creeper

Explosion

🔗

Effect

Patterns:
Since: 1.0
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.

Examples:

create an explosion of force 10 at the player
create an explosion of force 0 at the victim

Feed

🔗

Effect

Patterns:
Since: 2.2-dev34
Feeds the specified players.

Examples:

feed all players
feed the player by 5 beefs

Force Attack

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes a living entity attack an entity with a melee attack.

Examples:

spawn a wolf at player's location
make last spawned wolf attack player

Force Respawn

🔗

Effect

Patterns:
Since: 2.2-dev21
Forces player(s) to respawn if they are dead. If this is called without delay from death event, one tick is waited before respawn attempt.

Examples:

on death of player:
    force event-player to respawn

Hide Player from Server List

🔗

Effect

Patterns:
  • hide %players% (in|on|from) [the] server list
  • hide %players%'[s] info[rmation] (in|on|from) [the] server list
Since: 2.3
Hides a player from the hover list and decreases the online players count (only if the player count wasn't changed before).

Examples:

on server list ping:
    hide {vanished::*} from the server list

Ignite/Extinguish

🔗

Effect

Patterns:
Since: 1.4
Lights entities on fire or extinguishes them.

Examples:

ignite the player
extinguish the player

Keep Inventory / Experience

🔗

Effect

Patterns:
  • keep [the] (inventory|items) [(and [e]xp[erience][s] [point[s]])]
  • keep [the] [e]xp[erience][s] [point[s]] [(and (inventory|items))]
Since: 2.4
Usable in events: death
Keeps the inventory or/and experiences of the dead player in a death event.

Examples:

on death of a player:
    if the victim is an op:
        keep the inventory and experiences

Kick

🔗

Effect

Patterns:
  • kick %players% [(by reason of|because [of]|on account of|due to) %text%]
Since: 1.0
Kicks a player from the server.

Examples:

on place of TNT, lava, or obsidian:
    kick the player due to "You may not place %block%!"
    cancel the event

Kill

🔗

Effect

Patterns:
Since: 1.0
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.

Examples:

kill the player
kill all creepers in the player's world
kill all endermen, witches and bats

Launch firework

🔗

Effect

Patterns:
Since: 2.4
Launch firework effects at the given location(s).

Examples:

launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Leash entities

🔗

Effect

Patterns:
Since: 2.3
Leash living entities to other entities.

Examples:

leash the player to the target entity

Lightning

🔗

Effect

Patterns:
Since: 1.4
Strike lightning at a given location. Can use 'lightning effect' to create a lightning that does not harm entities or start fires.

Examples:

strike lightning at the player
strike lightning effect at the victim

Load Server Icon

🔗

Effect

Patterns:
  • load [the] server icon (from|of) [the] [image] [file] %text%
Since: 2.3
Requirements: Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.

Examples:

on load:
    clear {server-icons::*}
    loop 5 times:
        load server icon from file "icons/%loop-number%.png"
        add the last loaded server icon to {server-icons::*}

on server list ping:
    set the icon to a random server icon out of {server-icons::*}

Locally Suppress Warning

🔗

Effect

Patterns:
  • [local[ly]] suppress [the] (conflict|variable save|[missing] conjunction[s]|starting [with] expression[s]) warning[s]
Since: 2.3
Suppresses target warnings from the current script.

Examples:

locally suppress missing conjunction warnings
suppress the variable save warnings

Log

🔗

Effect

Patterns:
Since: 2.0
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.

Examples:

on place of TNT:
    log "%player% placed TNT in %world% at %location of block%" to "tnt/placement.log"

Make Egg Hatch

🔗

Effect

Patterns:
  • make [the] egg [not] hatch
Since: INSERT VERSION
Usable in events: Egg Throw
Makes the egg hatch in a Player Egg Throw event.

Examples:

on player egg throw:
    # EGGS FOR DAYZ!
    make the egg hatch

Make Fly

🔗

Effect

Patterns:
Since: 2.2-dev34
Forces a player to start/stop flying.

Examples:

make player fly
force all players to stop flying

Make Incendiary

🔗

Effect

Patterns:
  • make %entities% [not] incendiary
  • make %entities%'[s] explosion [not] (incendiary|fiery)
  • make [the] [event(-| )]explosion [not] (incendiary|fiery)
Since: 2.5
Sets if an entity's explosion will leave behind fire. This effect is also usable in an explosion prime event.

Examples:

on explosion prime:
    make the explosion fiery

Make Invulnerable

🔗

Effect

Patterns:
Since: 2.5
Makes an entity invulnerable/not invulnerable.

Examples:

make target entity invulnerable

Make Say

🔗

Effect

Patterns:
Since: 2.3
Forces a player to send a message to the chat. If the message starts with a slash it will force the player to use command.

Examples:

make the player say "Hello."
force all players to send the message "I love this server"

Message

🔗

Effect

Patterns:
Since: 1.0, 2.2-dev26 (advanced features), 2.5.2 (optional sender), 2.6 (sending objects)
Requirements: Minecraft 1.16.4+ for optional sender
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.

Examples:

message "A wild %player% appeared!"
message "This message is a distraction. Mwahaha!"
send "Your kill streak is %{kill streak::%uuid of player%}%." to player
if the targeted entity exists:
    message "You're currently looking at a %type of the targeted entity%!"
on chat:
    cancel event
    send "[%player%] >> %message%" to all players from player

Open Book

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.14.2+
Opens a written book to a player.

Examples:

open book player's tool to player

Open/Close Inventory

🔗

Effect

Patterns:
  • (open|show) (((crafting [table]|workbench)|chest|anvil|hopper|dropper|dispenser) [(view|window|inventory)]|%inventory/inventory type%) (to|for) %players%
  • close [the] inventory [view] (to|of|for) %players%
  • close %players%'[s] inventory [view]
Since: 2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.

Examples:

show the victim's inventory to the player
open the player's inventory for the player

Pathfind

🔗

Effect

Patterns:
Since: INSERT VERSION
Requirements: Paper
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.

Examples:

make all creepers pathfind towards player
make all cows stop pathfinding
make event-entity pathfind towards player at speed 1

Play Effect

🔗

Effect

Patterns:
Since: 2.1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.

Examples:

play wolf hearts on the clicked wolf
show mob spawner flames at the targeted block to the player

Play Sound

🔗

Effect

Patterns:
Since: 2.2-dev28, 2.4 (sound categories)
Requirements: Minecraft 1.11+ (sound categories)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

play sound "block.note_block.pling" # It is block.note.pling in 1.12.2
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
play sound "custom.music.1" in jukebox category at {speakerBlock}

Player Info Visibility

🔗

Effect

Patterns:
  • hide [all] player [related] info[rmation] [(in|on|from) [the] server list]
  • (show|reveal) [all] player [related] info[rmation] [(in|to|on|from) [the] server list]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.

Examples:

hide player info
hide player related information in the server list
reveal all player related info

Player Visibility

🔗

Effect

Patterns:
Since: 2.3
Change visibility of a player for the given players. When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.

Note: if a player was hidden and relogs, this player will be visible again.

Examples:

on join:
    if {vanished::%player's uuid%} is true:
        hide the player from all players

reveal hidden players of {_player}

Poison/Cure

🔗

Effect

Patterns:
Since: 1.3.2
Poison or cure a creature.

Examples:

poison the player
poison the victim for 20 seconds
cure the player from poison

Potion Effects

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects)
Apply or remove potion effects to/from entities.

Examples:

apply swiftness 2 to the player
remove haste from the victim
on join:
    apply potion of strength of tier {strength.%player%} to the player for 999 days
apply potion effects of player's tool to player

Push

🔗

Effect

Patterns:
Since: 1.4.6
Push entities around.

Examples:

push the player upwards
push the victim downwards at speed 0.5

PvP

🔗

Effect

Patterns:
Since: 1.3.4
Set the PvP state for a given world.

Examples:

enable PvP #(current world only)
disable PvP in all worlds

Replace

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.

Examples:

replace "" in {textvar} with "%item%"
replace every "&" with "§" in line 1
# The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well:
on chat:
    replace all "kys", "idiot" and "noob" with "****" in the message

replace all stone and dirt in player's inventory and player's top inventory with diamond

Return

🔗

Effect

Patterns:
Since: 2.2
Makes a function return a value

Examples:

function double(i: number) :: number:
    return 2 * {_i}

Send Block Change

🔗

Effect

Patterns:
Since: 2.2-dev37c, 2.5.1 (block data support)
Makes a player see a block as something it really isn't. BlockData support is only for MC 1.13+

Examples:

make player see block at player as dirt
make player see target block as campfire[facing=south]

Send Resource Pack

🔗

Effect

Patterns:
  • send [the] resource pack [from [[the] URL]] %text% to %players%
  • send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since: 2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.

The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.

The resource pack request action can be used to check status of the sent resource pack request.

Examples:

on join:
    send the resource pack from "URL" with hash "hash" to the player

Shear

🔗

Effect

Patterns:
Since: 2.0
Shears or 'un-shears' a sheep. Please note that no wool is dropped, this only sets the 'sheared' state of the sheep.

Examples:

on rightclick on a sheep holding a sword:
    shear the clicked sheep

Shoot

🔗

Effect

Patterns:
Since: 1.4
Shoots a projectile (or any other entity) from a given entity.

Examples:

shoot an arrow
make the player shoot a creeper at speed 10
shoot a pig from the creeper

Silence Entity

🔗

Effect

Patterns:
Since: 2.5
Controls whether or not an entity is silent.

Examples:

make target entity silent

Stop Server

🔗

Effect

Patterns:
  • (stop|shut[ ]down) [the] server
  • restart [the] server
Since: 2.5
Stops or restarts the server. If restart is used when the restart-script spigot.yml option isn't defined, the server will stop instead.

Examples:

stop the server
restart server

Stop Sound

🔗

Effect

Patterns:
Since: 2.4
Requirements: Minecraft 1.10.2+, Minecraft 1.11+ (sound categories)
Stops a sound from playing to the specified players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

stop sound "block.chest.open" for the player
stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player

Swing Hand

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes an entity swing their hand. This does nothing if the entity does not have an animation for swinging their hand.

Examples:

make player swing their main hand

Teleport

🔗

Effect

Patterns:
Since: 1.0
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.

Examples:

teleport the player to {homes.%player%}
teleport the attacker to the victim

Title - Reset

🔗

Effect

Patterns:
  • reset [the] title[s] [of %players%]
  • reset [the] %players%'[s] title[s]
Since: 2.3
Resets the title of the player to the default values.

Examples:

reset the titles of all players
reset the title

Title - Send

🔗

Effect

Patterns:
Since: 2.3
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.

If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.

Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.

Examples:

send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds
send title "Hi %player%" to player
send title "Loot Drop" with subtitle "starts in 3 minutes" to all players
send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second
send subtitle "Party!" to all players

Toggle

🔗

Effect

Patterns:
  • (close|turn off|de[-]activate) %blocks%
  • (toggle|switch) [[the] state of] %blocks%
  • (open|turn on|activate) %blocks%
Since: 1.4
Toggle the state of a block.

Examples:

# use arrows to toggle switches, doors, etc.
on projectile hit:
    projectile is arrow
    toggle the block at the arrow

Toggle Flight

🔗

Effect

Patterns:
  • (allow|enable) (fly|flight) (for|to) %players%
  • (disallow|disable) (fly|flight) (for|to) %players%
Since: 2.3
Toggle the flight mode of a player.

Examples:

allow flight to event-player

Tree

🔗

Effect

Patterns:
Since: 1.0
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.

Examples:

grow a tall redwood tree above the clicked block

Vectors - Rotate Around Vector

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around another vector

Examples:

rotate {_v} around vector 1, 0, 0 by 90

Vectors - Rotate around XYZ

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around x, y, or z axis by some degrees

Examples:

rotate {_v} around x-axis by 90
rotate {_v} around y-axis by 90
rotate {_v} around z-axis by 90 degrees

Vehicle

🔗

Effect

Patterns:
  • (make|let|force) %entities% [to] (ride|mount) [(in|on)] %entities/entity types%
  • (make|let|force) %entities% [to] (dismount|(dismount|leave) [(from|of)] [(any|the[ir]|his|her)] vehicle[s])
  • (eject|dismount) [(any|the)] passenger[s] (of|from) %entities%
Since: 2.0
Makes an entity ride another entity, e.g. a minecart, a saddled pig, an arrow, etc.

Examples:

make the player ride a saddled pig
make the attacker ride the victim

op/deop

🔗

Effect

Patterns:
Since: 1.0
Grant/revoke a user operator state.

Examples:

op the player
deop all players

Spawn

🔗

EffectSection

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""

Alphanumeric

🔗

Condition

Patterns:
  • %texts% (is|are) alphanumeric
  • %texts% (isn't|is not|aren't|are not) alphanumeric
Since: 2.4
Checks if the given string is alphanumeric.

Examples:

if the argument is not alphanumeric:
    send "Invalid name!"

Can Build

🔗

Condition

Patterns:
Since: 2.0
Requirements: Supported regions plugin
Tests whether a player is allowed to build at a certain location. This condition requires a supported regions plugin to be installed.

Examples:

command /setblock <material>:
    description: set the block at your crosshair to a different type
    trigger:
        player cannot build at the targeted block:
            message "You do not have permission to change blocks there!"
            stop
        set the targeted block to argument

Can Fly

🔗

Condition

Patterns:
Since: 2.3
Whether a player is allowed to fly.

Examples:

player can fly

Can Hold

🔗

Condition

Patterns:
Since: 1.0
Tests whether a player or a chest can hold the given item.

Examples:

block can hold 200 cobblestone
player has enough space for 64 feathers

Can See

🔗

Condition

Patterns:
Since: 2.3
Checks whether the given players can see another players.

Examples:

if the player can't see the player-argument:
    message "<light red>The player %player-argument% is not online!"

Chance

🔗

Condition

Patterns:
Since: 1.0
A condition that randomly succeeds or fails. Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1.

Examples:

chance of 50%:
    drop a diamond
chance of {chance}% # {chance} between 0 and 100
chance of {chance} # {chance} between 0 and 1

Comparison

🔗

Condition

Patterns:
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above)|>) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as)|>=) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] ((less|smaller|lower) than|below)|<) %objects%
  • [(neither)] %objects% ((is|are)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as)|<=) %objects%
  • [(neither)] %objects% ((is|are) (not|neither)|isn't|aren't|!=) [equal to] %objects%
  • [(neither)] %objects% (is|are|=) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (is|are) between %objects% and %objects%
  • [(neither)] %objects% (is not|are not|isn't|aren't) between %objects% and %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (was|were)[(n't| not| neither)] (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((was|were) (not|neither)|wasn't|weren't) [equal to] %objects%
  • [(neither)] %objects% (was|were) [(equal to|the same as)] %objects%
  • [(neither)] %objects% (was|were) between %objects% and %objects%
  • [(neither)] %objects% (was not|were not|wasn't|weren't) between %objects% and %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) ((less|smaller|lower) than|below) %objects%
  • [(neither)] %objects% (will be|(will (not|neither) be|won't be)) (less|smaller|lower|below) [than] or (equal to|the same as) %objects%
  • [(neither)] %objects% ((will (not|neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects%
  • [(neither)] %objects% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects%
  • [(neither)] %objects% will be between %objects% and %objects%
  • [(neither)] %objects% (will not be|won't be) between %objects% and %objects%
Since: 1.0
A very general condition, it simply compares two values. Usually you can only compare for equality (e.g. block is/isn't of <type>), but some values can also be compared using greater than/less than. In that case you can also test for whether an object is between two others. Note: This is the only element where not all patterns are shown. It has actually another two sets of similar patters, but with (was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.

Examples:

the clicked block is a stone slab or a double stone slab
time in the player's world is greater than 8:00
the creature is not an enderman or an ender dragon

Contains

🔗

Condition

Patterns:
Since: 1.0
Checks whether an inventory contains an item, a text contains another piece of text, or a list (e.g. {list variable::*} or 'drops') contains another object.

Examples:

block contains 20 cobblestone
player has 4 flint and 2 iron ingots
{list::*} contains 5

Damage Cause

🔗

Condition

Patterns:
  • [the] damage (was|is|has)[n('|o)t] [been] (caused|done|made) by %damage cause%
Since: 2.0
Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.

Examples:

# make players use their potions of fire resistance whenever they take any kind of fire damage
on damage:
    damage was caused by lava, fire or burning
    victim is a player
    victim has a potion of fire resistance
    cancel event
    apply fire resistance to the victim for 30 seconds
    remove 1 potion of fire resistance from the victim
# prevent mobs from dropping items under certain circumstances
on death:
    entity is not a player
    damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison
    clear drops

Egg Will Hatch

🔗

Condition

Patterns:
  • [the] egg (will|will not|won't) hatch
Since: INSERT VERSION
Usable in events: Egg Throw
Whether the egg will hatch in a Player Egg Throw event.

Examples:

on player egg throw:
    if an entity won't hatch:
        send "Better luck next time!" to the player

Entity is Wet

🔗

Condition

Patterns:
Since: 2.6.1
Requirements: Paper 1.16+
Checks whether an entity is wet or not (in water, rain or a bubble column).

Examples:

if player is wet:

Entity is in Liquid

🔗

Condition

Patterns:
  • %entities% (is|are) in (water|lava|[a] bubble[ ]column|rain)
  • %entities% (isn't|is not|aren't|are not) in (water|lava|[a] bubble[ ]column|rain)
Since: 2.6.1
Requirements: Minecraft 1.16+ (in water), Paper 1.16+ (in rain, lava and bubble column)
Checks whether an entity is in rain, lava, water or a bubble column.

Examples:

if player is in rain:
if player is in water:
player is in lava:
player is in bubble column

Event Cancelled

🔗

Condition

Patterns:
  • [the] event is cancel[l]ed
  • [the] event (is not|isn't) cancel[l]ed
Since: 2.2-dev36
Checks whether or not the event is cancelled.

Examples:

on click:
    if event is cancelled:
        broadcast "no clicks allowed!"

Exists/Is Set

🔗

Condition

Patterns:
  • %~objects% (exist[s]|(is|are) set)
  • %~objects% (do[es](n't| not) exist|(is|are)(n't| not) set)
Since: 1.2
Checks whether a given expression or variable is set.

Examples:

{teams::%player's uuid%::preferred-team} is not set
on damage:
    projectile exists
    broadcast "%attacker% used a %projectile% to attack %victim%!"

Has AI

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity has AI.

Examples:

target entity has ai

Has Client Weather

🔗

Condition

Patterns:
  • %players% (has|have) [a] (client|custom) weather [set]
  • %players% (doesn't|does not|do not|don't) have [a] (client|custom) weather [set]
Since: 2.3
Checks whether the given players have a custom client weather

Examples:

if the player has custom weather:
    message "Your custom weather is %player's weather%"

Has Custom Model Data

🔗

Condition

Patterns:
  • %item types% (has|have) [custom] model data
  • %item types% (doesn't|does not|do not|don't) have [custom] model data
Since: 2.5
Requirements: 1.14+
Check if an item has a custom model data tag

Examples:

player's tool has custom model data

Has Metadata

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether a metadata holder has a metadata tag.

Examples:

if player has metadata value "healer":

Has Permission

🔗

Condition

Patterns:
Since: 1.0
Test whether a player has a certain permission.

Examples:

player has permission "skript.tree"
victim has the permission "admin":
    send "You're attacking an admin!" to attacker

Has Played Before

🔗

Condition

Patterns:
  • %offline players% [(has|have|did)] [already] play[ed] [on (this|the) server] (before|already)
  • %offline players% (has not|hasn't|have not|haven't|did not|didn't) [(already|yet)] play[ed] [on (this|the) server] (before|already|yet)
Since: 1.4, INSERT VERSION (multiple players)
Checks whether a player has played on this server before. You can also use on first join if you want to make triggers for new players.

Examples:

player has played on this server before
player hasn't played before

Has Potion

🔗

Condition

Patterns:
Since: 2.6.1
Checks whether the given living entities have specific potion effects.

Examples:

if player has potion speed:
    send "You are sonic!"

if all players have potion effects speed and haste:
    broadcast "You are ready to MINE!"

Has Resource Pack

🔗

Condition

Patterns:
  • %players% (has|have) [a] resource pack [(loaded|installed)]
  • %players% (doesn't|does not|do not|don't) have [a] resource pack [(loaded|installed)]
Since: 2.4
Requirements: Paper 1.9 or newer
Checks whether the given players have a server resource pack loaded. Please note that this can't detect player's own resource pack, only the resource pack that sent by the server.

Examples:

if the player has a resource pack loaded:

Has Scoreboard Tag

🔗

Condition

Patterns:
  • %entities% (has|have) [the] score[ ]board tag[s] %texts%
  • %entities% (doesn't|does not|do not|don't) have [the] score[ ]board tag[s] %texts%
Since: 2.3
Checks whether the given entities has the given scoreboard tags.

Examples:

if the targeted armor stand has the scoreboard tag "test tag":

Ignition Process

🔗

Condition

Patterns:
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) going to explode
  • [creeper[s]] %living entities% ((is|are)|(isn't|is not|aren't|are not)) in the (ignition|explosion) process
  • creeper[s] %living entities% ((is|are)|(isn't|is not|aren't|are not)) ignited
Since: 2.5
Requirements: Paper 1.13 or newer
Checks if a creeper is going to explode.

Examples:

if the last spawned creeper is going to explode:
    loop all players in radius 3 of the last spawned creeper
        send "RUN!!!" to the loop-player

Is Alive

🔗

Condition

Patterns:
  • %entities% (is|are) (alive|dead)
  • %entities% (isn't|is not|aren't|are not) (alive|dead)
Since: 2.0, 2.4-alpha4 (non-living entity support)
Checks whether an entity is alive. Works for non-living entities too.

Examples:

if {villager-buddy::%player's uuid%} is not dead:

on shoot:
    while the projectile is alive:

Is Banned

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player or IP is banned.

Examples:

player is banned
victim is not IP-banned
"127.0.0.1" is banned

Is Block

🔗

Condition

Patterns:
  • %item types% (is|are) ([a] block|blocks)
  • %item types% (isn't|is not|aren't|are not) ([a] block|blocks)
Since: 2.4
Checks whether an item is a block.

Examples:

player's held item is a block
{list::*} are blocks

Is Block Redstone Powered

🔗

Condition

Patterns:
  • %blocks% (is|are) redstone powered
  • %blocks% (is|are) indirectly redstone powered
  • %blocks% (is|are)(n't| not) redstone powered
  • %blocks% (is|are)(n't| not) indirectly redstone powered
Since: 2.5
Checks if a block is indirectly or directly powered by redstone

Examples:

if clicked block is redstone powered:
    send "This block is well-powered by redstone!"
if clicked block is indirectly redstone powered:
    send "This block is indirectly redstone powered."

Is Blocking

🔗

Condition

Patterns:
  • %players% (is|are) (blocking|defending) [with [a] shield]
  • %players% (isn't|is not|aren't|are not) (blocking|defending) [with [a] shield]
Since: unknown (before 2.1)
Checks whether a player is blocking with their shield.

Examples:

on damage of player:
    victim is blocking
    damage attacker by 0.5 hearts

Is Burning

🔗

Condition

Patterns:
  • %entities% (is|are) (burning|ignited|on fire)
  • %entities% (isn't|is not|aren't|are not) (burning|ignited|on fire)
Since: 1.4.4
Checks whether an entity is on fire, e.g. a zombie due to being in sunlight, or any entity after falling into lava.

Examples:

# increased attack against burning targets
victim is burning:
    increase damage by 2

Is Charged

🔗

Condition

Patterns:
Since: 2.5
Checks if a creeper is charged (powered).

Examples:

if the last spawned creeper is charged:
    broadcast "A charged creeper is at %location of last spawned creeper%"

Is Edible

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is edible.

Examples:

steak is edible
player's tool is edible

Is Empty

🔗

Condition

Patterns:
Since: unknown (before 2.1)
Checks whether an inventory, an inventory slot, or a text is empty.

Examples:

player's inventory is empty

Is Enchanted

🔗

Condition

Patterns:
Since: 1.4.6
Checks whether an item is enchanted.

Examples:

tool of the player is enchanted with efficiency 2
helm, chestplate, leggings or boots are enchanted

Is Flammable

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is flammable.

Examples:

wood is flammable
player's tool is flammable

Is Flying

🔗

Condition

Patterns:
  • %players% (is|are) flying
  • %players% (isn't|is not|aren't|are not) flying
Since: 1.4.4
Checks whether a player is flying.

Examples:

player is not flying

Is Frozen

🔗

Condition

Patterns:
Since: INSERT VERSION
Checks whether an entity is frozen.

Examples:

if player is frozen:
    kill player

Is Fuel

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11.2+
Checks whether an item can be used as fuel in a furnace.

Examples:

on right click on furnace:
    if player's tool is not fuel:
        send "Please hold a valid fuel item in your hand"
        cancel event

Is Holding

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is holding a specific item. Cannot be used with endermen, use 'entity is [not] an enderman holding <item type>' instead.

Examples:

player is holding a stick
victim isn't holding a sword of sharpness

Is Incendiary

🔗

Condition

Patterns:
  • %entities% ((is|are) incendiary|cause[s] a[n] (incendiary|fiery) explosion)
  • %entities% ((is not|are not|isn't|aren't) incendiary|(does not|do not|doesn't|don't) cause[s] a[n] (incendiary|fiery) explosion)
  • the [event(-| )]explosion (is|(is not|isn't)) (incendiary|fiery)
Since: 2.5
Checks if an entity will create fire when it explodes. This condition is also usable in an explosion prime event.

Examples:

on explosion prime:
    if the explosion is fiery:
        broadcast "A fiery explosive has been ignited!"

Is Interactable

🔗

Condition

Patterns:
Since: 2.5.2
Requirements: Minecraft 1.13+
Checks wether or not a block is interactable.

Examples:

on block break:
    if event-block is interactable:
        cancel event
        send "You cannot break interactable blocks!"

Is Invulnerable

🔗

Condition

Patterns:
  • %entities% (is|are) invulnerable
  • %entities% (isn't|is not|aren't|are not) invulnerable
Since: 2.5
Checks whether an entity is invulnerable.

Examples:

target entity is invulnerable

Is Leashed

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently leashed.

Examples:

target entity is leashed

Is Loaded

🔗

Condition

Patterns:
Since: 2.3, 2.5 (revamp with chunk at location/coords)
Checks whether or not a chunk/world is loaded. 'chunk at 1, 1' uses chunk coords, which are location coords divided by 16.

Examples:

if chunk at {home::%player's uuid%} is loaded:
if chunk 1, 10 in world "world" is loaded:
if world("lobby") is loaded:

Is Member/Owner of Region

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a player is a member or owner of a particular region. This condition requires a supported regions plugin to be installed.

Examples:

on region enter:
    player is the owner of the region
    message "Welcome back to %region%!"
    send "%player% just entered %region%!" to all members of the region

Is Normalized

🔗

Condition

Patterns:
  • %vectors% (is|are) normalized
  • %vectors% (isn't|is not|aren't|are not) normalized
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a vector is normalized i.e. length of 1

Examples:

vector of player's location is normalized

Is Occluding

🔗

Condition

Patterns:
Since: 2.5.1
Checks whether an item is a block and completely blocks vision.

Examples:

player's tool is occluding

Is Online

🔗

Condition

Patterns:
Since: 1.4
Checks whether a player is online.

Examples:

player is online
player-argument is offline

Is Passable

🔗

Condition

Patterns:
  • %blocks% (is|are) passable
  • %blocks% (isn't|is not|aren't|are not) passable
Since: 2.5.1
Requirements: Minecraft 1.13.2+
Checks whether a block is passable. A block is passable if it has no colliding parts that would prevent players from moving through it. Blocks like tall grass, flowers, signs, etc. are passable, but open doors, fence gates, trap doors, etc. are not because they still have parts that can be collided with.

Examples:

if player's targeted block is passable

Is Plugin Enabled

🔗

Condition

Patterns:
  • plugin[s] %texts% (is|are) enabled
  • plugin[s] %texts% (is|are)(n't| not) enabled
  • plugin[s] %texts% (is|are) disabled
Since: 2.6
Check if a plugin is enabled/disabled on the server. Plugin names can be found in the plugin's 'plugin.yml' file or by using the '/plugins' command, they are NOT the name of the plugin's jar file. When checking if a plugin is not enabled, this will return true if the plugin is either disabled or not on the server. When checking if a plugin is disabled, this will return true if the plugin is on the server and is disabled.

Examples:

if plugin "Vault" is enabled:
if plugin "WorldGuard" is not enabled:
if plugins "Essentials" and "Vault" are enabled:
if plugin "MyBrokenPlugin" is disabled:

Is Poisoned

🔗

Condition

Patterns:
Since: 1.4.4
Checks whether an entity is poisoned.

Examples:

player is poisoned:
    cure the player from poison
    message "You have been cured!"

Is Riding

🔗

Condition

Patterns:
Since: 2.0
Tests whether an entity is riding another or is in a vehicle.

Examples:

player is riding a saddled pig

Is Riptiding

🔗

Condition

Patterns:
Since: 2.5
Checks to see if an entity is currently using the Riptide enchantment.

Examples:

target entity is riptiding

Is Script Loaded

🔗

Condition

Patterns:
  • script[s] [%texts%] (is|are) loaded
  • script[s] [%texts%] (isn't|is not|aren't|are not) loaded
Since: 2.2-dev31
Check if the current script, or another script, is currently loaded.

Examples:

script is loaded
script "example.sk" is loaded

Is Silent

🔗

Condition

Patterns:
Since: 2.5
Checks whether an entity is silent i.e. its sounds are disabled.

Examples:

target entity is silent

Is Sleeping

🔗

Condition

Patterns:
  • %players% (is|are) sleeping
  • %players% (isn't|is not|aren't|are not) sleeping
Since: 1.4.4
Checks whether a player is sleeping.

Examples:

# cut your enemies' throats in their sleep >=)
on attack:
    attacker is holding a sword
    victim is sleeping
    increase the damage by 1000

Is Slime Chunk

🔗

Condition

Patterns:
  • %chunk% (is|are) ([a] slime chunk|slime chunks|slimey)
  • %chunk% (isn't|is not|aren't|are not) ([a] slime chunk|slime chunks|slimey)
Since: 2.3
Tests whether a chunk is a so-called slime chunk. Slimes can generally spawn in the swamp biome and in slime chunks. For more info, see the Minecraft wiki.

Examples:

command /slimey:
    trigger:
        if chunk at player is a slime chunk:
            send "Yeah, it is!"
        else:
            send "Nope, it isn't"

Is Sneaking

🔗

Condition

Patterns:
  • %players% (is|are) sneaking
  • %players% (isn't|is not|aren't|are not) sneaking
Since: 1.4.4
Checks whether a player is sneaking.

Examples:

# prevent mobs from seeing sneaking players if they are at least 4 meters apart
on target:
    target is sneaking
    distance of target and the entity is bigger than 4
    cancel the event

Is Solid

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is solid.

Examples:

grass block is solid
player's tool isn't solid

Is Sprinting

🔗

Condition

Patterns:
  • %players% (is|are) sprinting
  • %players% (isn't|is not|aren't|are not) sprinting
Since: 1.4.4
Checks whether a player is sprinting.

Examples:

player is not sprinting

Is Swimming

🔗

Condition

Patterns:
Since: 2.3
Requirements: 1.13 or newer
Checks whether a living entity is swimming.

Examples:

player is swimming

Is Tameable

🔗

Condition

Patterns:
Since: 2.5
Check if an entity is tameable.

Examples:

on damage:
    if victim is tameable:
        cancel event

Is Transparent

🔗

Condition

Patterns:
Since: 2.2-dev36
Checks whether an item is transparent. Note that this condition may not work for all blocks, due to the transparency list used by Spigot not being completely accurate.

Examples:

player's tool is transparent.

Is Unbreakable

🔗

Condition

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.11+
Checks whether an item is unbreakable.

Examples:

if event-item is unbreakable

Is Wearing

🔗

Condition

Patterns:
Since: 1.0
Checks whether a player is wearing some armour.

Examples:

player is wearing an iron chestplate and iron leggings
player is wearing all diamond armour

Is Whitelisted

🔗

Condition

Patterns:
  • [the] server (is|is(n't| not)) white[ ]listed
  • %players% (is|are)[(n't| not)] white[ ]listed
Since: 2.5.2
Whether or not the server or a player is whitelisted.

Examples:

if server is whitelisted:
if player is whitelisted

Is a Skript command

🔗

Condition

Patterns:
  • %text% (is|are) [a] s(k|c)ript (command|cmd)
  • %text% (isn't|is not|aren't|are not) [a] s(k|c)ript (command|cmd)
Since: 2.6
Checks whether a command/string is a custom Skript command.

Examples:

# Example 1
on command:
    command is a skript command

# Example 2
"sometext" is a skript command

Is in World

🔗

Condition

Patterns:
Since: 1.4
Checks whether an entity is in a specific world.

Examples:

player is in "world"
argument isn't in world "world_nether"
the player is in the world of the victim

Is of Type

🔗

Condition

Patterns:
Since: 1.4
Checks whether an item of an entity is of the given type. This is mostly useful for variables, as you can use the general 'is' condition otherwise (e.g. 'victim is a creeper').

Examples:

tool is of type {selected type}
victim is of type {villager type}

Is on Ground

🔗

Condition

Patterns:
  • %entities% (is|are) on [the] ground
  • %entities% (isn't|is not|aren't|are not) on [the] ground
Since: 2.2-dev26
Checks whether an entity is on ground.

Examples:

player is not on ground

Matches

🔗

Condition

Patterns:
  • %texts% (match[es]|do[es](n't| not) match) %texts%
  • %texts% (partially match[es]|do[es](n't| not) partially match) %texts%
Since: 2.5.2
Checks whether the defined strings match the input regexes (Regular expressions).

Examples:

on chat:
    if message partially matches "\d":
        send "Message contains a digit!"
    if message doesn't match "[A-Za-z]+":
        send "Message doesn't only contain letters!"

Projectile Can Bounce

🔗

Condition

Patterns:
Since: 2.5.1
Whether or not a projectile can bounce.

Examples:

on shoot:
    send "Boing!" to all players if projectile can bounce

PvP

🔗

Condition

Patterns:
  • (is PvP|PvP is) enabled [in %worlds%]
  • (is PvP|PvP is) disabled [in %worlds%]
Since: 1.3.4
Checks the PvP state of a world.

Examples:

PvP is enabled
PvP is disabled in "world"

Region Contains

🔗

Condition

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Checks whether a location is contained in a particular region. This condition requires a supported regions plugin to be installed.

Examples:

player is in the region {regions::3}

on region enter:
    region contains {flags.%world%.red}
    message "The red flag is near!"

Resource Pack

🔗

Condition

Patterns:
Since: 2.4
Usable in events: resource pack request response
Checks state of the resource pack in a resource pack request response event.

Examples:

on resource pack response:
    if the resource pack wasn't accepted:
        kick the player due to "You have to install the resource pack to play in this server!"

Starts/Ends With

🔗

Condition

Patterns:
  • %texts% (start|end)[s] with %texts%
  • %texts% (doesn't|does not|do not|don't) (start|end) with %texts%
Since: 2.2-dev36, 2.5.1 (multiple strings support)
Checks if a text starts or ends with another.

Examples:

if the argument starts with "test" or "debug":
    send "Stop!"

Time

🔗

Condition

Patterns:
Since: 2.0
Tests whether a given real time was more or less than some time span ago.

Examples:

command /command-with-cooldown:
    trigger:
        {command::%player's uuid%::last-usage} was less than a minute ago:
            message "Please wait a minute between uses of this command."
            stop
        set {command::%player's uuid%::last-usage} to now
        # ... actual command trigger here ...

Conditionals

🔗

Section

Patterns:
  • else
  • else [parse] if <.+>
  • [(parse if|if)] <.+>
Since: 1.0
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed

parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true

Examples:

if player's health is greater than or equal to 4:
    send "Your health is okay so far but be careful!"

else if player's health is greater than 2:
    send "You need to heal ASAP, your health is very low!"

else: # Less than 2 hearts
    send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"

parse if plugin "SomePluginName" is enabled: # parse if %condition%
    # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section

Loop

🔗

Section

Patterns:
Since: 1.0
Loop sections repeat their code with multiple values.

A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.

Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.

List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).

Examples:

loop all players:
    send "Hello %loop-player%!" to loop-player

loop items in player's inventory:
    if loop-item is dirt:
        set loop-item to air

loop 10 times:
    send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc.
    wait 1 second

loop {Coins::*}:
    set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200

While Loop

🔗

Section

Patterns:
  • [do] while <.+>
Since: 2.0, 2.6 (do while)
While Loop sections are loops that will just keep repeating as long as a condition is met.

Examples:

while size of all players < 5:
    send "More players are needed to begin the adventure" to all players
    wait 5 seconds

set {_counter} to 1
do while {_counter} > 1: # false but will increase {_counter} by 1 then get out
    add 1 to {_counter}

# Be careful when using while loops with conditions that are almost
# always true for a long time without using 'wait %timespan%' inside it,
# otherwise it will probably hang and crash your server.
while player is online:
    give player 1 dirt
    wait 1 second # without using a delay effect the server will crash

At Time

🔗

Event

Patterns:
  • [on] at %time% [in %worlds%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.3.4
An event that occurs at a given minecraft time in every world or only in specific worlds.

Examples:

at 18:00
at 7am in "world"

On Anvil Damage

🔗

Event

Patterns:
  • [on] [on] anvil damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Requirements: Paper
Called when an anvil is damaged/broken from being used to repair/rename items. Note: this does not include anvil damage from falling.

Examples:

on anvil damage:
    cancel the event

On Anvil Prepare

🔗

Event

Patterns:
  • [on] [on] anvil prepar(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.

Examples:

on anvil prepare:
    event-item is set # result item
    chance of 5%:
        set repair cost to repair cost * 50%
        send "You're LUCKY! You got 50% discount." to player

On AoE Cloud Effect

🔗

Event

Patterns:
  • [on] [on] (area|AoE) [cloud] effect [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when area effect cloud applies its potion effect. This happens every 5 ticks by default.

Examples:

on area cloud effect:

On Arm Swing

🔗

Event

Patterns:
  • [on] [on] [player] arm swing [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when a player swings his arm.

Examples:

on arm swing:
    send "You swung your arm!"

On Armor Change

🔗

Event

Patterns:
  • [on] [on] [player] armor change[d] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Paper
Called when armor pieces of a player are changed.

Examples:

on armor change:
    send "You equipped %event-item%!"

On Bed Enter

🔗

Event

Patterns:
  • [on] [on] bed enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] enter[ing] [a] bed [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts sleeping.

Examples:

on bed enter:

On Bed Leave

🔗

Event

Patterns:
  • [on] [on] bed leav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] leav(e|ing) [a] bed [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player leaves a bed.

Examples:

on player leaving a bed:

On Block Damage

🔗

Event

Patterns:
  • [on] [on] block damag(ing|e) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts to break a block. You can usually just use the leftclick event for this.

Examples:

on block damaging:
    if block is log:
        send "You can't break the holy log!"

On Block Fertilize

🔗

Event

Patterns:
  • [on] [on] [block] fertilize [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a player fertilizes blocks.

Examples:

on block fertilize:
    send "Fertilized %size of fertilized blocks% blocks got fertilized."

On Block Growth

🔗

Event

Patterns:
  • [on] [on] (plant|crop|block) grow[(th|ing)] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called when a crop grows. Alternative to new form of generic grow event.

Examples:

on crop growth:

On Book Edit

🔗

Event

Patterns:
  • [on] [on] book (edit|change|write) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev31
Called when a player edits a book.

Examples:

on book edit:

On Book Sign

🔗

Event

Patterns:
  • [on] [on] book sign[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev31
Called when a player signs a book.

Examples:

on book sign:

On Break / Mine

🔗

Event

Patterns:
  • [on] [on] [block] (break[ing]|min(e|ing)) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (break), unknown (mine), 2.6 (BlockData support)
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.

Examples:

on mine:
on break of stone:
on mine of any ore:
on break of chest[facing=north]:
on break of potatoes[age=7]:

On Bucket Empty

🔗

Event

Patterns:
  • [on] [on] bucket empty[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] empty[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player empties a bucket. You can also use the place event with a check for water or lava.

Examples:

on bucket empty:

On Bucket fill

🔗

Event

Patterns:
  • [on] [on] bucket fill[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] fill[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player fills a bucket.

Examples:

on player filling a bucket:

On Burn

🔗

Event

Patterns:
  • [on] [on] [block] burn[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block is destroyed by fire.

Examples:

on burn:
on burn of wood, fences, or chests:
on burn of oak_log[axis=y]:

On Can Build Check

🔗

Event

Patterns:
  • [on] [on] [block] can build check [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (basic), 2.0 ([un]cancellable)
Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it. Please note that the data value of the block to be placed is not available in this event, only its ID.

Examples:

on block can build check:
    cancel event

On Chat

🔗

Event

Patterns:
  • [on] [on] chat [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.1
Called whenever a player chats. Use chat format to change message format, use chat recipients to edit chat recipients.

Examples:

on chat:
    if player has permission "owner":
        set chat format to "<red>[player]<light gray>: <light red>[message]"
    else if player has permission "admin":
        set chat format to "<light red>[player]<light gray>: <orange>[message]"
    else: #default message format
        set chat format to "<orange>[player]<light gray>: <white>[message]"

On Chunk Generate

🔗

Event

Patterns:
  • [on] [on] chunk (generat|populat)(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called after a new chunk was generated.

Examples:

on chunk generate:

On Chunk Load

🔗

Event

Patterns:
  • [on] [on] chunk load[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.

Examples:

on chunk load:

On Chunk Unload

🔗

Event

Patterns:
  • [on] [on] chunk unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a chunk is unloaded due to not being near any player.

Examples:

on chunk unload:

On Click

🔗

Event

Patterns:
  • [on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a user clicks on a block, an entity or air with or without an item in their hand. Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them. Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.

Examples:

on click:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:

On Combust

🔗

Event

Patterns:
  • [on] [on] combust[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).

Examples:

on combust:

On Command

🔗

Event

Patterns:
  • [on] [on] command [%text%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.

Examples:

on command:
on command "/stop":
on command "pm Njol ":

On Connect

🔗

Event

Patterns:
  • [on] [on] [player] connect[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when the player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over on join.

Examples:

on connect:
    player doesn't have permission "VIP"
    number of players is greater than 15
    kick the player due to "The last 5 slots are reserved for VIP players."

On Consume

🔗

Event

Patterns:
  • [on] [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.

Examples:

on consume:

On Craft

🔗

Event

Patterns:
  • [on] [on] [player] craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a player crafts an item.

Examples:

on craft:

On Creeper Power

🔗

Event

Patterns:
  • [on] [on] creeper power [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.

Examples:

on creeper power:

On Damage

🔗

Event

Patterns:
  • [on] [on] damag(e|ing) [of %entity type%] [by %entity type%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, INSERT VERSION (by entity)
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.

Examples:

on damage:
on damage of a player:
on damage of player by zombie:

On Death

🔗

Event

Patterns:
  • [on] [on] death [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a living entity (including players) dies.

Examples:

on death:
on death of player:
on death of a wither or ender dragon:
    broadcast "A %entity% has been slain in %world%!"

On Dispense

🔗

Event

Patterns:
  • [on] [on] dispens(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a dispenser dispenses an item.

Examples:

on dispense of iron block:
    send "that'd be 19.99 please!"

On Drop

🔗

Event

Patterns:
  • [on] [on] [player] drop[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a player drops an item from their inventory.

Examples:

on drop:

On Egg Throw

🔗

Event

Patterns:
  • [on] [on] throw[ing] [of] [an] egg [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] egg throw [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.

Examples:

on throw of an egg:

On Enchant

🔗

Event

Patterns:
  • [on] [on] [item] enchant [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when a player successfully enchants an item. To get the enchanted item, see the enchant item expression

Examples:

on enchant:
    if the clicked button is 1: # offer 1
        set the applied enchantments to sharpness 10 and unbreaking 10

On Enchant Prepare

🔗

Event

Patterns:
  • [on] [on] [item] enchant prepare [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

On Enderman/Sheep/Silverfish/Falling Block

🔗

Event

Patterns:
  • [on] [on] enderman place [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] enderman pickup [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] sheep eat [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] silverfish enter [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] silverfish exit [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] falling block land[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown, 2.5.2 (falling block)
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively.

Examples:

on sheep eat:
    kill entity
    broadcast "A sheep stole some grass!"
on falling block land:
    if event-entity is a falling dirt:
        cancel event

On Entity Dismount

🔗

Event

Patterns:
  • [on] [on] dismount[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev13b
Called when an entity dismounts.

Examples:

on dismount:
    kill event-entity

On Entity Mount

🔗

Event

Patterns:
  • [on] [on] mount[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev13b
Called when entity starts riding another.

Examples:

on mount:
    cancel event

On Entity Portal

🔗

Event

Patterns:
  • [on] [on] entity portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.3
Called when an entity uses a nether or end portal. Cancel the event to prevent the entity from teleporting.

Examples:

on entity portal:
    broadcast "A %type of event-entity% has entered a portal!

On Experience Spawn

🔗

Event

Patterns:
  • [on] [on] [e]xp[erience] [orb] spawn [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] spawn of [a[n]] [e]xp[erience] [orb] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event. Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)

Examples:

on xp spawn:
    world is "minigame_world"
    cancel event

On Explode

🔗

Event

Patterns:
  • [on] [on] explo(d(e|ing)|sion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity (a primed TNT or a creeper) explodes.

Examples:

on explosion:

On Explosion Prime

🔗

Event

Patterns:
  • [on] [on] explosion prime [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.

Examples:

on explosion prime:

On Fade

🔗

Event

Patterns:
  • [on] [on] [block] fad(e|ing) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block 'fades away', e.g. ice or snow melts.

Examples:

on fade of snow or ice:
on fade of snow[layers=2]

On Firework Explode

🔗

Event

Patterns:
  • [on] [on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.4
Called when a firework explodes.

Examples:

on firework explode
on firework exploding colored red, light green and black
on firework explosion colored light green:
    broadcast "A firework colored %colors% was exploded at %location%!"

On First Join

🔗

Event

Patterns:
  • [on] [on] first (join|login) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.3.7
Called when a player joins the server for the first time.

Examples:

on first join:
    broadcast "Welcome %player% to the server!"

On Fishing

🔗

Event

Patterns:
  • [on] [on] [player] fish[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player fishes something. This is not of much use yet.

Examples:

on fish:

On Flight Toggle

🔗

Event

Patterns:
  • [on] [on] [player] flight toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] toggl(e|ing) flight [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev36
Called when a players stops/starts flying.

Examples:

on flight toggle:
    if {game::%player%::playing} exists:
        cancel event

On Flow

🔗

Event

Patterns:
  • [on] [on] [block] flow[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] block mov(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.

Examples:

on block flow:
    if event-block is water:
        broadcast "Build more dams! It's starting to get wet in here"

On Form

🔗

Event

Patterns:
  • [on] [on] [block] form[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).

Examples:

on form of snow:
on form of a mushroom:

On Fuel Burn

🔗

Event

Patterns:
  • [on] [on] fuel burn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a furnace burns an item from its fuel slot.

Examples:

on fuel burning:

On Gamemode Change

🔗

Event

Patterns:
  • [on] [on] game[ ]mode change [to %gamemode%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player's gamemode changes.

Examples:

on gamemode change:
on gamemode change to adventure:

On Gliding State Change

🔗

Event

Patterns:
  • [on] [on] (gliding state change|toggl(e|ing) gliding) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when an entity toggles glider on or off, or when server toggles gliding state of an entity forcibly.

Examples:

on toggling gliding:
    cancel the event # bad idea, but you CAN do it!

On Grow

🔗

Event

Patterns:
  • [on] [on] grow [of (%tree type%|%item type%)] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (2.2-dev20 for plants)
Called when a tree, giant mushroom or plant grows to next stage.

Examples:

on grow:
on grow of a tree:
on grow of a huge jungle tree:

On Hand Item Swap

🔗

Event

Patterns:
  • [on] [on] swap[ping of] [(hand|held)] item[s] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called whenever a player swaps the items in their main- and offhand slots. Works also when one or both of the slots are empty. The event is called before the items are actually swapped, so when you use the player's tool or player's offtool expressions, they will return the values before the swap - this enables you to cancel the event before anything happens.

Examples:

on swap hand items:
    event-player's tool is a diamond sword
    cancel event

On Heal

🔗

Event

Patterns:
  • [on] [on] heal[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).

Examples:

on heal:

On Horse Jump

🔗

Event

Patterns:
  • [on] [on] horse jump [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when a horse jumps.

Examples:

on horse jump:
    push event-entity upwards at speed 2

On Hunger Meter Change

🔗

Event

Patterns:
  • [on] [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.4
Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.

Examples:

on food bar change:

On Ignition

🔗

Event

Patterns:
  • [on] [on] [block] ignit(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable. The burn event will be called when the block is about do be destroyed by the fire.

Examples:

on block ignite:
    if event-block is a ladder:
        cancel event

On Inventory Click

🔗

Event

Patterns:
  • [on] [on] [player] inventory(-| )click[ing] [[at] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called when clicking on inventory slot.

Examples:

on inventory click:
    if event-item is stone:
        give player 1 stone
        remove 20$ from player's balance

On Inventory Close

🔗

Event

Patterns:
  • [on] [on] inventory clos(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when player's currently viewed inventory is closed.

Examples:

on inventory close:
    if player's location is {location}:
        send "You exited the shop!"

On Inventory Open

🔗

Event

Patterns:
  • [on] [on] inventory open[ed] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when an inventory is opened for player.

Examples:

on inventory open:
    close player's inventory

On Inventory Pickup

🔗

Event

Patterns:
  • [on] [on] inventory pick[ ]up [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when an inventory (a hopper, a hopper minecart, etc.) picks up an item

Examples:

on inventory pickup:

On Item Break

🔗

Event

Patterns:
  • [on] [on] [player] tool break[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] break[ing] [(a|the)] tool [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.1.1
Called when a player breaks their tool because its damage reached the maximum value. This event cannot be cancelled.

Examples:

on tool break:

On Item Damage

🔗

Event

Patterns:
  • [on] [on] item damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when an item is damaged. Most tools are damaged by using them; armor is damaged when the wearer takes damage.

Examples:

on item damage:
    cancel event

On Item Despawn

🔗

Event

Patterns:
  • [on] [on] (item[ ][stack]|[item] %item types%) despawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [item[ ][stack]] despawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev35
Called when an item is about to be despawned from the world, usually 5 minutes after it was dropped.

Examples:

on item despawn of diamond:
    send "Not my precious!"
    cancel event

On Item Mend

🔗

Event

Patterns:
  • [on] [on] item mend[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Requirements: Minecraft 1.13 or newer
Called when a player has an item repaired via the Mending enchantment.

Examples:

on item mend:
    chance of 50%:
        cancel the event
        send "Oops! Mending failed!" to player

On Item Merge

🔗

Event

Patterns:
  • [on] [on] (item[ ][stack]|[item] %item types%) merg(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] item[ ][stack] merg(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev35
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.

Examples:

on item merge of gold blocks:
    cancel event

On Item Spawn

🔗

Event

Patterns:
  • [on] [on] item spawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of their inventory, or a dispenser dispensing an item (not shooting it).

Examples:

on item spawn of iron sword:
    broadcast "Someone dropped an iron sword!"

On Join

🔗

Event

Patterns:
  • [on] [on] [player] (login|logging in|join[ing]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer on connect over this event.

Examples:

on join:
    message "Welcome on our awesome server!"
    broadcast "%player% just joined the server!"

On Jump

🔗

Event

Patterns:
  • [on] [on] [player] jump[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called whenever a player jumps. This event requires PaperSpigot.

Examples:

on jump:
    event-player does not have permission "jump"
    cancel event

On Kick

🔗

Event

Patterns:
  • [on] [on] [player] (kick|being kicked) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player is kicked from the server. You can change the kick message or cancel the event entirely.

Examples:

on kick:

On Language Change

🔗

Event

Patterns:
  • [on] [on] [player] (language|locale) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] chang(e|ing) (language|locale) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.

Examples:

on language change:
    if player's language starts with "en":
        send "Hello!"

On Leaves Decay

🔗

Event

Patterns:
  • [on] [on] leaves decay[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a leaf block decays due to not being connected to a tree.

Examples:

on leaves decay:

On Level Change

🔗

Event

Patterns:
  • [on] [on] [player] level (change|up|down) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.4 (level up/down)
Called when a player's level changes, e.g. by gathering experience or by enchanting something.

Examples:

on level change:

On Lightning Strike

🔗

Event

Patterns:
  • [on] [on] lightning [strike] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when lightning strikes.

Examples:

on lightning:
    spawn a zombie at location of event-entity

On Move

🔗

Event

Patterns:
  • [on] [on] %entity type% (move|walk|step) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.6
Requirements: Paper 1.16.5+ (entity move)
Called when a player or entity moves. NOTE: Move event will only be called when the entity/player moves position, not orientation (ie: looking around). NOTE: These events can be performance heavy as they are called quite often. If you use these events, and later remove them, a server restart is recommended to clear registered events from Skript.

Examples:

on player move:
    if player does not have permission "player.can.move":
        cancel event
on skeleton move:
    if event-entity is not in world "world":
        kill event-entity

On Move On

🔗

Event

Patterns:
  • [on] [on] (step|walk)[ing] (on|over) %*item types% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.

Examples:

on walking on dirt or grass:
on stepping on stone:

On Physics

🔗

Event

Patterns:
  • [on] [on] [block] physics [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.6
Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.Please note that using this event might cause quite some lag since it gets called extremely often.

Examples:

# prevents sand from falling
on block physics:
    block is sand
    cancel event

On Pick Up

🔗

Event

Patterns:
  • [on] [on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1), 2.5 (entity)
Requirements: 1.12.2+ for entity
Called when a player/entity picks up an item. Please note that the item is still on the ground when this event is called.

Examples:

on pick up:
on entity pickup of wheat:

On Pig Zap

🔗

Event

Patterns:
  • [on] [on] pig[ ]zap [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a pig is stroke by lightning and transformed into a zombie pigman. Cancel the event to prevent the transformation.

Examples:

on pig zap:

On Piston Extend

🔗

Event

Patterns:
  • [on] [on] piston extend[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a piston is about to extend.

Examples:

on piston extend:
    broadcast "A piston is extending!"

On Piston Retract

🔗

Event

Patterns:
  • [on] [on] piston retract[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a piston is about to retract.

Examples:

on piston retract:
    broadcast "A piston is retracting!"

On Place

🔗

Event

Patterns:
  • [on] [on] [block] (plac(e|ing)|build[ing]) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a player places a block.

Examples:

on place:
on place of a furnace, workbench or chest:
on break of chest[type=right] or chest[type=left]

On Player Trade

🔗

Event

Patterns:
  • [on] [on] player trad(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Requirements: Paper 1.16.5+
Called when a player has traded with a villager.

Examples:

on player trade:
    chance of 50%:
        cancel event
        send "The trade was somehow denied!" to player

On Player World Change

🔗

Event

Patterns:
  • [on] [on] [player] world chang(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev28
Called when a player enters a world. Does not work with other entities!

Examples:

on player world change:
    world is "city"
    send "Welcome to the City!"

On Portal

🔗

Event

Patterns:
  • [on] [on] [player] portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player uses a nether or end portal. Cancel the event to prevent the player from teleporting.

Examples:

on player portal:

On Portal Create

🔗

Event

Patterns:
  • [on] [on] portal creat(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.5.3 (event-entity support)
Requirements: Minecraft 1.14+ (event-entity support)
Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld. In Minecraft 1.14+, you can use the player in this event. Please note that there may not always be a player (or other entity) in this event.

Examples:

on portal create:

On Portal Enter

🔗

Event

Patterns:
  • [on] [on] portal enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] entering [a] portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity enters a nether portal or an end portal. Please note that this event will be fired many times for a nether portal.

Examples:

on portal enter:

On Prepare Craft

🔗

Event

Patterns:
  • [on] [on] [player] (preparing|beginning) craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called just before displaying crafting result to player. Note that setting the result item might or might not work due to Bukkit bugs.

Examples:

on preparing craft of torch:

On Pressure Plate / Trip

🔗

Event

Patterns:
  • [on] [on] [step[ping] on] [a] [pressure] plate [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] (trip|[step[ping] on] [a] tripwire) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (pressure plate), 1.4.4 (tripwire)
Called when a player steps on a pressure plate or tripwire respectively.

Examples:

on step on pressure plate:

On Projectile Collide

🔗

Event

Patterns:
  • [on] [on] projectile collide [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Paper
Called when a projectile collides with an entity.

Examples:

on projectile collide:
    teleport shooter of event-projectile to event-entity

On Projectile Hit

🔗

Event

Patterns:
  • [on] [on] projectile hit [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a projectile hits an entity or a block. Use the damage event with a check for a projectile to be able to use the entity that got hit in the case when the projectile hit a living entity. A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.

Examples:

on projectile hit:
    event-projectile is arrow
    delete event-projectile

On Quit

🔗

Event

Patterns:
  • [on] [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing)) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (simple disconnection)
Called when a player leaves the server.

Examples:

on quit:
on disconnect:

On Redstone

🔗

Event

Patterns:
  • [on] [on] redstone [current] [chang(e|ing)] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the redstone current of a block changes. This event is of not much use yet.

Examples:

on redstone change:
    send "someone is using redstone" to console

On Region Enter/Leave

🔗

Event

Patterns:
  • [on] [on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] region (enter[ing]|leav(e|ing)|exit[ing]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.1
Requirements: Supported regions plugin
Called when a player enters or leaves a region. This event requires a supported regions plugin to be installed.

Examples:

on region exit:
    message "Leaving %region%."

On Resource Pack Request Response

🔗

Event

Patterns:
  • [on] [on] resource pack [request] response [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] resource pack [request] %resource pack states% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.4
Called when a player takes action on a resource pack request sent via the send resource pack effect. The resource pack condition can be used to check the resource pack state.

This event will be triggered once when the player accepts or declines the resource pack request, and once when the resource pack is successfully installed or failed to download.

Examples:

on resource pack request response:
    if the resource pack was declined or failed to download:

on resource pack deny:
    kick the player due to "You have to install the resource pack to play in this server!"

On Respawn

🔗

Event

Patterns:
  • [on] [on] [player] respawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player respawns. You should prefer this event over the death event as the player is technically alive when this event is called.

Examples:

on respawn:

On Resurrect Attempt

🔗

Event

Patterns:
  • [on] [on] [entity] resurrect[ion] [attempt] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev28
Called when an entity dies, always. If they are not holding a totem, this is cancelled - you can, however, uncancel it.

Examples:

on resurrect attempt:
    entity is player
    entity has permission "admin.undying"
    uncancel the event

On Riptide

🔗

Event

Patterns:
  • [on] [on] [use of] riptide [enchant[ment]] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.

Examples:

on riptide:
    send "You are riptiding!"

On Script Load/Unload

🔗

Event

Patterns:
  • [on] [on] [async] [script] (load|init|enable) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [async] [script] (unload|stop|disable) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,

Examples:

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

On Server List Ping

🔗

Event

Patterns:
  • [on] [on] server [list] ping [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. The IP expression can be used to get the IP adress of the pinger. This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).

Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.

Examples:

on server list ping:
    set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
    set the fake max players count to (online players count + 1)
    set the shown icon to a random server icon out of {server-icons::*}

On Server Start/Stop

🔗

Event

Patterns:
  • [on] [on] (server|skript) (start|load|enable) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] (server|skript) (stop|unload|disable) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).

Examples:

on skript start:
on server stop:

On Sheep Regrow Wool

🔗

Event

Patterns:
  • [on] [on] sheep [re]grow[ing] wool [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when sheep regrows its sheared wool back.

Examples:

on sheep grow wool:
    cancel event

On Shoot

🔗

Event

Patterns:
  • [on] [on] [projectile] shoot [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a projectile is shot. Use the shooter expression to get who shot the projectile.

Examples:

on shoot:
    if projectile is an arrow:
        send "you shot an arrow!" to shooter

On Sign Change

🔗

Event

Patterns:
  • [on] [on] sign (chang[e]|edit)[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] (chang[e]|edit)[ing] [a] sign [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
As signs are placed empty, this event is called when a player is done editing a sign.

Examples:

on sign change:
    line 2 is empty
    set line 1 to "<red>%line 1%"

On Slime Split

🔗

Event

Patterns:
  • [on] [on] slime split[ting] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev26
Called when a slime splits. Usually this happens when a big slime dies.

Examples:

on slime split:

On Smelt

🔗

Event

Patterns:
  • [on] [on] [ore] smelt[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] smelt[ing] of ore [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a furnace smelts an item in its ore slot.

Examples:

on smelt:

On Sneak Toggle

🔗

Event

Patterns:
  • [on] [on] [player] toggl(e|ing) sneak [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] sneak toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts or stops sneaking. Use is sneaking to get whether the player was sneaking before the event was called.

Examples:

# make players that stop sneaking jump
on sneak toggle:
    player is sneaking
    push the player upwards at speed 0.5

On Spawn

🔗

Event

Patterns:
  • [on] [on] spawn[ing] [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.5.1 (non-living entities)
Called when an entity spawns (excluding players).

Examples:

on spawn of a zombie:
on spawn of an ender dragon:
    broadcast "A dragon has been sighted in %world%!"

On Spawn Change

🔗

Event

Patterns:
  • [on] [on] [world] spawn change [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the spawn point of a world changes.

Examples:

on spawn change:
    broadcast "someone changed the spawn!"

On Sponge Absorb

🔗

Event

Patterns:
  • [on] [on] sponge absorb [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a sponge absorbs blocks.

Examples:

on sponge absorb:
    loop absorbed blocks:
        broadcast "%loop-block% was absorbed by a sponge"!

On Spread

🔗

Event

Patterns:
  • [on] [on] spread[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a new block forms as a result of a block that can spread, e.g. water or mushrooms.

Examples:

on spread:

On Sprint Toggle

🔗

Event

Patterns:
  • [on] [on] [player] toggl(e|ing) sprint [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] sprint toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts or stops sprinting. Use is sprinting to get whether the player was sprinting before the event was called.

Examples:

on sprint toggle:
    player is not sprinting
    send "Run!"

On Swim Toggle

🔗

Event

Patterns:
  • [on] [on] [entity] toggl(e|ing) swim [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [entity] swim toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Requirements: 1.13 or newer
Called when an entity swims or stops swimming.

Examples:

on swim toggle:
    event-entity does not have permission "swim"
    cancel event

On Tame

🔗

Event

Patterns:
  • [on] [on] [entity] tam(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.

Examples:

on tame:

On Target

🔗

Event

Patterns:
  • [on] [on] [entity] target [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [entity] un[-]target [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a mob starts/stops following/attacking another entity, usually a player.

Examples:

on entity target:
    target is a player

On Teleport

🔗

Event

Patterns:
  • [on] [on] [player] teleport[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).

Examples:

on teleport:

On Tool Change

🔗

Event

Patterns:
  • [on] [on] [player['s]] (tool|item held|held item) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.

Examples:

on player's held item change:

On Vehicle Create

🔗

Event

Patterns:
  • [on] [on] vehicle create [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] creat(e|ing|ion of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a new vehicle is created, e.g. when a player places a boat or minecart.

Examples:

on vehicle create:

On Vehicle Damage

🔗

Event

Patterns:
  • [on] [on] vehicle damage [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] damag(e|ing) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a vehicle gets damage. Too much damage will destroy the vehicle.

Examples:

on vehicle damage:

On Vehicle Destroy

🔗

Event

Patterns:
  • [on] [on] vehicle destroy [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] destr(oy[ing]|uction of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a vehicle is destroyed. Any passenger will be ejected and the vehicle might drop some item(s).

Examples:

on vehicle destroy:
    cancel event

On Vehicle Enter

🔗

Event

Patterns:
  • [on] [on] vehicle enter [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] enter[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity enters a vehicle, either deliberately (players) or by falling into them (mobs).

Examples:

on vehicle enter:
    entity is a player
    cancel event

On Vehicle Exit

🔗

Event

Patterns:
  • [on] [on] vehicle exit [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] exit[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity exits a vehicle.

Examples:

on vehicle exit:
    if event-entity is a spider:
        kill event-entity

On Weather Change

🔗

Event

Patterns:
  • [on] [on] weather change [to %weather types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world's weather changes.

Examples:

on weather change:
on weather change to sunny:

On World Init

🔗

Event

Patterns:
  • [on] [on] world init[ialization] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds. World management plugins might change the behaviour of this event though.

Examples:

on world init:

On World Load

🔗

Event

Patterns:
  • [on] [on] world load[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).

Examples:

on world load:
    send "World is loading..." to console

On World Save

🔗

Event

Patterns:
  • [on] [on] world sav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.

Examples:

on world saving:
    broadcast "World has been saved!"

On World Unload

🔗

Event

Patterns:
  • [on] [on] world unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is unloaded. This event might never be called if you don't have a world management plugin.

Examples:

on world unload:
    cancel event

On Zombie Break Door

🔗

Event

Patterns:
  • [on] [on] zombie break[ing] [a] [wood[en]] door [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.

Examples:

on zombie breaking a wood door:

Periodical

🔗

Event

Patterns:
  • [on] every %time span% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days:

Periodical

🔗

Event

Patterns:
  • [on] every %time span% in [world[s]] %worlds% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds in "world":
every minecraft hour in "flatworld":
every tick in "world": # can cause lag depending on the code inside the event
every minecraft days in "plots":

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: 2.0
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: aliases-rework
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

Unknown Name

🔗

Type

Patterns:
  • Missing patterns.
Since: Unknown
Missing description.

Examples:

Missing examples.

abs

🔗

Function

Patterns:
  • abs(n: number)
Since: 2.2
Return Type: number
Returns the absolute value of the argument, i.e. makes the argument positive.

Examples:

abs(3) = 3
abs(-2) = 2

acos

🔗

Function

Patterns:
  • acos(n: number)
Since: 2.2
Return Type: number
The inverse of the cosine, also called arccos. Returns result in degrees, not radians. Only returns values from 0 to 180.

Examples:

acos(0) = 90
acos(1) = 0
acos(0.5) = 30

asin

🔗

Function

Patterns:
  • asin(n: number)
Since: 2.2
Return Type: number
The inverse of the sine, also called arcsin. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

asin(0) = 0
asin(1) = 90
asin(0.5) = 30

atan

🔗

Function

Patterns:
  • atan(n: number)
Since: 2.2
Return Type: number
The inverse of the tangent, also called arctan. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

atan(0) = 0
atan(1) = 45
atan(10000) = 89.9943

atan2

🔗

Function

Patterns:
  • atan2(x: number, y: number)
Since: 2.2
Return Type: number
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).

Examples:

atan2(0, 1) = 0
atan2(10, 0) = 90
atan2(-10, 5) = -63.4349

calcExperience

🔗

Function

Patterns:
  • calcExperience(level: long)
Since: 2.2-dev32
Return Type:
Calculates the total amount of experience needed to achieve given level from scratch in Minecraft.

Examples:

Missing examples.

ceil

🔗

Function

Patterns:
  • ceil(n: number)
Since: 2.2
Return Type:
Rounds a number up, i.e. returns the closest integer larger than or equal to the argument.

Examples:

ceil(2.34) = 3
ceil(2) = 2
ceil(2.99) = 3

ceiling

🔗

Function

Patterns:
  • ceiling(n: number)
Since: 2.2
Return Type:
Alias of ceil.

Examples:

ceiling(2.34) = 3
ceiling(2) = 2
ceiling(2.99) = 3

cos

🔗

Function

Patterns:
  • cos(n: number)
Since: 2.2
Return Type: number
The cosine function. This is basically the sine shifted by 90°, i.e. cos(a) = sin(a + 90°), for any number a. Uses degrees, not radians.

Examples:

cos(0) = 1
cos(90) = 0

date

🔗

Function

Patterns:
  • date(year: number, month: number, day: number, hour: number = [[integer:0]], minute: number = [[integer:0]], second: number = [[integer:0]], millisecond: number = [[integer:0]], zone_offset: number = [[double:NaN]], dst_offset: number = [[double:NaN]])
Since: 2.2
Return Type: date
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).

Examples:

date(2014, 10, 1) # 0:00, 1st October 2014
date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990
date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)

exp

🔗

Function

Patterns:
  • exp(n: number)
Since: 2.2
Return Type: number
The exponential function. You probably don't need this if you don't know what this is.

Examples:

exp(0) = 1
exp(1) = 2.7183

floor

🔗

Function

Patterns:
  • floor(n: number)
Since: 2.2
Return Type:
Rounds a number down, i.e. returns the closest integer smaller than or equal to the argument.

Examples:

floor(2.34) = 2
floor(2) = 2
floor(2.99) = 2

ln

🔗

Function

Patterns:
  • ln(n: number)
Since: 2.2
Return Type: number
The natural logarithm. You probably don't need this if you don't know what this is. Returns NaN (not a number) if the argument is negative.

Examples:

ln(1) = 0
ln(exp(5)) = 5
ln(2) = 0.6931

location

🔗

Function

Patterns:
  • location(x: number, y: number, z: number, world: world = event-world, yaw: number = [[integer:0]], pitch: number = [[integer:0]])
Since: 2.2
Return Type: location
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.

Examples:

location(0, 128, 0)
location(player's x-coordinate, player's y-coordinate + 5, player's z-coordinate, player's world, 0, 90)
location(0, 64, 0, world "world_nether")
location(100, 110, -145, world("my_custom_world"))

log

🔗

Function

Patterns:
  • log(n: number, base: number = [[integer:10]])
Since: 2.2
Return Type: number
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.

Examples:

log(100) = 2 # 10^2 = 100
log(16, 2) = 4 # 2^4 = 16

max

🔗

Function

Patterns:
  • max(ns: numbers)
Since: 2.2
Return Type: number
Returns the maximum number from a list of numbers.

Examples:

max(1) = 1
max(1, 2, 3, 4) = 4
max({some list variable::*})

min

🔗

Function

Patterns:
  • min(ns: numbers)
Since: 2.2
Return Type: number
Returns the minimum number from a list of numbers.

Examples:

min(1) = 1
min(1, 2, 3, 4) = 1
min({some list variable::*})

mod

🔗

Function

Patterns:
  • mod(d: number, m: number)
Since: 2.2
Return Type: number
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.

Examples:

mod(3, 2) = 1
mod(256436, 100) = 36
mod(-1, 10) = 9

product

🔗

Function

Patterns:
  • product(ns: numbers)
Since: 2.2
Return Type: number
Calculates the product of a list of numbers.

Examples:

product(1) = 1
product(2, 3, 4) = 24
product({some list variable::*})
product(2, {_v::*}, and the player's y-coordinate)

rgb

🔗

Function

Patterns:
  • rgb(red: long, green: long, blue: long)
Since: 2.5
Return Type: color
Returns a RGB color from the given red, green and blue parameters.

Examples:

dye player's leggings rgb(120, 30, 45)

round

🔗

Function

Patterns:
  • round(n: number)
Since: 2.2
Return Type:
Rounds a number, i.e. returns the closest integer to the argument.

Examples:

round(2.34) = 2
round(2) = 2
round(2.99) = 3
round(2.5) = 3

sin

🔗

Function

Patterns:
  • sin(n: number)
Since: 2.2
Return Type: number
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.

Examples:

sin(90) = 1
sin(60) = 0.866

sqrt

🔗

Function

Patterns:
  • sqrt(n: number)
Since: 2.2
Return Type: number
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.

Examples:

sqrt(4) = 2
sqrt(2) = 1.4142
sqrt(-1) = NaN

sum

🔗

Function

Patterns:
  • sum(ns: numbers)
Since: 2.2
Return Type: number
Sums a list of numbers.

Examples:

sum(1) = 1
sum(2, 3, 4) = 9
sum({some list variable::*})
sum(2, {_v::*}, and the player's y-coordinate)

tan

🔗

Function

Patterns:
  • tan(n: number)
Since: 2.2
Return Type: number
The tangent function. This is basically sin(arg)/cos(arg). Uses degrees, not radians.

Examples:

tan(0) = 0
tan(45) = 1
tan(89.99) = 5729.5779

vector

🔗

Function

Patterns:
  • vector(x: number, y: number, z: number)
Since: 2.2-dev23
Return Type: vector
Creates a new vector, which can be used with various expressions, effects and functions.

Examples:

vector(0, 0, 0)

world

🔗

Function

Patterns:
  • world(name: string)
Since: 2.2
Return Type: world
Gets a world from its name.

Examples:

set {_nether} to world("%{_world}%_nether")
\ No newline at end of file diff --git a/docs.json b/docs.json index 2425eba9107..4c0658a319b 100644 --- a/docs.json +++ b/docs.json @@ -3,744 +3,112 @@ "classes" : [ { - "id" : "attributetype", - "name" : "Attribute Type", - "patterns" : [ - "generic attack speed, luck, max health, generic movement speed, flying speed, attack damage, horse jump strength, generic attack damage, generic luck, generic armor, generic flying speed, follow range, generic knockback resistance, movement speed, generic follow range, zombie spawn reinforcements, armor, generic attack knockback, attack speed, armor toughness, knockback resistance, generic max health, attack knockback, generic armor toughness", - - "pattern_end" - ], - "since" : "2.5", - "description" : "Represents the type of an attribute. Note that this type does not contain any numerical values.See attribute types for more info.", - "examples" : "Missing examples." -}, -{ - "id" : "biome", - "name" : "Biome", - "patterns" : [ - "Biome names; you can use F3 ingame", - - "pattern_end" - ], - "since" : "1.4.4", - "description" : "All possible biomes Minecraft uses to generate a world.", - "examples" : "biome at the player is desert" -}, -{ - "id" : "block", - "name" : "Block", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A block in a world. It has a location and a type, and can also have a direction (mostly a facing), an inventory, or other special properties.", - "examples" : "Missing examples." -}, -{ - "id" : "blockdata", - "name" : "Block Data", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.5", - "description" : "Block data is the detailed information about a block, referred to in Minecraft as BlockStates, allowing for the manipulation of different aspects of the block, including shape, waterlogging, direction the block is facing, and so much more. Information regarding each block's optional data can be found on Minecraft's Wiki. Find the block you're looking for and scroll down to 'Block States'. Different states must be separated by a semicolon (see examples). The 'minecraft:' namespace is optional, as well as are underscores.", - "examples" : "set block at player to campfire[lit=false]\\nset target block of player to oak stairs[facing=north;waterlogged=true]\\nset block at player to grass_block[snowy=true]\\nset loop-block to minecraft:chest[facing=north]\\nset block above player to oak_log[axis=y]\\nset target block of player to minecraft:oak_leaves[distance=2;persistent=false]" -}, -{ - "id" : "boolean", - "name" : "Boolean", - "patterns" : [ - "true/yes/on or false/no/off", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A boolean is a value that is either true or false. Other accepted names are 'on' and 'yes' for true, and 'off' and 'no' for false.", - "examples" : "set {config.%player%.use mod} to false" -}, -{ - "id" : "CatType", - "name" : "Cat Type", - "patterns" : [ - "red, all black, british shorthair, ragdoll, white, jellie, siamese, black, tabby, calico, persian", - - "pattern_end" - ], - "since" : "2.4", - "description" : "Represents the race/type of a cat entity.", - "examples" : "Missing examples." -}, -{ - "id" : "chunk", - "name" : "Chunk", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.0", - "description" : "A chunk is a cuboid of 16×16×128 (x×z×y) blocks. Chunks are spread on a fixed rectangular grid in their world.", - "examples" : "Missing examples." -}, -{ - "id" : "clicktype", - "name" : "Click Type", - "patterns" : [ - "lmb, number key, mmb, rmb, drop item, drop key, window border using left mouse button, unknown, window border using right mouse, shift+rmb, unsupported, shift+lmb, ctrl+q, swap shield, left mouse button, left mouse with shift, left mouse, 0-9, double click, double click using mouse, border using rmb, right mouse button, right mouse button with shift, border using lmb, middle mouse, drop key with control, window border using right mouse button, swap offhand, custom, q, right mouse with shift, middle mouse button, drop stack, left mouse button with shift, right mouse, creative action", - - "pattern_end" - ], - "since" : "2.2-dev16b, 2.2-dev35 (renamed to click type)", - "description" : "Click type, mostly for inventory events. Tells exactly which keys/buttons player pressed, assuming that default keybindings are used in client side.", - "examples" : "Missing examples." -}, -{ - "id" : "color", - "name" : "Color", - "patterns" : [ - "black, dark grey/dark gray, grey/light grey/gray/light gray/silver, white, blue/dark blue, cyan/aqua/dark cyan/dark aqua, light blue/light cyan/light aqua, green/dark green, light green/lime/lime green, yellow/light yellow, orange/gold/dark yellow, red/dark red, pink/light red, purple/dark purple, magenta/light purple, brown/indigo", - - "pattern_end" - ], - "since" : "Unknown", - "description" : "Wool, dye and chat colors.", - "examples" : "color of the sheep is red or black\\nset the color of the block to green\\nmessage \"You're holding a <%color of tool%>%color of tool% wool block\"" -}, -{ - "id" : "commandsender", - "name" : "Command Sender", - "patterns" : [ - "use the console for the console", -"see player for players.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A player or the console.", - "examples" : "command /push [<player>]:\\n trigger:\\n if arg-1 is not set:\\n if command sender is console:\\n send \"You can't push yourself as a console :\\\" to sender\\n stop\\n push sender upwards with force 2\\n send \"Yay!\"\\n else:\\n push arg-1 upwards with force 2\\n send \"Yay!\" to sender and arg-1" -}, -{ - "id" : "damagecause", - "name" : "Damage Cause", - "patterns" : [ - "sweep attack, thorns, the void, magma, a lightning, drowning, dragonfire, an attack, drown, an entity attack, melt, freeze, falling block, contact, fire, an entity explosion, lightning, a fall, entity explosion, void, a lightning strike, suffocation, suicide, wither effect, a plugin, lightning strike, entity attack, a potion, a wither, sweeping, melting, a falling block, unknown, starvation, lava, fall, hot floor, attack, a block explosion, dryout, burn, hitting wall while flying, potion, flying into a wall, cramming, poison, sonic boom, suffocate, custom, a fire, burning, a projectile, plugin, wither potion effect, block explosion, projectile, wither, dragon's breath", - - "pattern_end" - ], - "since" : "2.0", - "description" : "The cause/type of a damage event, e.g. lava, fall, fire, drowning, explosion, poison, etc.\\nPlease note that support for this type is very rudimentary, e.g. lava, fire and burning, as well as projectile and attack are considered different types.", - "examples" : "Missing examples." -}, -{ - "id" : "date", - "name" : "Date", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.4", - "description" : "A date is a certain point in the real world's time which can be obtained with now expression, unix date expression and date function.\\nSee time and timespan for the other time types of Skript.", - "examples" : "set {_yesterday} to now\\nsubtract a day from {_yesterday}\\n# now {_yesterday} represents the date 24 hours before now" -}, -{ - "id" : "difficulty", - "name" : "Difficulty", - "patterns" : [ - "normal, medium, hard, easy, peaceful", - - "pattern_end" - ], - "since" : "2.3", - "description" : "The difficulty of a world.", - "examples" : "Missing examples." -}, -{ - "id" : "direction", - "name" : "Direction", - "patterns" : [ - "see direction (expression)", - - "pattern_end" - ], - "since" : "2.0", - "description" : "A direction, e.g. north, east, behind, 5 south east, 1.3 meters to the right, etc.\\nLocations and some blocks also have a direction, but without a length.\\nPlease note that directions have changed extensively in the betas and might not work perfectly. They can also not be used as command arguments.", - "examples" : "set the block below the victim to a chest\\nloop blocks from the block infront of the player to the block 10 below the player:\\n set the block behind the loop-block to water" -}, -{ - "id" : "enchantment", - "name" : "Enchantment", - "patterns" : [ - "Frost Walker, Feather Falling, Unbreaking, Swift Sneak, Knockback, Projectile Protection, Respiration, Punch, Protection, Blast Protection, Lure, Impaling, Smite, Silk Touch, Infinity, Luck of The Sea, Thorns, Multishot, Curse of Vanishing, Fire Aspect, Flame, Depth Strider, Piercing, Fire Protection, Sharpness, Power, Sweeping Edge, Aqua Affinity, Curse of Binding, Bane of Arthropods, Soul Speed, Looting, Efficiency, Mending, Riptide, Quick Charge, Fortune, Loyalty, Channeling", - - "pattern_end" - ], - "since" : "1.4.6", - "description" : "An enchantment, e.g. 'sharpness' or 'fortune'. Unlike enchantment type this type has no level, but you usually don't need to use this type anyway.", - "examples" : "Missing examples." -}, -{ - "id" : "enchantmentoffer", - "name" : "Enchantment Offer", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.5", - "description" : "The enchantmentoffer in an enchant prepare event.", - "examples" : "on enchant prepare:\\n set enchant offer 1 to sharpness 1\\n set the cost of enchant offer 1 to 10 levels" -}, -{ - "id" : "enchantmenttype", - "name" : "Enchantment Type", - "patterns" : [ - "<enchantment> [<level>]", - - "pattern_end" - ], - "since" : "1.4.6", - "description" : "An enchantment with an optional level, e.g. 'sharpness 2' or 'fortune'.", - "examples" : "enchant the player's tool with sharpness 5\\nhelmet is enchanted with waterbreathing" -}, -{ - "id" : "entity", - "name" : "Entity", - "patterns" : [ - "player, op, wolf, tamed ocelot, powered creeper, zombie, unsaddled pig, fireball, arrow, dropped item, item frame, etc.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "An entity is something in a world that's not a block, e.g. a player, a skeleton, or a zombie, but also projectiles like arrows, fireballs or thrown potions, or special entities like dropped items, falling blocks or paintings.", - "examples" : "entity is a zombie or creeper\\nplayer is an op\\nprojectile is an arrow\\nshoot a fireball from the player" -}, -{ - "id" : "entitydata", - "name" : "Entity Type", - "patterns" : [ - "Detailed usage will be added eventually", - - "pattern_end" - ], - "since" : "1.3", - "description" : "The type of an entity, e.g. player, wolf, powered creeper, etc.", - "examples" : "victim is a cow\\nspawn a creeper" -}, -{ - "id" : "entitytype", - "name" : "Entity Type with Amount", - "patterns" : [ - "<number> <entity type>", - - "pattern_end" - ], - "since" : "1.3", - "description" : "An entity type with an amount, e.g. '2 zombies'. I might remove this type in the future and make a more general 'type' type, i.e. a type that has a number and a type.", - "examples" : "spawn 5 creepers behind the player" -}, -{ - "id" : "experience", - "name" : "Experience", - "patterns" : [ - "[<number>] ([e]xp|experience [point[s]])", - - "pattern_end" - ], - "since" : "2.0", - "description" : "Experience points. Please note that Bukkit only allows to give XP, but not remove XP from players. You can however change a player's level and level progress freely.", - "examples" : "give 10 xp to the player" -}, -{ - "id" : "fireworkeffect", - "name" : "Firework Effect", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.4", - "description" : "A configuration of effects that defines the firework when exploded\\nwhich can be used in the launch firework effect.\\nSee the firework effect expression for detailed patterns.", - "examples" : "launch flickering trailing burst firework colored blue and green at player\\nlaunch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity\\nlaunch ball large colored red, purple and white fading to light green and black at player's location with duration 1" -}, -{ - "id" : "FireworkType", - "name" : "Firework Type", - "patterns" : [ - "small, ball, star shaped, large, star, creeper face, small ball, large ball, burst, ball large, creeper", - - "pattern_end" - ], - "since" : "2.4", - "description" : "The type of a fireworkeffect.", - "examples" : "Missing examples." -}, -{ - "id" : "gamemode", - "name" : "Game Mode", - "patterns" : [ - "creative/survival/adventure/spectator", - - "pattern_end" - ], - "since" : "1.0", - "description" : "The game modes survival, creative, adventure and spectator.", - "examples" : "player's gamemode is survival\\nset the player argument's game mode to creative" -}, -{ - "id" : "gamerule", - "name" : "Gamerule", - "patterns" : [ - "doWardenSpawning, doFireTick, maxCommandChainLength, fireDamage, reducedDebugInfo, disableElytraMovementCheck, announceAdvancements, drowningDamage, commandBlockOutput, forgiveDeadPlayers, doMobSpawning, maxEntityCramming, disableRaids, doWeatherCycle, doDaylightCycle, showDeathMessages, doTileDrops, universalAnger, playersSleepingPercentage, doInsomnia, doImmediateRespawn, naturalRegeneration, doMobLoot, fallDamage, keepInventory, doEntityDrops, doLimitedCrafting, mobGriefing, randomTickSpeed, spawnRadius, freezeDamage, doTraderSpawning, logAdminCommands, spectatorsGenerateChunks, sendCommandFeedback, doPatrolSpawning", - - "pattern_end" - ], - "since" : "2.5", - "description" : "A gamerule", - "examples" : "Missing examples." -}, -{ - "id" : "gamerulevalue", - "name" : "Gamerule Value", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.5", - "description" : "A wrapper for the value of a gamerule for a world.", - "examples" : "Missing examples." -}, -{ - "id" : "gene", - "name" : "Gene", - "patterns" : [ - "normal, lazy, happy, worried, worrisome, aggressive, brown, brownish, savage, playful, wild, weak", - - "pattern_end" - ], - "since" : "2.4", - "description" : "Represents a Panda's main or hidden gene. See genetics for more info.", - "examples" : "Missing examples." -}, -{ - "id" : "healreason", - "name" : "Heal Reason", - "patterns" : [ - "an ender crystal, magic, a magic regeneration, magic regeneration, fed, sated, a magic regen, regen potion, a wither spawn, peaceful, unknown, a regeneration potion, consuming, a wither effect, peaceful regeneration, wither summoning, healing potion, wither potion, an end crystal, satiated, regeneration potion, potion, satisfied, ingesting, withered, custom, a wither spawning, end crystal, eating, wither spawning, a wither summoning, wither effect, a plugin, a regen potion, plugin, withering, a potion, wither spawn, a healing potion, ender crystal, magic regen, wither, peaceful regen", - - "pattern_end" - ], - "since" : "2.5", - "description" : "The heal reason in a heal event.", - "examples" : "Missing examples." -}, -{ - "id" : "inventory", - "name" : "Inventory", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "An inventory of a player or block. Inventories have many effects and conditions regarding the items contained.\\nAn inventory has a fixed amount of slots which represent a specific place in the inventory, e.g. the helmet slot for players (Please note that slot support is still very limited but will be improved eventually).", - "examples" : "Missing examples." -}, -{ - "id" : "inventoryaction", - "name" : "Inventory Action", - "patterns" : [ - "drop stack from slot, swap items with hotbar, swap cursor stack, pickup single item, pickup some, drop all from cursor, move to other inventory, drop cursor stack, pickup all, swap with hotbar, nothing, drop all from slot, swap cursor, drop cursor, pickup all items, drop slot item, place all, drop cursor item, drop slot stack, drop single item from slot, swap with cursor, place some, pickup one item, drop single item from cursor, collect items to cursor, unknown, clone stack, drop stack from cursor, drop one item from slot, drop one item from cursor, unsupported, do nothing, drop one from cursor, pickup half, drop items from slot, swap stack with cursor, place all items, collect to cursor, pickup some items, drop slot, drop items from cursor, hotbar move and readd, shift move, custom, pickup single, place one item, hotbar swap items, drop one from slot, place some items, place one, pickup half stack, instant move, hotbar swap", - - "pattern_end" - ], - "since" : "2.2-dev16", - "description" : "What player just did in inventory event. Note that when in creative game mode, most actions do not work correctly.", - "examples" : "Missing examples." -}, -{ - "id" : "slot", - "name" : "Inventory Slot", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "Unknown", - "description" : "Represents a single slot of an inventory. Notable slots are the armour slots and furnace slots. \\nThe most important property that distinguishes a slot from an item is its ability to be changed, e.g. it can be set, deleted, enchanted, etc. (Some item expressions can be changed as well, e.g. items stored in variables. For that matter: slots are never saved to variables, only the items they represent at the time when the variable is set).\\nPlease note that tool can be regarded a slot, but it can actually change it's position, i.e. doesn't represent always the same slot.", - "examples" : "set tool of player to dirt\\ndelete helmet of the victim\\nset the color of the player's tool to green\\nenchant the player's chestplate with projectile protection 5" -}, -{ - "id" : "inventorytype", - "name" : "Inventory Type", - "patterns" : [ - "blast furnace inventory, barrel inventory, workbench inventory, smoker inventory, composter inventory, ender chest inventory, dispenser inventory, player inventory, loom inventory, stonecutter inventory, hopper inventory, merchant inventory, cartography table inventory, anvil inventory, beacon inventory, shulker box inventory, lectern inventory, chest inventory, smithing inventory, dropper inventory, brewing stand inventory, villager inventory, enchanting table inventory, grindstone inventory, creative inventory, crafting table inventory, furnace inventory", - - "pattern_end" - ], - "since" : "2.2-dev32", - "description" : "Minecraft has several different inventory types with their own use cases.", - "examples" : "Missing examples." -}, -{ - "id" : "itemstack", - "name" : "Item / Material", - "patterns" : [ - "[<number> [of]] <alias> [of <enchantment> <level>], Where <alias> must be an alias that represents exactly one item (i.e cannot be a general alias like 'sword' or 'plant')", - - "pattern_end" - ], - "since" : "1.0", - "description" : "An item, e.g. a stack of torches, a furnace, or a wooden sword of sharpness 2. Unlike item type an item can only represent exactly one item (e.g. an upside-down cobblestone stair facing west), while an item type can represent a whole range of items (e.g. any cobble stone stairs regardless of direction).\\nYou don't usually need this type except when you want to make a command that only accepts an exact item.\\nPlease note that currently 'material' is exactly the same as 'item', i.e. can have an amount & enchantments.", - "examples" : "set {_item} to type of the targeted block\\n{_item} is a torch" -}, -{ - "id" : "itemtype", - "name" : "Item Type", - "patterns" : [ - "[<number> [of]] [all/every] <alias> [of <enchantment> [<level>] [,/and <more enchantments...>]]", - - "pattern_end" - ], - "since" : "1.0", - "description" : "An item type is an alias, e.g. 'a pickaxe', 'all plants', etc., and can result in different items when added to an inventory, and unlike items they are well suited for checking whether an inventory contains a certain item or whether a certain item is of a certain type.\\nAn item type can also have one or more enchantments with or without a specific level defined, and can optionally start with 'all' or 'every' to make this item type represent all types that the alias represents, including data ranges.", - "examples" : "give 4 torches to the player\\nadd all slabs to the inventory of the block\\nplayer's tool is a diamond sword of sharpness\\nremove a pickaxes of fortune 4 from {stored items::*}\\nset {_item} to 10 of every upside-down stair\\nblock is dirt or farmland" -}, -{ - "id" : "livingentity", - "name" : "Living Entity", - "patterns" : [ - "see entity, but ignore inanimate objects", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A living entity, i.e. a mob or player, not inanimate entities like projectiles or dropped items.", - "examples" : "spawn 5 powered creepers\\nshoot a zombie from the creeper" -}, -{ - "id" : "location", - "name" : "Location", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A location in a world. Locations are world-specific and even store a direction, e.g. if you save a location and later teleport to it you will face the exact same direction you did when you saved the location.", - "examples" : "Missing examples." -}, -{ - "id" : "metadataholder", - "name" : "Metadata Holder", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "2.2-dev36", - "description" : "Something that can hold metadata (e.g. an entity or block)", - "examples" : "set metadata value \"super cool\" of player to true" -}, -{ - "id" : "money", - "name" : "Money", - "patterns" : [ - "<number> $ or $ <number>, where '$' is your server's currency, e.g. '10 rupees' or '£5.00'", - - "pattern_end" - ], - "since" : "2.0", - "description" : "A certain amount of money. Please note that this differs from numbers as it includes a currency symbol or name, but usually the two are interchangeable, e.g. you can both add 100$ to the player's balance and add 100 to the player's balance.", - "examples" : "add 10£ to the player's account\\nremove Fr. 9.95 from the player's money\\nset the victim's money to 0\\nincrease the attacker's balance by the level of the victim * 100" -}, -{ - "id" : "number", - "name" : "Number", - "patterns" : [ - "[-]###[.###] (any amount of digits; very large numbers will be truncated though)", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A number, e.g. 2.5, 3, or -9812454.\\nPlease note that many expressions only need integers, i.e. will discard any fractional parts of any numbers without producing an error.", - "examples" : "set the player's health to 5.5\\nset {_temp} to 2*{_temp} - 2.5" -}, -{ - "id" : "object", - "name" : "Object", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "The supertype of all types, meaning that if %object% is used in e.g. a condition it will accept all kinds of expressions.", - "examples" : "Missing examples." -}, -{ - "id" : "offlineplayer", - "name" : "Offline Player", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "Unknown", - "description" : "A player that is possibly offline. See player for more information. Please note that while all effects and conditions that require a player can be used with an offline player as well, they will not work if the player is not actually online.", - "examples" : "Missing examples." -}, -{ - "id" : "player", - "name" : "Player", - "patterns" : [ - "Missing patterns.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player.\\nYou have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.", - "examples" : "Missing examples." -}, -{ - "id" : "potioneffect", - "name" : "Potion Effect", - "patterns" : [ - "speed of tier 1 for 10 seconds", - - "pattern_end" - ], - "since" : "2.5.2", - "description" : "A potion effect, including the potion effect type, tier and duration.", - "examples" : "Missing examples." -}, -{ - "id" : "potioneffecttype", - "name" : "Potion Effect Type", - "patterns" : [ - "null, speed, slowness, haste, mining fatigue, strength, instant health, instant damage, jump boost, nausea, regeneration, resistance, fire resistance, water breathing, invisibility, blindness, night vision, hunger, weakness, poison, wither, health boost, absorption, saturation, glowing, levitation, luck, bad luck, slow falling, conduit power, dolphins grace, bad omen, hero of the village, darkness", - - "pattern_end" - ], - "since" : "Unknown", - "description" : "A potion effect type, e.g. 'strength' or 'swiftness'.", - "examples" : "apply swiftness 5 to the player\\napply potion of speed 2 to the player for 60 seconds\\nremove invisibility from the victim" -}, -{ - "id" : "projectile", - "name" : "Projectile", - "patterns" : [ - "arrow, fireball, snowball, thrown potion, etc.", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A projectile, e.g. an arrow, snowball or thrown potion.", - "examples" : "projectile is a snowball\\nshoot an arrow at speed 5 from the player" -}, -{ - "id" : "region", - "name" : "Region", - "patterns" : [ - ""region name"", - - "pattern_end" - ], - "since" : "2.1", - "description" : "A region of a regions plugin. Skript currently supports WorldGuard, Factions, GriefPrevention and PreciousStones.\\nPlease note that some regions plugins do not have named regions, some use numerical ids to identify regions, and some may have regions with the same name in different worlds, thus using regions like \"region name\" in scripts may or may not work.", - "examples" : "Missing examples." -}, -{ - "id" : "resourcepackstate", - "name" : "Resource Pack State", - "patterns" : [ - "refused, rejected, accepted, failed, failed to download, successfully loaded, accept, fail, successfully load, refuse, declined, successfully install, success, reject, decline, successfully installed, download fail", - - "pattern_end" - ], - "since" : "2.4", - "description" : "The state in a resource pack request response event.", - "examples" : "Missing examples." -}, -{ - "id" : "cachedservericon", - "name" : "Server Icon", + "id" : "long", + "name" : "Unknown Name", "patterns" : [ "Missing patterns.", "pattern_end" ], - "since" : "2.3", - "description" : "A server icon that was loaded using the load server icon effect.", + "since" : "Unknown", + "description" : "Missing description.", "examples" : "Missing examples." }, { - "id" : "soundcategory", - "name" : "Sound Category", + "id" : "double", + "name" : "Unknown Name", "patterns" : [ - "hostile creatures category, speech category, records category, friendly creature category, noteblock category, hostile creature category, note block category, voice category, ambient category, noteblocks category, note blocks category, weather category, block category, friendly mob category, jukebox category, hostile mob category, master category, master volume category, hostile category, record category, blocks category, environment category, jukeboxes category, player category, players category, hostile mobs category, friendly mobs category, music category, friendly creatures category, neutral category", + "Missing patterns.", "pattern_end" ], - "since" : "2.4", - "description" : "The category of a sound, they are used for sound options of Minecraft. See the play sound and stop sound effects.", + "since" : "Unknown", + "description" : "Missing description.", "examples" : "Missing examples." }, { - "id" : "spawnreason", - "name" : "Spawn Reason", + "id" : "float", + "name" : "Unknown Name", "patterns" : [ - "dispense egg, egg, village defense, ocelot baby, silverfish trap, village invading, trap, dispensing egg, shoulder, drowned, metamorphosis, lightning, silverfish reveal, spell, built iron golem, natural, village invasion, frozen, mount, build wither, built wither, iron golem defense, ender pearl, creature spawner, reinforcements, build snowman, build iron golem, breeding, raid, infection, customized, spawn egg, jockey, beehive, default, golem defense, patrol, slime split, infected, sheared, mob spawner, nether portal, shear, perching, custom, built snowman, chunk generation, breed, command, explosion, spawner, cured, customised, piglin zombification", + "Missing patterns.", "pattern_end" ], - "since" : "2.3", - "description" : "The spawn reason in a spawn event.", + "since" : "Unknown", + "description" : "Missing description.", "examples" : "Missing examples." }, { - "id" : "teleportcause", - "name" : "Teleport Cause", + "id" : "short", + "name" : "Unknown Name", "patterns" : [ - "nether portal, ender gateway, chorus fruit, ender portal, command, unknown, plugin, ender pearl, spectator, spectate, end gateway, chorus, gateway, end portal", + "Missing patterns.", "pattern_end" ], - "since" : "2.2-dev35", - "description" : "The teleport cause in a teleport event.", + "since" : "Unknown", + "description" : "Missing description.", "examples" : "Missing examples." }, { - "id" : "string", - "name" : "Text", - "patterns" : [ - "simple: "..."", -"quotes: "...""..."", -"expressions: "...%expression%..."", -"percent signs: "...%%..."", - - "pattern_end" - ], - "since" : "1.0", - "description" : "Text is simply text, i.e. a sequence of characters, which can optionally contain expressions which will be replaced with a meaningful representation (e.g. %player% will be replaced with the player's name).\\nBecause scripts are also text, you have to put text into double quotes to tell Skript which part of the line is an effect/expression and which part is the text.\\nPlease read the article on Texts and Variable Names to learn more.", - "examples" : "broadcast \"Hello World!\"\\nmessage \"Hello %player%\"\\nmessage \"The id of \"\"%type of tool%\"\" is %id of tool%.\"" -}, -{ - "id" : "time", - "name" : "Time", - "patterns" : [ - "##:##", -"##[:##][ ]am/pm", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A time is a point in a minecraft day's time (i.e. ranges from 0:00 to 23:59), which can vary per world.\\nSee date and timespan for the other time types of Skript.", - "examples" : "at 20:00:\\n time is 8 pm\\n broadcast \"It's %time%\"" -}, -{ - "id" : "timeperiod", - "name" : "Timeperiod", - "patterns" : [ - "##:## - ##:##", -"dusk/day/dawn/night", - - "pattern_end" - ], - "since" : "1.0", - "description" : "A period of time between two times. Mostly useful since you can use this to test for whether it's day, night, dusk or dawn in a specific world.\\nThis type might be removed in the future as you can use 'time of world is between x and y' as a replacement.", - "examples" : "time in world is night" -}, -{ - "id" : "timespan", - "name" : "Timespan", + "id" : "byte", + "name" : "Unknown Name", "patterns" : [ - "<number> [minecraft/mc/real/rl/irl] ticks/seconds/minutes/hours/days/weeks/months/years [[,/and] <more...>]", -"[###:]##:##[.####] ([hours:]minutes:seconds[.milliseconds])", - - "pattern_end" - ], - "since" : "1.0, 2.6.1 (weeks, months, years)", - "description" : "A timespan is a difference of two different dates or times, e.g '10 minutes'. Timespans are always displayed as real life time, but can be defined as minecraft time, e.g. '5 minecraft days and 12 hours'.\\nNOTE: Months always have the value of 30 days, and years of 365 days.\\nSee date and time for the other time types of Skript.", - "examples" : "every 5 minecraft days:\\n wait a minecraft second and 5 ticks\\nevery 10 mc days and 12 hours:\\n halt for 12.7 irl minutes, 12 hours and 120.5 seconds" -}, -{ - "id" : "structuretype", - "name" : "Tree Type", - "patterns" : [ - "[any] <general tree/mushroom type>, e.g. tree/any jungle tree/etc.", -"<specific tree/mushroom species>, e.g. red mushroom/small jungle tree/big regular tree/etc.", + "Missing patterns.", "pattern_end" ], "since" : "Unknown", - "description" : "A tree type represents a tree species or a huge mushroom species. These can be generated in a world with the generate tree effect.", - "examples" : "grow any regular tree at the block\\ngrow a huge red mushroom above the block" + "description" : "Missing description.", + "examples" : "Missing examples." }, { - "id" : "classinfo", - "name" : "Type", + "id" : "itementity", + "name" : "Unknown Name", "patterns" : [ - "See the type name patterns of all types - including this one", + "Missing patterns.", "pattern_end" ], "since" : "2.0", - "description" : "Represents a type, e.g. number, object, item type, location, block, world, entity type, etc.\\nThis is mostly used for expressions like 'event-<type>', '<type>-argument', 'loop-<type>', etc., e.g. event-world, number-argument and loop-player.", - "examples" : "{variable} is a number # check whether the variable contains a number, e.g. -1 or 5.5\\n{variable} is a type # check whether the variable contains a type, e.g. number or player\\n{variable} is an object # will always succeed if the variable is set as everything is an object, even types.\\ndisable PvP in the event-world\\nkill the loop-entity" -}, -{ - "id" : "vector", - "name" : "Vector", - "patterns" : [ - "vector(x, y, z)", - - "pattern_end" - ], - "since" : "2.2-dev23", - "description" : "Vector is a collection of numbers. In Minecraft, 3D vectors are used to express velocities of entities.", + "description" : "Missing description.", "examples" : "Missing examples." }, { - "id" : "visualeffect", - "name" : "Visual Effect", + "id" : "material", + "name" : "Unknown Name", "patterns" : [ - "smoke, potion break, ender signal, mobspawner flames, arrow particles, jumping rabbit, hurt, wolf smoke, wolf hearts, wolf shaking, sheep eating, iron golem offering rose, villager hearts, angry villager entity, happy villager entity, witch magic, zombie turning to a villager, firework explosion, love hearts, squid rotation reset, entity poof, guardian target, block with shield, shield break, armor stand hit, hurt by thorns, iron golem sheathing rose, resurrection by totem, hurt by drowning, hurt by explosion, explosion, large explosion, huge explosion, firework's spark, water bubble, water splash, water wake, suspended, void fog, critical hit, magical critical hit, smoke particle, large smoke, spell, spell, potion swirl, transparent potion swirl, witch spell, water drip, lava drip, angry villager, happy villager, small smoke, note, portal, flying glyph, flame, lava pop, cloud, coloured dust, snowball break, snow shovel, slime, heart, item crack, block break, block dust, water drop, mob appearance, dragon breath, end rod, damage indicator, sweep attack, falling dust, totem, spit, squid ink, bubble pop, current down, bubble column up, nautilus, dolphin, sneeze, campfire cosy smoke, campfire signal smoke, composter, flash, falling lava, landing lava, falling water, dripping honey, falling honey, landing honey, falling nectar, soul fire flame, ash, crimson spore, warped spore, soul, dripping obsidian tear, falling obsidian tear, landing obsidian tear, reverse portal, white ash, falling spore blossom, spore blossom air, small flame, snowflake, dripping dripstone lava, falling dripstone lava, dripping dripstone water, falling dripstone water, glow squid ink, glow, wax on, wax off, electric spark, scrape, sonic boom, sculk soul, sculk charge, sculk charge pop, shriek", + "Missing patterns.", "pattern_end" ], - "since" : "2.1", - "description" : "A visible effect, e.g. particles.", - "examples" : "show wolf hearts on the clicked wolf\\nplay mob spawner flames at the targeted block to the player" + "since" : "aliases-rework", + "description" : "Missing description.", + "examples" : "Missing examples." }, { - "id" : "weathertype", - "name" : "Weather Type", + "id" : "integer", + "name" : "Unknown Name", "patterns" : [ - "clear/sun/sunny, rain/rainy/raining, and thunder/thundering/thunderstorm", + "Missing patterns.", "pattern_end" ], - "since" : "1.0", - "description" : "The weather types sunny, rainy, and thundering.", - "examples" : "is raining\\nis sunny in the player's world\\nmessage \"It is %weather in the argument's world% in %world of the argument%\"" + "since" : "Unknown", + "description" : "Missing description.", + "examples" : "Missing examples." }, { - "id" : "world", - "name" : "World", + "id" : "inventoryholder", + "name" : "Unknown Name", "patterns" : [ - ""world_name", e.g. "world"", + "Missing patterns.", "pattern_end" ], - "since" : "1.0, 2.2 (alternate syntax)", - "description" : "One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. \"world_nether\", but this might not work reliably as text uses the same syntax.", - "examples" : "broadcast \"Hello!\" to the world \"world_nether\"" + "since" : "Unknown", + "description" : "Missing description.", + "examples" : "Missing examples." }, {"end" : true} @@ -891,6 +259,18 @@ Note: This is the only element where not all patterns are shown. It has actually "description" : "Tests what kind of damage caused a damage event. Refer to the Damage Cause type for a list of all possible causes.", "examples" : "# make players use their potions of fire resistance whenever they take any kind of fire damage\\non damage:\\n damage was caused by lava, fire or burning\\n victim is a player\\n victim has a potion of fire resistance\\n cancel event\\n apply fire resistance to the victim for 30 seconds\\n remove 1 potion of fire resistance from the victim\\n# prevent mobs from dropping items under certain circumstances\\non death:\\n entity is not a player\\n damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison\\n clear drops" }, +{ + "id" : "CondWillHatch", + "name" : "Egg Will Hatch", + "patterns" : [ + "[the] egg (will|will not|won't) hatch", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Whether the egg will hatch in a Player Egg Throw event.", + "examples" : "on player egg throw:\\n if an entity won't hatch:\\n send \"Better luck next time!\" to the player" +}, { "id" : "CondEntityIsWet", "name" : "Entity is Wet", @@ -1234,6 +614,19 @@ Note: This is the only element where not all patterns are shown. It has actually "description" : "Checks whether a player is flying.", "examples" : "player is not flying" }, +{ + "id" : "CondIsFrozen", + "name" : "Is Frozen", + "patterns" : [ + "%entities% (is|are) frozen", +"%entities% (isn't|is not|aren't|are not) frozen", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Checks whether an entity is frozen.", + "examples" : "if player is frozen:\\n kill player" +}, { "id" : "CondIsFuel", "name" : "Is Fuel", @@ -2019,7 +1412,7 @@ You can add a tool, which will spawn items based on how that tool would break th "id" : "EffScriptFile", "name" : "Enable/Disable/Reload Script File", "patterns" : [ - "(enable|load|reload|disable|unload) s(c|k)ript [file] %text%", + "((enable|load)|reload|(disable|unload)) s(c|k)ript [file] %text%", "pattern_end" ], @@ -2044,12 +1437,12 @@ You can add a tool, which will spawn items based on how that tool would break th "id" : "EffEquip", "name" : "Equip", "patterns" : [ - "equip [%living entity%] with %item types%", -"make %living entity% wear %item types%", + "equip [%living entities%] with %item types%", +"make %living entities% wear %item types%", "pattern_end" ], - "since" : "1.0", + "since" : "1.0, INSERT VERSION (multiple entities)", "description" : "Equips an entity with some given armor. This will replace any armor that the entity is wearing.", "examples" : "equip player with diamond helmet\\nequip player with all diamond armor" }, @@ -2265,7 +1658,7 @@ Please note that the image must be 64x64 and the file path starts from the serve ], "since" : "2.3", "description" : "Suppresses target warnings from the current script.", - "examples" : "locally suppress conflict warnings\\nsuppress the variable save warnings" + "examples" : "locally suppress missing conjunction warnings\\nsuppress the variable save warnings" }, { "id" : "EffLog", @@ -2280,6 +1673,18 @@ Please note that the image must be 64x64 and the file path starts from the serve NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.", "examples" : "on place of TNT:\\n log \"%player% placed TNT in %world% at %location of block%\" to \"tnt/placement.log\"" }, +{ + "id" : "EffMakeEggHatch", + "name" : "Make Egg Hatch", + "patterns" : [ + "make [the] egg [not] hatch", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Makes the egg hatch in a Player Egg Throw event.", + "examples" : "on player egg throw:\\n # EGGS FOR DAYZ!\\n make the egg hatch" +}, { "id" : "EffMakeFly", "name" : "Make Fly", @@ -2377,6 +1782,19 @@ but for this to work, the message needs to be sent from a player.", Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.", "examples" : "show the victim's inventory to the player\\nopen the player's inventory for the player" }, +{ + "id" : "EffPathfind", + "name" : "Pathfind", + "patterns" : [ + "make %living entities% (pathfind|move) to[wards] %living entity/location% [at speed %number%]", +"make %living entities% stop (pathfinding|moving)", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.", + "examples" : "make all creepers pathfind towards player\\nmake all cows stop pathfinding\\nmake event-entity pathfind towards player at speed 1" +}, { "id" : "EffVisualEffect", "name" : "Play Effect", @@ -2457,10 +1875,10 @@ Note: if a player was hidden and relogs, this player will be visible again.", "id" : "EffPotion", "name" : "Potion Effects", "patterns" : [ - "apply [potion of] %potions% [potion] [[[of] tier] %number%] to %living entities% [for %time span%] [(replacing [the] existing effect)]", + "apply %potion effects% to %living entities%", +"apply [potion of] %potions% [potion] [[[of] tier] %number%] to %living entities% [for %time span%] [(replacing [the] existing effect)]", "apply ambient [potion of] %potions% [potion] [[[of] tier] %number%] to %living entities% [for %time span%] [(replacing [the] existing effect)]", "apply [potion of] %potions% [potion] [[[of] tier] %number%] without [any] particles to %living entities% [for %time span%] [(replacing [the] existing effect)]", -"apply %potion effects% to %living entities%", "pattern_end" ], @@ -2799,7 +2217,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "at_time", "name" : "At Time", "patterns" : [ - "at %time% [in %worlds%]", + "[on] at %time% [in %worlds%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2807,11 +2225,35 @@ Do note that other event values, such as 'player', won't work in this section.", "description" : "An event that occurs at a given minecraft time in every world or only in specific worlds.", "examples" : "at 18:00\\nat 7am in \"world\"" }, +{ + "id" : "anvil_damage", + "name" : "On Anvil Damage", + "patterns" : [ + "[on] [on] anvil damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Called when an anvil is damaged/broken from being used to repair/rename items.\\nNote: this does not include anvil damage from falling.", + "examples" : "on anvil damage:\\n cancel the event" +}, +{ + "id" : "anvil_prepare", + "name" : "On Anvil Prepare", + "patterns" : [ + "[on] [on] anvil prepar(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.", + "examples" : "on anvil prepare:\\n event-item is set # result item\\n chance of 5%:\\n set repair cost to repair cost * 50%\\n send \"You're LUCKY! You got 50% discount.\" to player" +}, { "id" : "aoe_cloud_effect", "name" : "On AoE Cloud Effect", "patterns" : [ - "[on] (area|AoE) [cloud] effect", + "[on] [on] (area|AoE) [cloud] effect [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2823,7 +2265,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "arm_swing", "name" : "On Arm Swing", "patterns" : [ - "[on] [player] arm swing", + "[on] [on] [player] arm swing [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2835,7 +2277,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "armor_change", "name" : "On Armor Change", "patterns" : [ - "[on] [player] armor change[d]", + "[on] [on] [player] armor change[d] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2847,8 +2289,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "bed_enter", "name" : "On Bed Enter", "patterns" : [ - "[on] bed enter[ing]", -"[on] [player] enter[ing] [a] bed", + "[on] [on] bed enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] enter[ing] [a] bed [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2860,8 +2302,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "bed_leave", "name" : "On Bed Leave", "patterns" : [ - "[on] bed leav(e|ing)", -"[on] [player] leav(e|ing) [a] bed", + "[on] [on] bed leav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] leav(e|ing) [a] bed [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2873,7 +2315,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "block_damage", "name" : "On Block Damage", "patterns" : [ - "[on] block damag(ing|e)", + "[on] [on] block damag(ing|e) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2885,7 +2327,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "block_fertilize", "name" : "On Block Fertilize", "patterns" : [ - "[on] [block] fertilize", + "[on] [on] [block] fertilize [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2897,7 +2339,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "block_growth", "name" : "On Block Growth", "patterns" : [ - "[on] (plant|crop|block) grow[(th|ing)] [[of] %item types%]", + "[on] [on] (plant|crop|block) grow[(th|ing)] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2909,7 +2351,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "book_edit", "name" : "On Book Edit", "patterns" : [ - "[on] book (edit|change|write)", + "[on] [on] book (edit|change|write) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2921,7 +2363,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "book_sign", "name" : "On Book Sign", "patterns" : [ - "[on] book sign[ing]", + "[on] [on] book sign[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2933,7 +2375,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "break_mine", "name" : "On Break / Mine", "patterns" : [ - "[on] [block] (break[ing]|min(e|ing)) [[of] %item types/block datas%]", + "[on] [on] [block] (break[ing]|min(e|ing)) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2945,8 +2387,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "bucket_empty", "name" : "On Bucket Empty", "patterns" : [ - "[on] bucket empty[ing]", -"[on] [player] empty[ing] [a] bucket", + "[on] [on] bucket empty[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] empty[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2958,8 +2400,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "bucket_fill", "name" : "On Bucket fill", "patterns" : [ - "[on] bucket fill[ing]", -"[on] [player] fill[ing] [a] bucket", + "[on] [on] bucket fill[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] fill[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2971,7 +2413,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "burn", "name" : "On Burn", "patterns" : [ - "[on] [block] burn[ing] [[of] %item types/block datas%]", + "[on] [on] [block] burn[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2983,7 +2425,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "can_build_check", "name" : "On Can Build Check", "patterns" : [ - "[on] [block] can build check", + "[on] [on] [block] can build check [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -2995,7 +2437,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "chat", "name" : "On Chat", "patterns" : [ - "[on] chat", + "[on] [on] chat [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3007,7 +2449,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "chunk_generate", "name" : "On Chunk Generate", "patterns" : [ - "[on] chunk (generat|populat)(e|ing)", + "[on] [on] chunk (generat|populat)(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3019,7 +2461,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "chunk_load", "name" : "On Chunk Load", "patterns" : [ - "[on] chunk load[ing]", + "[on] [on] chunk load[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3031,7 +2473,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "chunk_unload", "name" : "On Chunk Unload", "patterns" : [ - "[on] chunk unload[ing]", + "[on] [on] chunk unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3043,8 +2485,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "click", "name" : "On Click", "patterns" : [ - "[on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%]", -"[on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type%", + "[on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type% [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3056,7 +2498,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "combust", "name" : "On Combust", "patterns" : [ - "[on] combust[ing]", + "[on] [on] combust[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3068,7 +2510,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "command", "name" : "On Command", "patterns" : [ - "[on] command [%text%]", + "[on] [on] command [%text%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3080,7 +2522,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "connect", "name" : "On Connect", "patterns" : [ - "[on] [player] connect[ing]", + "[on] [on] [player] connect[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3092,7 +2534,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "consume", "name" : "On Consume", "patterns" : [ - "[on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%]", + "[on] [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3104,7 +2546,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "craft", "name" : "On Craft", "patterns" : [ - "[on] [player] craft[ing] [[of] %item types%]", + "[on] [on] [player] craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3116,7 +2558,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "creeper_power", "name" : "On Creeper Power", "patterns" : [ - "[on] creeper power", + "[on] [on] creeper power [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3128,7 +2570,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "damage", "name" : "On Damage", "patterns" : [ - "[on] damag(e|ing) [of %entity type%] [by %entity type%]", + "[on] [on] damag(e|ing) [of %entity type%] [by %entity type%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3140,7 +2582,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "death", "name" : "On Death", "patterns" : [ - "[on] death [of %entity types%]", + "[on] [on] death [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3152,7 +2594,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "dispense", "name" : "On Dispense", "patterns" : [ - "[on] dispens(e|ing) [[of] %item types%]", + "[on] [on] dispens(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3164,7 +2606,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "drop", "name" : "On Drop", "patterns" : [ - "[on] [player] drop[ing] [[of] %item types%]", + "[on] [on] [player] drop[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3172,11 +2614,24 @@ Do note that other event values, such as 'player', won't work in this section.", "description" : "Called when a player drops an item from their inventory.", "examples" : "on drop:" }, +{ + "id" : "egg_throw", + "name" : "On Egg Throw", + "patterns" : [ + "[on] [on] throw[ing] [of] [an] egg [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] egg throw [with priority (lowest|low|normal|high|highest|monitor)]", + + "pattern_end" + ], + "since" : "1.0", + "description" : "Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.", + "examples" : "on throw of an egg:" +}, { "id" : "enchant", "name" : "On Enchant", "patterns" : [ - "[on] [item] enchant", + "[on] [on] [item] enchant [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3188,7 +2643,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "enchant_prepare", "name" : "On Enchant Prepare", "patterns" : [ - "[on] [item] enchant prepare", + "[on] [on] [item] enchant prepare [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3200,12 +2655,12 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "endermansheepsilverfishfalling_block", "name" : "On Enderman/Sheep/Silverfish/Falling Block", "patterns" : [ - "[on] enderman place", -"[on] enderman pickup", -"[on] sheep eat", -"[on] silverfish enter", -"[on] silverfish exit", -"[on] falling block land[ing]", + "[on] [on] enderman place [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] enderman pickup [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] sheep eat [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] silverfish enter [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] silverfish exit [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] falling block land[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3217,7 +2672,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "entity_dismount", "name" : "On Entity Dismount", "patterns" : [ - "[on] dismount[ing]", + "[on] [on] dismount[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3229,7 +2684,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "entity_mount", "name" : "On Entity Mount", "patterns" : [ - "[on] mount[ing]", + "[on] [on] mount[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3241,7 +2696,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "entity_portal", "name" : "On Entity Portal", "patterns" : [ - "[on] entity portal", + "[on] [on] entity portal [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3253,8 +2708,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "experience_spawn", "name" : "On Experience Spawn", "patterns" : [ - "[on] [e]xp[erience] [orb] spawn", -"[on] spawn of [a[n]] [e]xp[erience] [orb]", + "[on] [on] [e]xp[erience] [orb] spawn [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] spawn of [a[n]] [e]xp[erience] [orb] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3266,7 +2721,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "explode", "name" : "On Explode", "patterns" : [ - "[on] explo(d(e|ing)|sion)", + "[on] [on] explo(d(e|ing)|sion) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3278,7 +2733,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "explosion_prime", "name" : "On Explosion Prime", "patterns" : [ - "[on] explosion prime", + "[on] [on] explosion prime [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3290,7 +2745,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "fade", "name" : "On Fade", "patterns" : [ - "[on] [block] fad(e|ing) [[of] %item types/block datas%]", + "[on] [on] [block] fad(e|ing) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3302,7 +2757,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "firework_explode", "name" : "On Firework Explode", "patterns" : [ - "[on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%]", + "[on] [on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3314,7 +2769,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "first_join", "name" : "On First Join", "patterns" : [ - "[on] first (join|login)", + "[on] [on] first (join|login) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3326,7 +2781,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "fishing", "name" : "On Fishing", "patterns" : [ - "[on] [player] fish[ing]", + "[on] [on] [player] fish[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3338,8 +2793,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "flight_toggle", "name" : "On Flight Toggle", "patterns" : [ - "[on] [player] flight toggl(e|ing)", -"[on] [player] toggl(e|ing) flight", + "[on] [on] [player] flight toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] toggl(e|ing) flight [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3351,8 +2806,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "flow", "name" : "On Flow", "patterns" : [ - "[on] [block] flow[ing]", -"[on] block mov(e|ing)", + "[on] [on] [block] flow[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] block mov(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3364,7 +2819,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "form", "name" : "On Form", "patterns" : [ - "[on] [block] form[ing] [[of] %item types/block datas%]", + "[on] [on] [block] form[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3376,7 +2831,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "fuel_burn", "name" : "On Fuel Burn", "patterns" : [ - "[on] fuel burn[ing]", + "[on] [on] fuel burn[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3388,7 +2843,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "gamemode_change", "name" : "On Gamemode Change", "patterns" : [ - "[on] game[ ]mode change [to %gamemode%]", + "[on] [on] game[ ]mode change [to %gamemode%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3400,7 +2855,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "gliding_state_change", "name" : "On Gliding State Change", "patterns" : [ - "[on] (gliding state change|toggl(e|ing) gliding)", + "[on] [on] (gliding state change|toggl(e|ing) gliding) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3412,7 +2867,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "grow", "name" : "On Grow", "patterns" : [ - "[on] grow [of (%tree type%|%item type%)]", + "[on] [on] grow [of (%tree type%|%item type%)] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3424,7 +2879,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "hand_item_swap", "name" : "On Hand Item Swap", "patterns" : [ - "[on] swap[ping of] [(hand|held)] item[s]", + "[on] [on] swap[ping of] [(hand|held)] item[s] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3436,7 +2891,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "heal", "name" : "On Heal", "patterns" : [ - "[on] heal[ing]", + "[on] [on] heal[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3448,7 +2903,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "horse_jump", "name" : "On Horse Jump", "patterns" : [ - "[on] horse jump", + "[on] [on] horse jump [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3460,7 +2915,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "hunger_meter_change", "name" : "On Hunger Meter Change", "patterns" : [ - "[on] (food|hunger) (level|met(er|re)|bar) chang(e|ing)", + "[on] [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3472,7 +2927,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "ignition", "name" : "On Ignition", "patterns" : [ - "[on] [block] ignit(e|ion)", + "[on] [on] [block] ignit(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3484,7 +2939,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "inventory_click", "name" : "On Inventory Click", "patterns" : [ - "[on] [player] inventory(-| )click[ing] [[at] %item types%]", + "[on] [on] [player] inventory(-| )click[ing] [[at] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3496,7 +2951,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "inventory_close", "name" : "On Inventory Close", "patterns" : [ - "[on] inventory clos(ing|e[d])", + "[on] [on] inventory clos(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3508,7 +2963,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "inventory_open", "name" : "On Inventory Open", "patterns" : [ - "[on] inventory open[ed]", + "[on] [on] inventory open[ed] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3520,7 +2975,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "inventory_pickup", "name" : "On Inventory Pickup", "patterns" : [ - "[on] inventory pick[ ]up", + "[on] [on] inventory pick[ ]up [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3532,8 +2987,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_break", "name" : "On Item Break", "patterns" : [ - "[on] [player] tool break[ing]", -"[on] [player] break[ing] [(a|the)] tool", + "[on] [on] [player] tool break[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] break[ing] [(a|the)] tool [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3545,7 +3000,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_damage", "name" : "On Item Damage", "patterns" : [ - "[on] item damag(e|ing)", + "[on] [on] item damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3557,8 +3012,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_despawn", "name" : "On Item Despawn", "patterns" : [ - "[on] (item[ ][stack]|[item] %item types%) despawn[ing]", -"[on] [item[ ][stack]] despawn[ing] [[of] %item types%]", + "[on] [on] (item[ ][stack]|[item] %item types%) despawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [item[ ][stack]] despawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3570,7 +3025,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_mend", "name" : "On Item Mend", "patterns" : [ - "[on] item mend[ing]", + "[on] [on] item mend[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3582,8 +3037,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_merge", "name" : "On Item Merge", "patterns" : [ - "[on] (item[ ][stack]|[item] %item types%) merg(e|ing)", -"[on] item[ ][stack] merg(e|ing) [[of] %item types%]", + "[on] [on] (item[ ][stack]|[item] %item types%) merg(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] item[ ][stack] merg(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3595,7 +3050,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "item_spawn", "name" : "On Item Spawn", "patterns" : [ - "[on] item spawn[ing] [[of] %item types%]", + "[on] [on] item spawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3607,7 +3062,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "join", "name" : "On Join", "patterns" : [ - "[on] [player] (login|logging in|join[ing])", + "[on] [on] [player] (login|logging in|join[ing]) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3619,7 +3074,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "jump", "name" : "On Jump", "patterns" : [ - "[on] [player] jump[ing]", + "[on] [on] [player] jump[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3631,7 +3086,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "kick", "name" : "On Kick", "patterns" : [ - "[on] [player] (kick|being kicked)", + "[on] [on] [player] (kick|being kicked) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3643,8 +3098,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "language_change", "name" : "On Language Change", "patterns" : [ - "[on] [player] (language|locale) chang(e|ing)", -"[on] [player] chang(e|ing) (language|locale)", + "[on] [on] [player] (language|locale) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] chang(e|ing) (language|locale) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3656,7 +3111,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "leaves_decay", "name" : "On Leaves Decay", "patterns" : [ - "[on] leaves decay[ing]", + "[on] [on] leaves decay[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3668,7 +3123,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "level_change", "name" : "On Level Change", "patterns" : [ - "[on] [player] level (change|up|down)", + "[on] [on] [player] level (change|up|down) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3680,7 +3135,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "lightning_strike", "name" : "On Lightning Strike", "patterns" : [ - "[on] lightning [strike]", + "[on] [on] lightning [strike] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3692,7 +3147,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "move", "name" : "On Move", "patterns" : [ - "[on] %entity type% (move|walk|step)", + "[on] [on] %entity type% (move|walk|step) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3704,7 +3159,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "move_on", "name" : "On Move On", "patterns" : [ - "[on] (step|walk)[ing] (on|over) %*item types%", + "[on] [on] (step|walk)[ing] (on|over) %*item types% [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3716,7 +3171,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "physics", "name" : "On Physics", "patterns" : [ - "[on] [block] physics", + "[on] [on] [block] physics [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3728,7 +3183,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "pick_up", "name" : "On Pick Up", "patterns" : [ - "[on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%]", + "[on] [on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3740,7 +3195,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "pig_zap", "name" : "On Pig Zap", "patterns" : [ - "[on] pig[ ]zap", + "[on] [on] pig[ ]zap [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3752,7 +3207,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "piston_extend", "name" : "On Piston Extend", "patterns" : [ - "[on] piston extend[ing]", + "[on] [on] piston extend[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3764,7 +3219,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "piston_retract", "name" : "On Piston Retract", "patterns" : [ - "[on] piston retract[ing]", + "[on] [on] piston retract[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3776,19 +3231,31 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "place", "name" : "On Place", "patterns" : [ - "[on] [block] (plac(e|ing)|build[ing]) [[of] %item types/block datas%]", + "[on] [on] [block] (plac(e|ing)|build[ing]) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], "since" : "1.0, 2.6 (BlockData support)", "description" : "Called when a player places a block.", - "examples" : "on place:\\non place of a furnace, workbench or chest:\\non place of chest[type=right] or chest[type=left]" + "examples" : "on place:\\non place of a furnace, workbench or chest:\\non break of chest[type=right] or chest[type=left]" +}, +{ + "id" : "player_trade", + "name" : "On Player Trade", + "patterns" : [ + "[on] [on] player trad(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Called when a player has traded with a villager.", + "examples" : "on player trade:\\n chance of 50%:\\n cancel event\\n send \"The trade was somehow denied!\" to player" }, { "id" : "player_world_change", "name" : "On Player World Change", "patterns" : [ - "[on] [player] world chang(ing|e[d])", + "[on] [on] [player] world chang(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3800,7 +3267,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "portal", "name" : "On Portal", "patterns" : [ - "[on] [player] portal", + "[on] [on] [player] portal [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3812,7 +3279,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "portal_create", "name" : "On Portal Create", "patterns" : [ - "[on] portal creat(e|ion)", + "[on] [on] portal creat(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3824,8 +3291,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "portal_enter", "name" : "On Portal Enter", "patterns" : [ - "[on] portal enter[ing]", -"[on] entering [a] portal", + "[on] [on] portal enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] entering [a] portal [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3837,7 +3304,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "prepare_craft", "name" : "On Prepare Craft", "patterns" : [ - "[on] [player] (preparing|beginning) craft[ing] [[of] %item types%]", + "[on] [on] [player] (preparing|beginning) craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3849,8 +3316,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "pressure_plate_trip", "name" : "On Pressure Plate / Trip", "patterns" : [ - "[on] [step[ping] on] [a] [pressure] plate", -"[on] (trip|[step[ping] on] [a] tripwire)", + "[on] [on] [step[ping] on] [a] [pressure] plate [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] (trip|[step[ping] on] [a] tripwire) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3862,7 +3329,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "projectile_collide", "name" : "On Projectile Collide", "patterns" : [ - "[on] projectile collide", + "[on] [on] projectile collide [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3874,7 +3341,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "projectile_hit", "name" : "On Projectile Hit", "patterns" : [ - "[on] projectile hit", + "[on] [on] projectile hit [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3886,7 +3353,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "quit", "name" : "On Quit", "patterns" : [ - "[on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing))", + "[on] [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing)) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3898,7 +3365,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "redstone", "name" : "On Redstone", "patterns" : [ - "[on] redstone [current] [chang(e|ing)]", + "[on] [on] redstone [current] [chang(e|ing)] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3910,8 +3377,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "region_enterleave", "name" : "On Region Enter/Leave", "patterns" : [ - "[on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%)", -"[on] region (enter[ing]|leav(e|ing)|exit[ing])", + "[on] [on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] region (enter[ing]|leav(e|ing)|exit[ing]) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3923,8 +3390,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "resource_pack_request_response", "name" : "On Resource Pack Request Response", "patterns" : [ - "[on] resource pack [request] response", -"[on] resource pack [request] %resource pack states%", + "[on] [on] resource pack [request] response [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] resource pack [request] %resource pack states% [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3936,7 +3403,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "respawn", "name" : "On Respawn", "patterns" : [ - "[on] [player] respawn[ing]", + "[on] [on] [player] respawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3948,7 +3415,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "resurrect_attempt", "name" : "On Resurrect Attempt", "patterns" : [ - "[on] [entity] resurrect[ion] [attempt]", + "[on] [on] [entity] resurrect[ion] [attempt] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3960,7 +3427,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "riptide", "name" : "On Riptide", "patterns" : [ - "[on] [use of] riptide [enchant[ment]]", + "[on] [on] [use of] riptide [enchant[ment]] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3972,8 +3439,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "script_loadunload", "name" : "On Script Load/Unload", "patterns" : [ - "[on] [async] [script] (load|init|enable)", -"[on] [async] [script] (unload|stop|disable)", + "[on] [on] [async] [script] (load|init|enable) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [async] [script] (unload|stop|disable) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3985,7 +3452,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "server_list_ping", "name" : "On Server List Ping", "patterns" : [ - "[on] server [list] ping", + "[on] [on] server [list] ping [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -3997,8 +3464,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "server_startstop", "name" : "On Server Start/Stop", "patterns" : [ - "[on] (server|skript) (start|load|enable)", -"[on] (server|skript) (stop|unload|disable)", + "[on] [on] (server|skript) (start|load|enable) [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] (server|skript) (stop|unload|disable) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4010,7 +3477,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "sheep_regrow_wool", "name" : "On Sheep Regrow Wool", "patterns" : [ - "[on] sheep [re]grow[ing] wool", + "[on] [on] sheep [re]grow[ing] wool [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4022,7 +3489,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "shoot", "name" : "On Shoot", "patterns" : [ - "[on] [projectile] shoot", + "[on] [on] [projectile] shoot [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4034,8 +3501,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "sign_change", "name" : "On Sign Change", "patterns" : [ - "[on] sign (chang[e]|edit)[ing]", -"[on] [player] (chang[e]|edit)[ing] [a] sign", + "[on] [on] sign (chang[e]|edit)[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] (chang[e]|edit)[ing] [a] sign [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4047,7 +3514,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "slime_split", "name" : "On Slime Split", "patterns" : [ - "[on] slime split[ting]", + "[on] [on] slime split[ting] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4059,8 +3526,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "smelt", "name" : "On Smelt", "patterns" : [ - "[on] [ore] smelt[ing]", -"[on] smelt[ing] of ore", + "[on] [on] [ore] smelt[ing] [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] smelt[ing] of ore [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4072,8 +3539,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "sneak_toggle", "name" : "On Sneak Toggle", "patterns" : [ - "[on] [player] toggl(e|ing) sneak", -"[on] [player] sneak toggl(e|ing)", + "[on] [on] [player] toggl(e|ing) sneak [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] sneak toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4085,7 +3552,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "spawn", "name" : "On Spawn", "patterns" : [ - "[on] spawn[ing] [of %entity types%]", + "[on] [on] spawn[ing] [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4097,7 +3564,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "spawn_change", "name" : "On Spawn Change", "patterns" : [ - "[on] [world] spawn change", + "[on] [on] [world] spawn change [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4109,7 +3576,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "sponge_absorb", "name" : "On Sponge Absorb", "patterns" : [ - "[on] sponge absorb", + "[on] [on] sponge absorb [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4121,7 +3588,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "spread", "name" : "On Spread", "patterns" : [ - "[on] spread[ing]", + "[on] [on] spread[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4133,8 +3600,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "sprint_toggle", "name" : "On Sprint Toggle", "patterns" : [ - "[on] [player] toggl(e|ing) sprint", -"[on] [player] sprint toggl(e|ing)", + "[on] [on] [player] toggl(e|ing) sprint [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [player] sprint toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4146,8 +3613,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "swim_toggle", "name" : "On Swim Toggle", "patterns" : [ - "[on] [entity] toggl(e|ing) swim", -"[on] [entity] swim toggl(e|ing)", + "[on] [on] [entity] toggl(e|ing) swim [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [entity] swim toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4159,7 +3626,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "tame", "name" : "On Tame", "patterns" : [ - "[on] [entity] tam(e|ing)", + "[on] [on] [entity] tam(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4171,8 +3638,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "target", "name" : "On Target", "patterns" : [ - "[on] [entity] target", -"[on] [entity] un[-]target", + "[on] [on] [entity] target [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] [entity] un[-]target [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4184,7 +3651,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "teleport", "name" : "On Teleport", "patterns" : [ - "[on] [player] teleport[ing]", + "[on] [on] [player] teleport[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4192,24 +3659,11 @@ Do note that other event values, such as 'player', won't work in this section.", "description" : "Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).", "examples" : "on teleport:" }, -{ - "id" : "throwing_of_an_egg", - "name" : "On Throwing of an Egg", - "patterns" : [ - "[on] throw[ing] [of] [an] egg", -"[on] [player] egg throw", - - "pattern_end" - ], - "since" : "1.0", - "description" : "Called when a player throws an egg. You can just use the shoot event in most cases, as this event is intended to support changing the hatched mob and its chance to hatch, but Skript does not yet support that.", - "examples" : "on throw of an egg:" -}, { "id" : "tool_change", "name" : "On Tool Change", "patterns" : [ - "[on] [player['s]] (tool|item held|held item) chang(e|ing)", + "[on] [on] [player['s]] (tool|item held|held item) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4221,8 +3675,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "vehicle_create", "name" : "On Vehicle Create", "patterns" : [ - "[on] vehicle create", -"[on] creat(e|ing|ion of) [a] vehicle", + "[on] [on] vehicle create [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] creat(e|ing|ion of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4234,8 +3688,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "vehicle_damage", "name" : "On Vehicle Damage", "patterns" : [ - "[on] vehicle damage", -"[on] damag(e|ing) [a] vehicle", + "[on] [on] vehicle damage [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] damag(e|ing) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4247,8 +3701,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "vehicle_destroy", "name" : "On Vehicle Destroy", "patterns" : [ - "[on] vehicle destroy", -"[on] destr(oy[ing]|uction of) [a] vehicle", + "[on] [on] vehicle destroy [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] destr(oy[ing]|uction of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4260,8 +3714,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "vehicle_enter", "name" : "On Vehicle Enter", "patterns" : [ - "[on] vehicle enter", -"[on] enter[ing] [a] vehicle", + "[on] [on] vehicle enter [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] enter[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4273,8 +3727,8 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "vehicle_exit", "name" : "On Vehicle Exit", "patterns" : [ - "[on] vehicle exit", -"[on] exit[ing] [a] vehicle", + "[on] [on] vehicle exit [with priority (lowest|low|normal|high|highest|monitor)]", +"[on] [on] exit[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4286,7 +3740,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "weather_change", "name" : "On Weather Change", "patterns" : [ - "[on] weather change [to %weather types%]", + "[on] [on] weather change [to %weather types%] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4298,7 +3752,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "world_init", "name" : "On World Init", "patterns" : [ - "[on] world init[ialization]", + "[on] [on] world init[ialization] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4310,7 +3764,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "world_load", "name" : "On World Load", "patterns" : [ - "[on] world load[ing]", + "[on] [on] world load[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4322,7 +3776,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "world_save", "name" : "On World Save", "patterns" : [ - "[on] world sav(e|ing)", + "[on] [on] world sav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4334,7 +3788,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "world_unload", "name" : "On World Unload", "patterns" : [ - "[on] world unload[ing]", + "[on] [on] world unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4346,7 +3800,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "zombie_break_door", "name" : "On Zombie Break Door", "patterns" : [ - "[on] zombie break[ing] [a] [wood[en]] door", + "[on] [on] zombie break[ing] [a] [wood[en]] door [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4358,7 +3812,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "periodical", "name" : "Periodical", "patterns" : [ - "every %time span%", + "[on] every %time span% [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4370,7 +3824,7 @@ Do note that other event values, such as 'player', won't work in this section.", "id" : "eventperiodical", "name" : "Periodical", "patterns" : [ - "every %time span% in [world[s]] %worlds%", + "[on] every %time span% in [world[s]] %worlds% [with priority (lowest|low|normal|high|highest|monitor)]", "pattern_end" ], @@ -4407,6 +3861,21 @@ Do note that other event values, such as 'player', won't work in this section.", "description" : "The affected entities in the area cloud effect event.", "examples" : "on area cloud effect:\\n loop affected entities:\\n if loop-value is a player:\\n send \"WARNING: you've step on an area effect cloud!\" to loop-value" }, +{ + "id" : "ExprAge", + "name" : "Age of Block/Entity", + "patterns" : [ + "[the] [max[imum]] age of %blocks/entities%", +"%blocks/entities%'[s] [max[imum]] age", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). +For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. +For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.", + "examples" : "# Set targeted crop to fully grown crop\\nset age of targeted block to maximum age of targeted block\\n \\n# Spawn a baby cow that will only need 1 minute to become an adult\\nspawn a baby cow at player\\nset age of last spawned entity to -1200 # in ticks = 60 seconds" +}, { "id" : "ExprAllGroups", "name" : "All Groups", @@ -4541,18 +4010,19 @@ Please note that getting a list's recursive size can cause lag if the list is la "id" : "ExprArgument", "name" : "Argument", "patterns" : [ - "[the] last arg[ument][s]", -"[the] arg[ument][s](-| )<(\\d+)>", + "[the] last arg[ument]", +"[the] arg[ument](-| )<(\\d+)>", "[the] <(\\d*1)st|(\\d*2)nd|(\\d*3)rd|(\\d*[4-90])th> arg[ument][s]", -"[the] arg[ument][s]", +"[(all [[of] the]|the)] arg[ument][s]", "[the] %*type%( |-)arg[ument][( |-)<\\d+>]", "[the] arg[ument]( |-)%*type%[( |-)<\\d+>]", "pattern_end" ], - "since" : "1.0", - "description" : "Only usable in command events. Holds the value of an argument given to the command, e.g. if the command \"/tell <player> <text>\" is used like \"/tell Njol Hello Njol!\" argument 1 is the player named \"Njol\" and argument 2 is \"Hello Njol!\". -One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'.", + "since" : "1.0, INSERT VERSION (support for command events)", + "description" : "Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command \"/tell <player> <text>\" is used like \"/tell Njol Hello Njol!\" argument 1 is the player named \"Njol\" and argument 2 is \"Hello Njol!\". +One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. +Please note that specifying the argument type is only supported in script commands.", "examples" : "give the item-argument to the player-argument\\ndamage the player-argument by the number-argument\\ngive a diamond pickaxe to the argument\\nadd argument 1 to argument 2\\nheal the last argument" }, { @@ -4667,14 +4137,16 @@ Please note that the attacker can also be a block, e.g. a cactus or lava, but th "id" : "ExprBed", "name" : "Bed", "patterns" : [ - "[the] bed[s] [location[s]] of %players%", -"%players%'[s] bed[s] [location[s]]", + "[the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offline players%", +"%offline players%'[s] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]]", "pattern_end" ], - "since" : "2.0", - "description" : "The bed location of a player, i.e. the spawn point of a player if he ever slept in a bed and the bed still exists and is unobstructed.", - "examples" : "if bed of player exists:\\n teleport player the the player's bed\\nelse:\\n teleport the player to the world's spawn point" + "since" : "2.0, INSERT VERSION (offlineplayers, safe bed)", + "description" : "Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location. + +NOTE: Offline players can not have their bed location changed, only online players.", + "examples" : "if bed of player exists:\\n teleport player the the player's bed\\nelse:\\n teleport the player to the world's spawn point\\n\\nset the bed location of player to spawn location of world(\"world\") # unsafe/invalid bed location\\nset the safe bed location of player to spawn location of world(\"world\") # safe/valid bed location" }, { "id" : "ExprBiome", @@ -4717,20 +4189,6 @@ Can optionally include a direction as well, e.g. 'block above' or 'block in fron Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.", "examples" : "block is ore\\nset block below to air\\nspawn a creeper above the block\\nloop blocks in radius 4:\\n loop-block is obsidian\\n set loop-block to water\\nblock is a chest:\\n clear the inventory of the block" }, -{ - "id" : "ExprBlockAge", - "name" : "Block Age", - "patterns" : [ - "[the] [max[imum]] age of %block%", -"%block%'[s] [max[imum]] age", - - "pattern_end" - ], - "since" : "INSERT VERSION", - "description" : "Returns the age or max age of a block. '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.", - "examples" : "set age of targeted block to max age of targeted block" -}, { "id" : "ExprBlockData", "name" : "Block Data", @@ -4965,12 +4423,11 @@ the send effect.", "name" : "Command", "patterns" : [ "[the] (full|complete|whole) command", -"[the] command [label]", -"[the] arguments", +"[the] command [(label|alias)]", "pattern_end" ], - "since" : "2.0", + "since" : "2.0, INSERT VERSION (support for script commands)", "description" : "The command that caused an 'on command' event (excluding the leading slash and all arguments)", "examples" : "# prevent any commands except for the /exit command during some game\\non command:\\n if {game::%player%::playing} is true:\\n if the command is not \"exit\":\\n message \"You're not allowed to use commands during the game\"\\n cancel the event" }, @@ -5641,12 +5098,13 @@ Read this wiki page for "name" : "Formatted Date", "patterns" : [ "%dates% formatted [human-readable] [(with|as) %text%]", +"[human-readable] formatted %dates% [(with|as) %text%]", "pattern_end" ], - "since" : "2.2-dev31", + "since" : "2.2-dev31, INSERT VERSION (support variables in format)", "description" : "Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.", - "examples" : "now formatted human-readable" + "examples" : "command /date:\\n trigger:\\n send \"Full date: %now formatted human-readable%\" to sender\\n send \"Short date: %now formatted as \"\"yyyy-MM-dd\"\"%\" to sender" }, { "id" : "ExprTimeState", @@ -5665,6 +5123,19 @@ Note: The past, future and present states of an expression are sometimes called Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.", "examples" : "on teleport:\\n former world was \"world_nether\" # or 'world was'\\n world will be \"world\" # or 'world after the event is'\\non tool change:\\n past tool is an axe\\n the tool after the event will be air\\non weather change:\\n set {weather::%world%::old} to past weather\\n set {weather::%world%::current} to the new weather" }, +{ + "id" : "ExprFreezeTicks", + "name" : "Freeze Time", + "patterns" : [ + "[the] freeze time of %entities%", +"%entities%'[s] freeze time", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "How much time an entity has been in powdered snow for.", + "examples" : "player's freeze time is less than 3 seconds:\\n send \"you're about to freeze!\" to the player" +}, { "id" : "ExprFurnaceSlot", "name" : "Furnace Slot", @@ -5786,6 +5257,31 @@ When hashing data, you must specify algorithms that will be use

Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.", "examples" : "command /setpass <text>:\\n trigger:\\n set {password::%uuid of player%} to text-argument hashed with SHA-256\\ncommand /login <text>:\\n trigger:\\n if text-argument hashed with SHA-256 is {password::%uuid of player%}:\\n message \"Login successful.\"\\n else:\\n message \"Wrong password!\"" }, +{ + "id" : "ExprHatchingType", + "name" : "Hatching Entity Type", + "patterns" : [ + "[the] hatching entity [type]", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The type of the entity that will be hatched in a Player Egg Throw event.", + "examples" : "on player egg throw:\\n set the hatching entity type to a primed tnt" +}, +{ + "id" : "ExprHatchingNumber", + "name" : "Hatching Number", + "patterns" : [ + "[the] hatching number", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The number of entities that will be hatched in a Player Egg Throw event. +Please note that no more than 127 entities can be hatched at once.", + "examples" : "on player egg throw:\\n set the hatching number to 10" +}, { "id" : "ExprEyeLocation", "name" : "Head location", @@ -6112,21 +5608,6 @@ NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note If multiple strings are passed, each of them will be a separate line in the lore.", "examples" : "set {_test} to stone with lore \"line 1\" and \"line 2\"\\ngive {_test} to player" }, -{ - "id" : "ExprItems", - "name" : "Items", - "patterns" : [ - "[(all [[of] the]|the|every)] item(s|[ ]types)", -"[(all [[of] the]|the)] items of type[s] %item types%", -"[(all [[of] the]|the|every)] block(s|[ ]types)", -"[(all [[of] the]|the)] blocks of type[s] %item types%", - - "pattern_end" - ], - "since" : "unknown (before 2.1)", - "description" : "Items or blocks of a specific type, useful for looping.", - "examples" : "loop items of type ore and log:\\n block contains loop-item\\n message \"Theres at least one %loop-item% in this block\"\\ndrop all blocks at the player # drops one of every block at the player" -}, { "id" : "ExprItemsIn", "name" : "Items In", @@ -6145,14 +5626,14 @@ Please note that the positions of the items in the inventory are not saved, only "name" : "Join & Split", "patterns" : [ "(concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]", -"split %text% (at|using|by) [[the] delimiter] %text%", -"%text% split (at|using|by) [[the] delimiter] %text%", +"split %text% (at|using|by) [[the] delimiter] %text% [with case sensitivity]", +"%text% split (at|using|by) [[the] delimiter] %text% [with case sensitivity]", "regex split %text% (at|using|by) [[the] delimiter] %text%", "regex %text% split (at|using|by) [[the] delimiter] %text%", "pattern_end" ], - "since" : "2.1, 2.5.2 (regex support)", + "since" : "2.1, 2.5.2 (regex support), INSERT VERSION (case sensitivity)", "description" : "Joins several texts with a common delimiter (e.g. \", \"), or splits a text into multiple texts at a given delimiter.", "examples" : "message \"Online players: %join all players with \"\" | \"\"%\" # %all players% would use the default \"x, y, and z\"\\nset {_s::*} to the string argument split at \",\"" }, @@ -6253,12 +5734,14 @@ The vanilla Minecraft client will use lowercase language / country pairs separat "patterns" : [ "[the] [last[ly]] (spawned|shot) %*entity type%", "[the] [last[ly]] dropped (item)", +"[the] [last[ly]] (created|struck) (lightning)", +"[the] [last[ly]] (launched|deployed) (firework)", "pattern_end" ], - "since" : "1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item)", - "description" : "Holds the entity that was spawned most recently with the spawn effect, drop with the drop effect or shot with the shoot effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.", - "examples" : "spawn a priest\\nset {healer::%spawned priest%} to true\\nshoot an arrow from the last spawned entity\\nignite the shot projectile\\ndrop a diamond sword\\npush last dropped item upwards" + "since" : "1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), INSERT VERSION (struck lightning, firework)", + "description" : "Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.", + "examples" : "spawn a priest\\nset {healer::%spawned priest%} to true\\nshoot an arrow from the last spawned entity\\nignite the shot projectile\\ndrop a diamond sword\\npush last dropped item upwards\\nteleport player to last struck lightning\\ndelete last launched firework" }, { "id" : "ExprLastLoginTime", @@ -6339,6 +5822,18 @@ Changing this value can cause the player's level to change if the resulting leve It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.", "examples" : "# set vampire players standing in bright sunlight on fire\\nevery 5 seconds:\\n loop all players:\\n {vampire::%uuid of loop-player%} is true\\n sunlight level at the loop-player is greater than 10\\n ignite the loop-player for 5 seconds" }, +{ + "id" : "ExprPlugins", + "name" : "Loaded Plugins", + "patterns" : [ + "[(all [[of] the]|the)] [loaded] plugins", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "An expression to obtain a list of the names of the server's loaded plugins.", + "examples" : "if the loaded plugins contains \"Vault\":\\n broadcast \"This server uses Vault plugin!\"\\n\\nsend \"Plugins (%size of loaded plugins%): %plugins%\" to player" +}, { "id" : "ExprLocation", "name" : "Location", @@ -6484,6 +5979,19 @@ Please note that the location of an entity is at it's feet, use entities%", +"%entities%'[s] max[imum] freeze time", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The maximum amount of time an entity can spend in powdered snow before taking damage.", + "examples" : "difference between player's freeze time and player's max freeze time is less than 1 second:\\n send \"you're about to freeze!\" to the player" +}, { "id" : "ExprMaxStack", "name" : "Maximum Stack Size", @@ -6586,9 +6094,9 @@ Please note that the location of an entity is at it's feet, use vehicle", "examples" : "#for 1.11 and lower\\npassenger of the minecart is a creeper or a cow\\nthe saddled pig's passenger is a player\\n#for 1.11.2+\\npassengers of the minecart contains a creeper or a cow\\nthe boat's passenger contains a pig\\nadd a cow and a zombie to passengers of last spawned boat\\nset passengers of player's vehicle to a pig and a horse\\nremove all pigs from player's vehicle\\nclear passengers of boat" }, +{ + "id" : "ExprPickupDelay", + "name" : "Pickup Delay", + "patterns" : [ + "[the] pick[ ]up delay of %entities%", +"%entities%'[s] pick[ ]up delay", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The amount of time before a dropped item can be picked up by an entity.", + "examples" : "drop diamond sword at {_location} without velocity\\nset pickup delay of last dropped item to 5 seconds" +}, { "id" : "ExprPing", "name" : "Ping", @@ -6959,6 +6480,18 @@ See also: vehicle", to tipped arrows/lingering potions, Minecraft reduces the timespan.", "examples" : "set {_p} to potion effect of speed of tier 1 without particles for 10 minutes\\nadd {_p} to potion effects of player's tool\\nadd {_p} to potion effects of target entity\\nadd potion effect of speed 1 to potion effects of player" }, +{ + "id" : "ExprPotionEffectTier", + "name" : "Potion Effect Tier", + "patterns" : [ + "[the] [potion] (tier|amplifier|level) of %potions% (of|for|on) %living entities%", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "An expression to obtain the amplifier of a potion effect applied to an entity.", + "examples" : "if the amplifier of haste of player >= 3:" +}, { "id" : "ExprPotionEffects", "name" : "Potion Effects", @@ -7084,6 +6617,18 @@ Please note that the order of the numbers doesn't matter, i.e. random numb "description" : "The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.", "examples" : "raw name of tool of player" }, +{ + "id" : "ExprRawString", + "name" : "Raw String", + "patterns" : [ + "raw %texts%", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "Returns the string without formatting (colors etc.) and without stripping them from it, e.g. raw \"&aHello There!\" would output &aHello There!", + "examples" : "send raw \"&aThis text is unformatted!\" to all players" +}, { "id" : "ExprRedstoneBlockPower", "name" : "Redstone Block Power", @@ -7259,6 +6804,22 @@ or can be reset to the default icon in a 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.", "examples" : "on script load:\\n set {server-icons::default} to the default server icon" }, +{ + "id" : "ExprSets", + "name" : "Sets", + "patterns" : [ + "[(all [[of] the]|the|every)] item(s|[ ]types)", +"[(all [[of] the]|the)] items of type[s] %item types%", +"[(all [[of] the]|the|every)] block(s|[ ]types)", +"[(all [[of] the]|the)] blocks of type[s] %item types%", +"([all [[of] the]] colo[u]rs|(the|every) colo[u]r)", + + "pattern_end" + ], + "since" : "unknown (before 1.4.2), INSERT VERSION (colors)", + "description" : "Collection sets of items or blocks of a specific type or colours, useful for looping.", + "examples" : "loop items of type ore and log:\\n block contains loop-item\\n message \"Theres at least one %loop-item% in this block\"\\ndrop all blocks at the player # drops one of every block at the player" +}, { "id" : "ExprShooter", "name" : "Shooter", @@ -7507,6 +7068,18 @@ Please note that changing a player's speed will change their FOV just like potio "description" : "A shorthand expression for returning something based on a condition.", "examples" : "set {points} to 500 if {admin::%player's uuid%} is set else 100" }, +{ + "id" : "ExprEgg", + "name" : "The Egg", + "patterns" : [ + "[the] [thrown] egg", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The egg thrown in a Player Egg Throw event.", + "examples" : "spawn an egg at the egg" +}, { "id" : "ExprTime", "name" : "Time", @@ -7529,9 +7102,10 @@ Please note that changing a player's speed will change their FOV just like potio "pattern_end" ], - "since" : "2.5", - "description" : "The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu.", - "examples" : "set {_t} to time played of player\\nif player's time played is greater than 10 minutes:\\n give player a diamond sword\\nset player's time played to 0 seconds" + "since" : "2.5, INSERT VERSION (offline players)", + "description" : "The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. +Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.", + "examples" : "set {_t} to time played of player\\nif player's time played is greater than 10 minutes:\\n give player a diamond sword\\n\\nset player's time played to 0 seconds" }, { "id" : "ExprTimeSince", @@ -7932,6 +7506,19 @@ This can only be set in a server list pin "description" : "The world the event occurred in.", "examples" : "world is \"world_nether\"\\nteleport the player to the world's spawn\\nset the weather in the player's world to rain\\nset {_world} to world of event-chunk" }, +{ + "id" : "ExprWorldEnvironment", + "name" : "World Environment", + "patterns" : [ + "[the] [world] environment of %worlds%", +"%worlds%'[s] [world] environment", + + "pattern_end" + ], + "since" : "INSERT VERSION", + "description" : "The environment of a world", + "examples" : "if environment of player's world is nether:\\n apply fire resistance to player for 10 minutes" +}, { "id" : "ExprSeed", "name" : "World Seed", diff --git a/effects.html b/effects.html index eb44f6ee977..0b9b0b14df6 100644 --- a/effects.html +++ b/effects.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Effects

Action Bar

🔗

Effect

Patterns:
  • send [the] action bar [with text] %text% to %players%
Since: 2.3
Sends an action bar message to the given player(s).

Examples:

send action bar "Hello player!" to player

Ban

🔗

Effect

Patterns:
Since: 1.4, 2.1.1 (ban reason), 2.5 (timespan)
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.

Note that banning people does not kick them from the server. Consider using the kick effect after applying a ban.

Examples:

unban player
ban "127.0.0.1"
IP-ban the player because "he is an idiot"
ban player due to "inappropriate language" for 2 days

Break Block

🔗

Effect

Patterns:
Since: 2.4
Breaks the block and spawns items as if a player had mined it

You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)

Examples:

on right click:
    break clicked block naturally
loop blocks in radius 10 around player:
    break loop-block using player's tool
loop blocks in radius 10 around player:
    break loop-block naturally using diamond pickaxe

Broadcast

🔗

Effect

Patterns:
Since: 1.0, 2.6 (broadcasting objects), 2.6.1 (using advanced formatting)
Broadcasts a message to the server.

Examples:

broadcast "Welcome %player% to the server!"
broadcast "Woah! It's a message!"

Cancel Command Cooldown

🔗

Effect

Patterns:
  • (cancel|ignore) [the] [current] [command] cooldown
  • un(cancel|ignore) [the] [current] [command] cooldown
Since: 2.2-dev34
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.

Examples:

command /nick <text>:
    executable by: players
    cooldown: 10 seconds
    trigger:
        if length of arg-1 is more than 16:
            # Makes it so that invalid arguments don't make you wait for the cooldown again
            cancel the cooldown
            send "Your nickname may be at most 16 characters."
            stop
        set the player's display name to arg-1

Cancel Drops

🔗

Effect

Patterns:
  • (cancel|clear|delete) [the] drops [of (items|[e]xp[erience][s])]
  • (cancel|clear|delete) [the] (item|[e]xp[erience]) drops
Since: 2.4
Usable in events: death, break / mine
Requirements: 1.12.2 or newer (cancelling item drops of blocks)
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.

Examples:

on death of a zombie:
    if name of the entity is "&cSpecial":
        cancel drops of items

on break of a coal ore:
    cancel the experience drops

Cancel Event

🔗

Effect

Patterns:
  • cancel [the] event
  • uncancel [the] event
Since: 1.0
Cancels the event (e.g. prevent blocks from being placed, or damage being taken).

Examples:

on damage:
    victim is a player
    victim has the permission "skript.god"
    cancel the event

Change: Set/Add/Remove/Delete/Reset

🔗

Effect

Patterns:
Since: 1.0 (set, add, remove, delete), 2.0 (remove all)
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.

Examples:

# set:
Set the player's display name to "<red>%name of player%"
set the block above the victim to lava
# add:
add 2 to the player's health # preferably use 'heal' for this
add argument to {blacklist::*}
give a diamond pickaxe of efficiency 5 to the player
increase the data value of the clicked block by 1
# remove:
remove 2 pickaxes from the victim
subtract 2.5 from {points::%uuid of player%}
# remove all:
remove every iron tool from the player
remove all minecarts from {entitylist::*}
# delete:
delete the block below the player
clear drops
delete {variable}
# reset:
reset walk speed of player
reset chunk at the targeted block

Charge Creeper

🔗

Effect

Patterns:
  • make %living entities% [a[n]] (charged|powered|((un|non[-])charged|(un|non[-])powered)) [creeper[s]]
  • (charge|power|(uncharge|unpower)) %living entities%
Since: 2.5
Charges or uncharges a creeper. A creeper is charged when it has been struck by lightning.

Examples:

on spawn of creeper:
    charge the event-entity

Color Items

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev26 (maps and potions)
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.

Examples:

dye player's helmet blue
color the player's tool red

Command

🔗

Effect

Patterns:
Since: 1.0
Executes a command. This can be useful to use other plugins in triggers.

Examples:

make player execute command "/suicide"
execute console command "/say Hello everyone!"

Connect

🔗

Effect

Patterns:
Since: 2.3
Connects a player to another bungeecord server

Examples:

connect all players to "hub"

Continue

🔗

Effect

Patterns:
  • continue [loop]
Since: 2.2-dev37, INSERT VERSION (while loops)
Skips the value currently being looped, moving on to the next value if it exists.

Examples:

loop all players:
    if loop-value does not have permission "moderator":
        continue # filter out non moderators
    broadcast "%loop-player% is a moderator!" # Only moderators get broadcast

Damage/Heal/Repair

🔗

Effect

Patterns:
Since: 1.0
Damage/Heal/Repair an entity, or item.

Examples:

damage player by 5 hearts
heal the player
repair tool of player

Delay

🔗

Effect

Patterns:
Since: 1.4
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!

Examples:

wait 2 minutes
halt for 5 minecraft hours
wait a tick

Do If

🔗

Effect

Patterns:
  • <.+> if <.+>
Since: 2.3
Execute an effect if a condition is true.

Examples:

on join:
    give a diamond to the player if the player has permission "rank.vip"

Drop

🔗

Effect

Patterns:
Since: 1.0
Drops one or more items.

Examples:

on death of creeper:
    drop 1 TNT

Enable/Disable/Reload Script File

🔗

Effect

Patterns:
  • (enable|load|reload|disable|unload) s(c|k)ript [file] %text%
Since: 2.4
Enables, disables, or reloads a script file.

Examples:

reload script "test"
enable script file "testing"
unload script file "script.sk"

Enchant/Disenchant

🔗

Effect

Patterns:
Since: 2.0
Enchant or disenchant an existing item.

Examples:

enchant the player's tool with sharpness 5
disenchant the player's tool

Equip

🔗

Effect

Patterns:
Since: 1.0
Equips an entity with some given armor. This will replace any armor that the entity is wearing.

Examples:

equip player with diamond helmet
equip player with all diamond armor

Exit

🔗

Effect

Patterns:
  • (exit|stop) [trigger]
  • (exit|stop) [(1|a|the|this)] (section|loop|conditional)
  • (exit|stop) <\d+> (section|loop|conditional)s
  • (exit|stop) all (section|loop|conditional)s
Since: unknown (before 2.1)
Exits a given amount of loops and conditionals, or the entire trigger.

Examples:

if player has any ore:
    stop
message "%player% has no ores!"
loop blocks above the player:
    loop-block is not air:
        exit 2 sections
    set loop-block to water

Explode Creeper

🔗

Effect

Patterns:
Since: 2.5
Requirements: Paper 1.13 or newer/Spigot 1.14 or newer. Ignition can be stopped on Paper 1.13 or newer.
Starts the explosion process of a creeper or instantly explodes it.

Examples:

start explosion of the last spawned creeper
stop ignition of the last spawned creeper

Explosion

🔗

Effect

Patterns:
Since: 1.0
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.

Examples:

create an explosion of force 10 at the player
create an explosion of force 0 at the victim

Feed

🔗

Effect

Patterns:
Since: 2.2-dev34
Feeds the specified players.

Examples:

feed all players
feed the player by 5 beefs

Force Attack

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes a living entity attack an entity with a melee attack.

Examples:

spawn a wolf at player's location
make last spawned wolf attack player

Force Respawn

🔗

Effect

Patterns:
Since: 2.2-dev21
Forces player(s) to respawn if they are dead. If this is called without delay from death event, one tick is waited before respawn attempt.

Examples:

on death of player:
    force event-player to respawn

Hide Player from Server List

🔗

Effect

Patterns:
  • hide %players% (in|on|from) [the] server list
  • hide %players%'[s] info[rmation] (in|on|from) [the] server list
Since: 2.3
Hides a player from the hover list and decreases the online players count (only if the player count wasn't changed before).

Examples:

on server list ping:
    hide {vanished::*} from the server list

Ignite/Extinguish

🔗

Effect

Patterns:
Since: 1.4
Lights entities on fire or extinguishes them.

Examples:

ignite the player
extinguish the player

Keep Inventory / Experience

🔗

Effect

Patterns:
  • keep [the] (inventory|items) [(and [e]xp[erience][s] [point[s]])]
  • keep [the] [e]xp[erience][s] [point[s]] [(and (inventory|items))]
Since: 2.4
Usable in events: death
Keeps the inventory or/and experiences of the dead player in a death event.

Examples:

on death of a player:
    if the victim is an op:
        keep the inventory and experiences

Kick

🔗

Effect

Patterns:
  • kick %players% [(by reason of|because [of]|on account of|due to) %text%]
Since: 1.0
Kicks a player from the server.

Examples:

on place of TNT, lava, or obsidian:
    kick the player due to "You may not place %block%!"
    cancel the event

Kill

🔗

Effect

Patterns:
Since: 1.0
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.

Examples:

kill the player
kill all creepers in the player's world
kill all endermen, witches and bats

Launch firework

🔗

Effect

Patterns:
Since: 2.4
Launch firework effects at the given location(s).

Examples:

launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Leash entities

🔗

Effect

Patterns:
Since: 2.3
Leash living entities to other entities.

Examples:

leash the player to the target entity

Lightning

🔗

Effect

Patterns:
Since: 1.4
Strike lightning at a given location. Can use 'lightning effect' to create a lightning that does not harm entities or start fires.

Examples:

strike lightning at the player
strike lightning effect at the victim

Load Server Icon

🔗

Effect

Patterns:
  • load [the] server icon (from|of) [the] [image] [file] %text%
Since: 2.3
Requirements: Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.

Examples:

on load:
    clear {server-icons::*}
    loop 5 times:
        load server icon from file "icons/%loop-number%.png"
        add the last loaded server icon to {server-icons::*}

on server list ping:
    set the icon to a random server icon out of {server-icons::*}

Locally Suppress Warning

🔗

Effect

Patterns:
  • [local[ly]] suppress [the] (conflict|variable save|[missing] conjunction[s]|starting [with] expression[s]) warning[s]
Since: 2.3
Suppresses target warnings from the current script.

Examples:

locally suppress conflict warnings
suppress the variable save warnings

Log

🔗

Effect

Patterns:
Since: 2.0
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.

Examples:

on place of TNT:
    log "%player% placed TNT in %world% at %location of block%" to "tnt/placement.log"

Make Fly

🔗

Effect

Patterns:
Since: 2.2-dev34
Forces a player to start/stop flying.

Examples:

make player fly
force all players to stop flying

Make Incendiary

🔗

Effect

Patterns:
  • make %entities% [not] incendiary
  • make %entities%'[s] explosion [not] (incendiary|fiery)
  • make [the] [event(-| )]explosion [not] (incendiary|fiery)
Since: 2.5
Sets if an entity's explosion will leave behind fire. This effect is also usable in an explosion prime event.

Examples:

on explosion prime:
    make the explosion fiery

Make Invulnerable

🔗

Effect

Patterns:
Since: 2.5
Makes an entity invulnerable/not invulnerable.

Examples:

make target entity invulnerable

Make Say

🔗

Effect

Patterns:
Since: 2.3
Forces a player to send a message to the chat. If the message starts with a slash it will force the player to use command.

Examples:

make the player say "Hello."
force all players to send the message "I love this server"

Message

🔗

Effect

Patterns:
Since: 1.0, 2.2-dev26 (advanced features), 2.5.2 (optional sender), 2.6 (sending objects)
Requirements: Minecraft 1.16.4+ for optional sender
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.

Examples:

message "A wild %player% appeared!"
message "This message is a distraction. Mwahaha!"
send "Your kill streak is %{kill streak::%uuid of player%}%." to player
if the targeted entity exists:
    message "You're currently looking at a %type of the targeted entity%!"
on chat:
    cancel event
    send "[%player%] >> %message%" to all players from player

Open Book

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.14.2+
Opens a written book to a player.

Examples:

open book player's tool to player

Open/Close Inventory

🔗

Effect

Patterns:
  • (open|show) (((crafting [table]|workbench)|chest|anvil|hopper|dropper|dispenser) [(view|window|inventory)]|%inventory/inventory type%) (to|for) %players%
  • close [the] inventory [view] (to|of|for) %players%
  • close %players%'[s] inventory [view]
Since: 2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.

Examples:

show the victim's inventory to the player
open the player's inventory for the player

Play Effect

🔗

Effect

Patterns:
Since: 2.1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.

Examples:

play wolf hearts on the clicked wolf
show mob spawner flames at the targeted block to the player

Play Sound

🔗

Effect

Patterns:
Since: 2.2-dev28, 2.4 (sound categories)
Requirements: Minecraft 1.11+ (sound categories)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

play sound "block.note_block.pling" # It is block.note.pling in 1.12.2
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
play sound "custom.music.1" in jukebox category at {speakerBlock}

Player Info Visibility

🔗

Effect

Patterns:
  • hide [all] player [related] info[rmation] [(in|on|from) [the] server list]
  • (show|reveal) [all] player [related] info[rmation] [(in|to|on|from) [the] server list]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.

Examples:

hide player info
hide player related information in the server list
reveal all player related info

Player Visibility

🔗

Effect

Patterns:
Since: 2.3
Change visibility of a player for the given players. When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.

Note: if a player was hidden and relogs, this player will be visible again.

Examples:

on join:
    if {vanished::%player's uuid%} is true:
        hide the player from all players

reveal hidden players of {_player}

Poison/Cure

🔗

Effect

Patterns:
Since: 1.3.2
Poison or cure a creature.

Examples:

poison the player
poison the victim for 20 seconds
cure the player from poison

Potion Effects

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects)
Apply or remove potion effects to/from entities.

Examples:

apply swiftness 2 to the player
remove haste from the victim
on join:
    apply potion of strength of tier {strength.%player%} to the player for 999 days
apply potion effects of player's tool to player

Push

🔗

Effect

Patterns:
Since: 1.4.6
Push entities around.

Examples:

push the player upwards
push the victim downwards at speed 0.5

PvP

🔗

Effect

Patterns:
Since: 1.3.4
Set the PvP state for a given world.

Examples:

enable PvP #(current world only)
disable PvP in all worlds

Replace

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.

Examples:

replace "" in {textvar} with "%item%"
replace every "&" with "§" in line 1
# The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well:
on chat:
    replace all "kys", "idiot" and "noob" with "****" in the message

replace all stone and dirt in player's inventory and player's top inventory with diamond

Return

🔗

Effect

Patterns:
Since: 2.2
Makes a function return a value

Examples:

function double(i: number) :: number:
    return 2 * {_i}

Send Block Change

🔗

Effect

Patterns:
Since: 2.2-dev37c, 2.5.1 (block data support)
Makes a player see a block as something it really isn't. BlockData support is only for MC 1.13+

Examples:

make player see block at player as dirt
make player see target block as campfire[facing=south]

Send Resource Pack

🔗

Effect

Patterns:
  • send [the] resource pack [from [[the] URL]] %text% to %players%
  • send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since: 2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.

The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.

The resource pack request action can be used to check status of the sent resource pack request.

Examples:

on join:
    send the resource pack from "URL" with hash "hash" to the player

Shear

🔗

Effect

Patterns:
Since: 2.0
Shears or 'un-shears' a sheep. Please note that no wool is dropped, this only sets the 'sheared' state of the sheep.

Examples:

on rightclick on a sheep holding a sword:
    shear the clicked sheep

Shoot

🔗

Effect

Patterns:
Since: 1.4
Shoots a projectile (or any other entity) from a given entity.

Examples:

shoot an arrow
make the player shoot a creeper at speed 10
shoot a pig from the creeper

Silence Entity

🔗

Effect

Patterns:
Since: 2.5
Controls whether or not an entity is silent.

Examples:

make target entity silent

Stop Server

🔗

Effect

Patterns:
  • (stop|shut[ ]down) [the] server
  • restart [the] server
Since: 2.5
Stops or restarts the server. If restart is used when the restart-script spigot.yml option isn't defined, the server will stop instead.

Examples:

stop the server
restart server

Stop Sound

🔗

Effect

Patterns:
Since: 2.4
Requirements: Minecraft 1.10.2+, Minecraft 1.11+ (sound categories)
Stops a sound from playing to the specified players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

stop sound "block.chest.open" for the player
stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player

Swing Hand

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes an entity swing their hand. This does nothing if the entity does not have an animation for swinging their hand.

Examples:

make player swing their main hand

Teleport

🔗

Effect

Patterns:
Since: 1.0
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.

Examples:

teleport the player to {homes.%player%}
teleport the attacker to the victim

Title - Reset

🔗

Effect

Patterns:
  • reset [the] title[s] [of %players%]
  • reset [the] %players%'[s] title[s]
Since: 2.3
Resets the title of the player to the default values.

Examples:

reset the titles of all players
reset the title

Title - Send

🔗

Effect

Patterns:
Since: 2.3
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.

If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.

Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.

Examples:

send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds
send title "Hi %player%" to player
send title "Loot Drop" with subtitle "starts in 3 minutes" to all players
send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second
send subtitle "Party!" to all players

Toggle

🔗

Effect

Patterns:
  • (close|turn off|de[-]activate) %blocks%
  • (toggle|switch) [[the] state of] %blocks%
  • (open|turn on|activate) %blocks%
Since: 1.4
Toggle the state of a block.

Examples:

# use arrows to toggle switches, doors, etc.
on projectile hit:
    projectile is arrow
    toggle the block at the arrow

Toggle Flight

🔗

Effect

Patterns:
  • (allow|enable) (fly|flight) (for|to) %players%
  • (disallow|disable) (fly|flight) (for|to) %players%
Since: 2.3
Toggle the flight mode of a player.

Examples:

allow flight to event-player

Tree

🔗

Effect

Patterns:
Since: 1.0
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.

Examples:

grow a tall redwood tree above the clicked block

Vectors - Rotate Around Vector

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around another vector

Examples:

rotate {_v} around vector 1, 0, 0 by 90

Vectors - Rotate around XYZ

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around x, y, or z axis by some degrees

Examples:

rotate {_v} around x-axis by 90
rotate {_v} around y-axis by 90
rotate {_v} around z-axis by 90 degrees

Vehicle

🔗

Effect

Patterns:
  • (make|let|force) %entities% [to] (ride|mount) [(in|on)] %entities/entity types%
  • (make|let|force) %entities% [to] (dismount|(dismount|leave) [(from|of)] [(any|the[ir]|his|her)] vehicle[s])
  • (eject|dismount) [(any|the)] passenger[s] (of|from) %entities%
Since: 2.0
Makes an entity ride another entity, e.g. a minecart, a saddled pig, an arrow, etc.

Examples:

make the player ride a saddled pig
make the attacker ride the victim

op/deop

🔗

Effect

Patterns:
Since: 1.0
Grant/revoke a user operator state.

Examples:

op the player
deop all players

Spawn

🔗

EffectSection

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""
\ No newline at end of file + Skript Documentation - 2.6.3

Effects

Action Bar

🔗

Effect

Patterns:
  • send [the] action bar [with text] %text% to %players%
Since: 2.3
Sends an action bar message to the given player(s).

Examples:

send action bar "Hello player!" to player

Ban

🔗

Effect

Patterns:
Since: 1.4, 2.1.1 (ban reason), 2.5 (timespan)
Bans or unbans a player or an IP address. If a reason is given, it will be shown to the player when they try to join the server while banned. A length of ban may also be given to apply a temporary ban. If it is absent for any reason, a permanent ban will be used instead. We recommend that you test your scripts so that no accidental permanent bans are applied.

Note that banning people does not kick them from the server. Consider using the kick effect after applying a ban.

Examples:

unban player
ban "127.0.0.1"
IP-ban the player because "he is an idiot"
ban player due to "inappropriate language" for 2 days

Break Block

🔗

Effect

Patterns:
Since: 2.4
Breaks the block and spawns items as if a player had mined it

You can add a tool, which will spawn items based on how that tool would break the block (ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)

Examples:

on right click:
    break clicked block naturally
loop blocks in radius 10 around player:
    break loop-block using player's tool
loop blocks in radius 10 around player:
    break loop-block naturally using diamond pickaxe

Broadcast

🔗

Effect

Patterns:
Since: 1.0, 2.6 (broadcasting objects), 2.6.1 (using advanced formatting)
Broadcasts a message to the server.

Examples:

broadcast "Welcome %player% to the server!"
broadcast "Woah! It's a message!"

Cancel Command Cooldown

🔗

Effect

Patterns:
  • (cancel|ignore) [the] [current] [command] cooldown
  • un(cancel|ignore) [the] [current] [command] cooldown
Since: 2.2-dev34
Only usable in commands. Makes it so the current command usage isn't counted towards the cooldown.

Examples:

command /nick <text>:
    executable by: players
    cooldown: 10 seconds
    trigger:
        if length of arg-1 is more than 16:
            # Makes it so that invalid arguments don't make you wait for the cooldown again
            cancel the cooldown
            send "Your nickname may be at most 16 characters."
            stop
        set the player's display name to arg-1

Cancel Drops

🔗

Effect

Patterns:
  • (cancel|clear|delete) [the] drops [of (items|[e]xp[erience][s])]
  • (cancel|clear|delete) [the] (item|[e]xp[erience]) drops
Since: 2.4
Usable in events: death, break / mine
Requirements: 1.12.2 or newer (cancelling item drops of blocks)
Cancels drops of items or experiences in a death or block break event. Please note that this doesn't keep items or experiences of a dead player. If you want to do that, use the Keep Inventory / Experience effect.

Examples:

on death of a zombie:
    if name of the entity is "&cSpecial":
        cancel drops of items

on break of a coal ore:
    cancel the experience drops

Cancel Event

🔗

Effect

Patterns:
  • cancel [the] event
  • uncancel [the] event
Since: 1.0
Cancels the event (e.g. prevent blocks from being placed, or damage being taken).

Examples:

on damage:
    victim is a player
    victim has the permission "skript.god"
    cancel the event

Change: Set/Add/Remove/Delete/Reset

🔗

Effect

Patterns:
Since: 1.0 (set, add, remove, delete), 2.0 (remove all)
A very general effect that can change many expressions. Many expressions can only be set and/or deleted, while some can have things added to or removed from them.

Examples:

# set:
Set the player's display name to "<red>%name of player%"
set the block above the victim to lava
# add:
add 2 to the player's health # preferably use 'heal' for this
add argument to {blacklist::*}
give a diamond pickaxe of efficiency 5 to the player
increase the data value of the clicked block by 1
# remove:
remove 2 pickaxes from the victim
subtract 2.5 from {points::%uuid of player%}
# remove all:
remove every iron tool from the player
remove all minecarts from {entitylist::*}
# delete:
delete the block below the player
clear drops
delete {variable}
# reset:
reset walk speed of player
reset chunk at the targeted block

Charge Creeper

🔗

Effect

Patterns:
  • make %living entities% [a[n]] (charged|powered|((un|non[-])charged|(un|non[-])powered)) [creeper[s]]
  • (charge|power|(uncharge|unpower)) %living entities%
Since: 2.5
Charges or uncharges a creeper. A creeper is charged when it has been struck by lightning.

Examples:

on spawn of creeper:
    charge the event-entity

Color Items

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev26 (maps and potions)
Colors items in a given color. You can also use RGB codes if you feel limited with the 16 default colors. RGB codes are three numbers from 0 to 255 in the order (red, green, blue), where (0,0,0) is black and (255,255,255) is white. Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.

Examples:

dye player's helmet blue
color the player's tool red

Command

🔗

Effect

Patterns:
Since: 1.0
Executes a command. This can be useful to use other plugins in triggers.

Examples:

make player execute command "/suicide"
execute console command "/say Hello everyone!"

Connect

🔗

Effect

Patterns:
Since: 2.3
Connects a player to another bungeecord server

Examples:

connect all players to "hub"

Continue

🔗

Effect

Patterns:
  • continue [loop]
Since: 2.2-dev37, INSERT VERSION (while loops)
Skips the value currently being looped, moving on to the next value if it exists.

Examples:

loop all players:
    if loop-value does not have permission "moderator":
        continue # filter out non moderators
    broadcast "%loop-player% is a moderator!" # Only moderators get broadcast

Damage/Heal/Repair

🔗

Effect

Patterns:
Since: 1.0
Damage/Heal/Repair an entity, or item.

Examples:

damage player by 5 hearts
heal the player
repair tool of player

Delay

🔗

Effect

Patterns:
Since: 1.4
Delays the script's execution by a given timespan. Please note that delays are not persistent, e.g. trying to create a tempban script with ban player → wait 7 days → unban player will not work if you restart your server anytime within these 7 days. You also have to be careful even when using small delays!

Examples:

wait 2 minutes
halt for 5 minecraft hours
wait a tick

Do If

🔗

Effect

Patterns:
  • <.+> if <.+>
Since: 2.3
Execute an effect if a condition is true.

Examples:

on join:
    give a diamond to the player if the player has permission "rank.vip"

Drop

🔗

Effect

Patterns:
Since: 1.0
Drops one or more items.

Examples:

on death of creeper:
    drop 1 TNT

Enable/Disable/Reload Script File

🔗

Effect

Patterns:
  • ((enable|load)|reload|(disable|unload)) s(c|k)ript [file] %text%
Since: 2.4
Enables, disables, or reloads a script file.

Examples:

reload script "test"
enable script file "testing"
unload script file "script.sk"

Enchant/Disenchant

🔗

Effect

Patterns:
Since: 2.0
Enchant or disenchant an existing item.

Examples:

enchant the player's tool with sharpness 5
disenchant the player's tool

Equip

🔗

Effect

Patterns:
Since: 1.0, INSERT VERSION (multiple entities)
Equips an entity with some given armor. This will replace any armor that the entity is wearing.

Examples:

equip player with diamond helmet
equip player with all diamond armor

Exit

🔗

Effect

Patterns:
  • (exit|stop) [trigger]
  • (exit|stop) [(1|a|the|this)] (section|loop|conditional)
  • (exit|stop) <\d+> (section|loop|conditional)s
  • (exit|stop) all (section|loop|conditional)s
Since: unknown (before 2.1)
Exits a given amount of loops and conditionals, or the entire trigger.

Examples:

if player has any ore:
    stop
message "%player% has no ores!"
loop blocks above the player:
    loop-block is not air:
        exit 2 sections
    set loop-block to water

Explode Creeper

🔗

Effect

Patterns:
Since: 2.5
Requirements: Paper 1.13 or newer/Spigot 1.14 or newer. Ignition can be stopped on Paper 1.13 or newer.
Starts the explosion process of a creeper or instantly explodes it.

Examples:

start explosion of the last spawned creeper
stop ignition of the last spawned creeper

Explosion

🔗

Effect

Patterns:
Since: 1.0
Creates an explosion of a given force. The Minecraft Wiki has an article on explosions which lists the explosion forces of TNT, creepers, etc. Hint: use a force of 0 to create a fake explosion that does no damage whatsoever, or use the explosion effect introduced in Skript 2.0. Starting with Bukkit 1.4.5 and Skript 2.0 you can use safe explosions which will damage entities but won't destroy any blocks.

Examples:

create an explosion of force 10 at the player
create an explosion of force 0 at the victim

Feed

🔗

Effect

Patterns:
Since: 2.2-dev34
Feeds the specified players.

Examples:

feed all players
feed the player by 5 beefs

Force Attack

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes a living entity attack an entity with a melee attack.

Examples:

spawn a wolf at player's location
make last spawned wolf attack player

Force Respawn

🔗

Effect

Patterns:
Since: 2.2-dev21
Forces player(s) to respawn if they are dead. If this is called without delay from death event, one tick is waited before respawn attempt.

Examples:

on death of player:
    force event-player to respawn

Hide Player from Server List

🔗

Effect

Patterns:
  • hide %players% (in|on|from) [the] server list
  • hide %players%'[s] info[rmation] (in|on|from) [the] server list
Since: 2.3
Hides a player from the hover list and decreases the online players count (only if the player count wasn't changed before).

Examples:

on server list ping:
    hide {vanished::*} from the server list

Ignite/Extinguish

🔗

Effect

Patterns:
Since: 1.4
Lights entities on fire or extinguishes them.

Examples:

ignite the player
extinguish the player

Keep Inventory / Experience

🔗

Effect

Patterns:
  • keep [the] (inventory|items) [(and [e]xp[erience][s] [point[s]])]
  • keep [the] [e]xp[erience][s] [point[s]] [(and (inventory|items))]
Since: 2.4
Usable in events: death
Keeps the inventory or/and experiences of the dead player in a death event.

Examples:

on death of a player:
    if the victim is an op:
        keep the inventory and experiences

Kick

🔗

Effect

Patterns:
  • kick %players% [(by reason of|because [of]|on account of|due to) %text%]
Since: 1.0
Kicks a player from the server.

Examples:

on place of TNT, lava, or obsidian:
    kick the player due to "You may not place %block%!"
    cancel the event

Kill

🔗

Effect

Patterns:
Since: 1.0
Kills an entity. Note: This effect does not set the entity's health to 0 (which causes issues), but damages the entity by 100 times its maximum health.

Examples:

kill the player
kill all creepers in the player's world
kill all endermen, witches and bats

Launch firework

🔗

Effect

Patterns:
Since: 2.4
Launch firework effects at the given location(s).

Examples:

launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Leash entities

🔗

Effect

Patterns:
Since: 2.3
Leash living entities to other entities.

Examples:

leash the player to the target entity

Lightning

🔗

Effect

Patterns:
Since: 1.4
Strike lightning at a given location. Can use 'lightning effect' to create a lightning that does not harm entities or start fires.

Examples:

strike lightning at the player
strike lightning effect at the victim

Load Server Icon

🔗

Effect

Patterns:
  • load [the] server icon (from|of) [the] [image] [file] %text%
Since: 2.3
Requirements: Paper 1.12.2 or newer
Loads server icons from the given files. You can get the loaded icon using the last loaded server icon expression. Please note that the image must be 64x64 and the file path starts from the server folder.

Examples:

on load:
    clear {server-icons::*}
    loop 5 times:
        load server icon from file "icons/%loop-number%.png"
        add the last loaded server icon to {server-icons::*}

on server list ping:
    set the icon to a random server icon out of {server-icons::*}

Locally Suppress Warning

🔗

Effect

Patterns:
  • [local[ly]] suppress [the] (conflict|variable save|[missing] conjunction[s]|starting [with] expression[s]) warning[s]
Since: 2.3
Suppresses target warnings from the current script.

Examples:

locally suppress missing conjunction warnings
suppress the variable save warnings

Log

🔗

Effect

Patterns:
Since: 2.0
Writes text into a .log file. Skript will write these files to /plugins/Skript/logs. NB: Using 'server.log' as the log file will write to the default server log. Omitting the log file altogether will log the message as '[Skript] [<script>.sk] <message>' in the server log.

Examples:

on place of TNT:
    log "%player% placed TNT in %world% at %location of block%" to "tnt/placement.log"

Make Egg Hatch

🔗

Effect

Patterns:
  • make [the] egg [not] hatch
Since: INSERT VERSION
Usable in events: Egg Throw
Makes the egg hatch in a Player Egg Throw event.

Examples:

on player egg throw:
    # EGGS FOR DAYZ!
    make the egg hatch

Make Fly

🔗

Effect

Patterns:
Since: 2.2-dev34
Forces a player to start/stop flying.

Examples:

make player fly
force all players to stop flying

Make Incendiary

🔗

Effect

Patterns:
  • make %entities% [not] incendiary
  • make %entities%'[s] explosion [not] (incendiary|fiery)
  • make [the] [event(-| )]explosion [not] (incendiary|fiery)
Since: 2.5
Sets if an entity's explosion will leave behind fire. This effect is also usable in an explosion prime event.

Examples:

on explosion prime:
    make the explosion fiery

Make Invulnerable

🔗

Effect

Patterns:
Since: 2.5
Makes an entity invulnerable/not invulnerable.

Examples:

make target entity invulnerable

Make Say

🔗

Effect

Patterns:
Since: 2.3
Forces a player to send a message to the chat. If the message starts with a slash it will force the player to use command.

Examples:

make the player say "Hello."
force all players to send the message "I love this server"

Message

🔗

Effect

Patterns:
Since: 1.0, 2.2-dev26 (advanced features), 2.5.2 (optional sender), 2.6 (sending objects)
Requirements: Minecraft 1.16.4+ for optional sender
Sends a message to the given player. Only styles written in given string or in formatted expressions will be parsed. Adding an optional sender allows the messages to be sent as if a specific player sent them. This is useful with Minecraft 1.16.4's new chat ignore system, in which players can choose to ignore other players, but for this to work, the message needs to be sent from a player.

Examples:

message "A wild %player% appeared!"
message "This message is a distraction. Mwahaha!"
send "Your kill streak is %{kill streak::%uuid of player%}%." to player
if the targeted entity exists:
    message "You're currently looking at a %type of the targeted entity%!"
on chat:
    cancel event
    send "[%player%] >> %message%" to all players from player

Open Book

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.14.2+
Opens a written book to a player.

Examples:

open book player's tool to player

Open/Close Inventory

🔗

Effect

Patterns:
  • (open|show) (((crafting [table]|workbench)|chest|anvil|hopper|dropper|dispenser) [(view|window|inventory)]|%inventory/inventory type%) (to|for) %players%
  • close [the] inventory [view] (to|of|for) %players%
  • close %players%'[s] inventory [view]
Since: 2.0, 2.1.1 (closing), 2.2-Fixes-V10 (anvil), 2.4 (hopper, dropper, dispenser
Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that he just opened. Please note that currently 'show' and 'open' have the same effect, but 'show' will eventually show an unmodifiable view of the inventory in the future.

Examples:

show the victim's inventory to the player
open the player's inventory for the player

Pathfind

🔗

Effect

Patterns:
Since: INSERT VERSION
Requirements: Paper
Make an entity pathfind towards a location or another entity. Not all entities can pathfind. If the pathfinding target is another entity, the entities may or may not continuously follow the target.

Examples:

make all creepers pathfind towards player
make all cows stop pathfinding
make event-entity pathfind towards player at speed 1

Play Effect

🔗

Effect

Patterns:
Since: 2.1
Plays a visual effect at a given location or on a given entity. Please note that some effects can only be played on entities, e.g. wolf hearts or the hurt effect, and that these are always visible to all players.

Examples:

play wolf hearts on the clicked wolf
show mob spawner flames at the targeted block to the player

Play Sound

🔗

Effect

Patterns:
Since: 2.2-dev28, 2.4 (sound categories)
Requirements: Minecraft 1.11+ (sound categories)
Plays a sound at given location for everyone or just for given players, or plays a sound to specified players. Both Minecraft sound names and Spigot sound names are supported. Playing resource pack sounds are supported too. The sound category is 'master' by default.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

play sound "block.note_block.pling" # It is block.note.pling in 1.12.2
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
play sound "custom.music.1" in jukebox category at {speakerBlock}

Player Info Visibility

🔗

Effect

Patterns:
  • hide [all] player [related] info[rmation] [(in|on|from) [the] server list]
  • (show|reveal) [all] player [related] info[rmation] [(in|to|on|from) [the] server list]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Sets whether all player related information is hidden in the server list. The Vanilla Minecraft client will display ??? (dark gray) instead of player counts and will not show the hover hist when hiding player info. The version string can override the ???. Also the Online Players Count and Max Players expressions will return -1 when hiding player info.

Examples:

hide player info
hide player related information in the server list
reveal all player related info

Player Visibility

🔗

Effect

Patterns:
Since: 2.3
Change visibility of a player for the given players. When reveal is used in combination of the hidden players expression and the viewers are not specified, this will default it to the given player in the hidden players expression.

Note: if a player was hidden and relogs, this player will be visible again.

Examples:

on join:
    if {vanished::%player's uuid%} is true:
        hide the player from all players

reveal hidden players of {_player}

Poison/Cure

🔗

Effect

Patterns:
Since: 1.3.2
Poison or cure a creature.

Examples:

poison the player
poison the victim for 20 seconds
cure the player from poison

Potion Effects

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev27 (ambient and particle-less potion effects), 2.5 (replacing existing effect), 2.5.2 (potion effects)
Apply or remove potion effects to/from entities.

Examples:

apply swiftness 2 to the player
remove haste from the victim
on join:
    apply potion of strength of tier {strength.%player%} to the player for 999 days
apply potion effects of player's tool to player

Push

🔗

Effect

Patterns:
Since: 1.4.6
Push entities around.

Examples:

push the player upwards
push the victim downwards at speed 0.5

PvP

🔗

Effect

Patterns:
Since: 1.3.4
Set the PvP state for a given world.

Examples:

enable PvP #(current world only)
disable PvP in all worlds

Replace

🔗

Effect

Patterns:
Since: 2.0, 2.2-dev24 (replace in multiple strings and replace items in inventory), 2.5 (replace first, case sensitivity)
Replaces all occurrences of a given text with another text. Please note that you can only change variables and a few expressions, e.g. a message or a line of a sign.

Examples:

replace "" in {textvar} with "%item%"
replace every "&" with "§" in line 1
# The following acts as a simple chat censor, but it will e.g. censor mass, hassle, assassin, etc. as well:
on chat:
    replace all "kys", "idiot" and "noob" with "****" in the message

replace all stone and dirt in player's inventory and player's top inventory with diamond

Return

🔗

Effect

Patterns:
Since: 2.2
Makes a function return a value

Examples:

function double(i: number) :: number:
    return 2 * {_i}

Send Block Change

🔗

Effect

Patterns:
Since: 2.2-dev37c, 2.5.1 (block data support)
Makes a player see a block as something it really isn't. BlockData support is only for MC 1.13+

Examples:

make player see block at player as dirt
make player see target block as campfire[facing=south]

Send Resource Pack

🔗

Effect

Patterns:
  • send [the] resource pack [from [[the] URL]] %text% to %players%
  • send [the] resource pack [from [[the] URL]] %text% with hash %text% to %players%
Since: 2.4
Request that the player's client download and switch resource packs. The client will download the resource pack in the background, and will automatically switch to it once the download is complete. The URL must be a direct download link.

The hash is used for caching, the player won't have to re-download the resource pack that way. The hash must be SHA-1, you can get SHA-1 hash of your resource pack using this online tool.

The resource pack request action can be used to check status of the sent resource pack request.

Examples:

on join:
    send the resource pack from "URL" with hash "hash" to the player

Shear

🔗

Effect

Patterns:
Since: 2.0
Shears or 'un-shears' a sheep. Please note that no wool is dropped, this only sets the 'sheared' state of the sheep.

Examples:

on rightclick on a sheep holding a sword:
    shear the clicked sheep

Shoot

🔗

Effect

Patterns:
Since: 1.4
Shoots a projectile (or any other entity) from a given entity.

Examples:

shoot an arrow
make the player shoot a creeper at speed 10
shoot a pig from the creeper

Silence Entity

🔗

Effect

Patterns:
Since: 2.5
Controls whether or not an entity is silent.

Examples:

make target entity silent

Stop Server

🔗

Effect

Patterns:
  • (stop|shut[ ]down) [the] server
  • restart [the] server
Since: 2.5
Stops or restarts the server. If restart is used when the restart-script spigot.yml option isn't defined, the server will stop instead.

Examples:

stop the server
restart server

Stop Sound

🔗

Effect

Patterns:
Since: 2.4
Requirements: Minecraft 1.10.2+, Minecraft 1.11+ (sound categories)
Stops a sound from playing to the specified players. Both Minecraft sound names and Spigot sound names are supported. Resource pack sounds are supported too. The sound category is 'master' by default. A sound can't be stopped from a different category.

Please note that sound names can get changed in any Minecraft or Spigot version, or even removed from Minecraft itself.

Examples:

stop sound "block.chest.open" for the player
stop playing sounds "ambient.underwater.loop" and "ambient.underwater.loop.additions" to the player

Swing Hand

🔗

Effect

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15.2+
Makes an entity swing their hand. This does nothing if the entity does not have an animation for swinging their hand.

Examples:

make player swing their main hand

Teleport

🔗

Effect

Patterns:
Since: 1.0
Teleport an entity to a specific location. This effect is delayed by default on Paper, meaning certain syntax such as the return effect for functions cannot be used after this effect. The keyword 'force' indicates this effect will not be delayed, which may cause lag spikes or server crashes when using this effect to teleport entities to unloaded chunks.

Examples:

teleport the player to {homes.%player%}
teleport the attacker to the victim

Title - Reset

🔗

Effect

Patterns:
  • reset [the] title[s] [of %players%]
  • reset [the] %players%'[s] title[s]
Since: 2.3
Resets the title of the player to the default values.

Examples:

reset the titles of all players
reset the title

Title - Send

🔗

Effect

Patterns:
Since: 2.3
Sends a title/subtitle to the given player(s) with optional fadein/stay/fadeout times for Minecraft versions 1.11 and above.

If you're sending only the subtitle, it will be shown only if there's a title displayed at the moment, otherwise it will be sent with the next title. To show only the subtitle, use: send title " " with subtitle "yourtexthere" to player.

Note: if no input is given for the times, it will keep the ones from the last title sent, use the reset title effect to restore the default values.

Examples:

send title "Competition Started" with subtitle "Have fun, Stay safe!" to player for 5 seconds
send title "Hi %player%" to player
send title "Loot Drop" with subtitle "starts in 3 minutes" to all players
send title "Hello %player%!" with subtitle "Welcome to our server" to player for 5 seconds with fadein 1 second and fade out 1 second
send subtitle "Party!" to all players

Toggle

🔗

Effect

Patterns:
  • (close|turn off|de[-]activate) %blocks%
  • (toggle|switch) [[the] state of] %blocks%
  • (open|turn on|activate) %blocks%
Since: 1.4
Toggle the state of a block.

Examples:

# use arrows to toggle switches, doors, etc.
on projectile hit:
    projectile is arrow
    toggle the block at the arrow

Toggle Flight

🔗

Effect

Patterns:
  • (allow|enable) (fly|flight) (for|to) %players%
  • (disallow|disable) (fly|flight) (for|to) %players%
Since: 2.3
Toggle the flight mode of a player.

Examples:

allow flight to event-player

Tree

🔗

Effect

Patterns:
Since: 1.0
Creates a tree. This may require that there is enough space above the given location and that the block below is dirt/grass, but it is possible that the tree will just grow anyways, possibly replacing every block in its path.

Examples:

grow a tall redwood tree above the clicked block

Vectors - Rotate Around Vector

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around another vector

Examples:

rotate {_v} around vector 1, 0, 0 by 90

Vectors - Rotate around XYZ

🔗

Effect

Patterns:
Since: 2.2-dev28
Rotates a vector around x, y, or z axis by some degrees

Examples:

rotate {_v} around x-axis by 90
rotate {_v} around y-axis by 90
rotate {_v} around z-axis by 90 degrees

Vehicle

🔗

Effect

Patterns:
  • (make|let|force) %entities% [to] (ride|mount) [(in|on)] %entities/entity types%
  • (make|let|force) %entities% [to] (dismount|(dismount|leave) [(from|of)] [(any|the[ir]|his|her)] vehicle[s])
  • (eject|dismount) [(any|the)] passenger[s] (of|from) %entities%
Since: 2.0
Makes an entity ride another entity, e.g. a minecart, a saddled pig, an arrow, etc.

Examples:

make the player ride a saddled pig
make the attacker ride the victim

op/deop

🔗

Effect

Patterns:
Since: 1.0
Grant/revoke a user operator state.

Examples:

op the player
deop all players

Spawn

🔗

EffectSection

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""
\ No newline at end of file diff --git a/events.html b/events.html index 7a20a13ec74..ece017a711b 100644 --- a/events.html +++ b/events.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Events

At Time

🔗

Event

Patterns:
Since: 1.3.4
An event that occurs at a given minecraft time in every world or only in specific worlds.

Examples:

at 18:00
at 7am in "world"

On AoE Cloud Effect

🔗

Event

Patterns:
  • [on] (area|AoE) [cloud] effect
Since: 2.2-dev21
Called when area effect cloud applies its potion effect. This happens every 5 ticks by default.

Examples:

on area cloud effect:

On Arm Swing

🔗

Event

Patterns:
  • [on] [player] arm swing
Since: 2.5.1
Called when a player swings his arm.

Examples:

on arm swing:
    send "You swung your arm!"

On Armor Change

🔗

Event

Patterns:
  • [on] [player] armor change[d]
Since: 2.5
Requirements: Paper
Called when armor pieces of a player are changed.

Examples:

on armor change:
    send "You equipped %event-item%!"

On Bed Enter

🔗

Event

Patterns:
  • [on] bed enter[ing]
  • [on] [player] enter[ing] [a] bed
Since: 1.0
Called when a player starts sleeping.

Examples:

on bed enter:

On Bed Leave

🔗

Event

Patterns:
  • [on] bed leav(e|ing)
  • [on] [player] leav(e|ing) [a] bed
Since: 1.0
Called when a player leaves a bed.

Examples:

on player leaving a bed:

On Block Damage

🔗

Event

Patterns:
  • [on] block damag(ing|e)
Since: 1.0
Called when a player starts to break a block. You can usually just use the leftclick event for this.

Examples:

on block damaging:
    if block is log:
        send "You can't break the holy log!"

On Block Fertilize

🔗

Event

Patterns:
  • [on] [block] fertilize
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a player fertilizes blocks.

Examples:

on block fertilize:
    send "Fertilized %size of fertilized blocks% blocks got fertilized."

On Block Growth

🔗

Event

Patterns:
  • [on] (plant|crop|block) grow[(th|ing)] [[of] %item types%]
Since: 2.2-Fixes-V10
Called when a crop grows. Alternative to new form of generic grow event.

Examples:

on crop growth:

On Book Edit

🔗

Event

Patterns:
  • [on] book (edit|change|write)
Since: 2.2-dev31
Called when a player edits a book.

Examples:

on book edit:

On Book Sign

🔗

Event

Patterns:
  • [on] book sign[ing]
Since: 2.2-dev31
Called when a player signs a book.

Examples:

on book sign:

On Break / Mine

🔗

Event

Patterns:
Since: 1.0 (break), unknown (mine), 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.

Examples:

on mine:
on break of stone:
on mine of any ore:
on break of chest[facing=north]:
on break of potatoes[age=7]:

On Bucket Empty

🔗

Event

Patterns:
  • [on] bucket empty[ing]
  • [on] [player] empty[ing] [a] bucket
Since: 1.0
Called when a player empties a bucket. You can also use the place event with a check for water or lava.

Examples:

on bucket empty:

On Bucket fill

🔗

Event

Patterns:
  • [on] bucket fill[ing]
  • [on] [player] fill[ing] [a] bucket
Since: 1.0
Called when a player fills a bucket.

Examples:

on player filling a bucket:

On Burn

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is destroyed by fire.

Examples:

on burn:
on burn of wood, fences, or chests:
on burn of oak_log[axis=y]:

On Can Build Check

🔗

Event

Patterns:
  • [on] [block] can build check
Since: 1.0 (basic), 2.0 ([un]cancellable)
Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it. Please note that the data value of the block to be placed is not available in this event, only its ID.

Examples:

on block can build check:
    cancel event

On Chat

🔗

Event

Patterns:
  • [on] chat
Since: 1.4.1
Called whenever a player chats. Use chat format to change message format, use chat recipients to edit chat recipients.

Examples:

on chat:
    if player has permission "owner":
        set chat format to "<red>[player]<light gray>: <light red>[message]"
    else if player has permission "admin":
        set chat format to "<light red>[player]<light gray>: <orange>[message]"
    else: #default message format
        set chat format to "<orange>[player]<light gray>: <white>[message]"

On Chunk Generate

🔗

Event

Patterns:
  • [on] chunk (generat|populat)(e|ing)
Since: 1.0
Called after a new chunk was generated.

Examples:

on chunk generate:

On Chunk Load

🔗

Event

Patterns:
  • [on] chunk load[ing]
Since: 1.0
Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.

Examples:

on chunk load:

On Chunk Unload

🔗

Event

Patterns:
  • [on] chunk unload[ing]
Since: 1.0
Called when a chunk is unloaded due to not being near any player.

Examples:

on chunk unload:

On Click

🔗

Event

Patterns:
Since: 1.0
Called when a user clicks on a block, an entity or air with or without an item in their hand. Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them. Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.

Examples:

on click:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:

On Combust

🔗

Event

Patterns:
  • [on] combust[ing]
Since: 1.0
Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).

Examples:

on combust:

On Command

🔗

Event

Patterns:
  • [on] command [%text%]
Since: 2.0
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.

Examples:

on command:
on command "/stop":
on command "pm Njol ":

On Connect

🔗

Event

Patterns:
  • [on] [player] connect[ing]
Since: 2.0
Called when the player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over on join.

Examples:

on connect:
    player doesn't have permission "VIP"
    number of players is greater than 15
    kick the player due to "The last 5 slots are reserved for VIP players."

On Consume

🔗

Event

Patterns:
  • [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%]
Since: 2.0
Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.

Examples:

on consume:

On Craft

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a player crafts an item.

Examples:

on craft:

On Creeper Power

🔗

Event

Patterns:
  • [on] creeper power
Since: 1.0
Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.

Examples:

on creeper power:

On Damage

🔗

Event

Patterns:
Since: 1.0, INSERT VERSION (by entity)
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.

Examples:

on damage:
on damage of a player:
on damage of player by zombie:

On Death

🔗

Event

Patterns:
Since: 1.0
Called when a living entity (including players) dies.

Examples:

on death:
on death of player:
on death of a wither or ender dragon:
    broadcast "A %entity% has been slain in %world%!"

On Dispense

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a dispenser dispenses an item.

Examples:

on dispense of iron block:
    send "that'd be 19.99 please!"

On Drop

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called when a player drops an item from their inventory.

Examples:

on drop:

On Enchant

🔗

Event

Patterns:
  • [on] [item] enchant
Since: 2.5
Called when a player successfully enchants an item. To get the enchanted item, see the enchant item expression

Examples:

on enchant:
    if the clicked button is 1: # offer 1
        set the applied enchantments to sharpness 10 and unbreaking 10

On Enchant Prepare

🔗

Event

Patterns:
  • [on] [item] enchant prepare
Since: 2.5
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

On Enderman/Sheep/Silverfish/Falling Block

🔗

Event

Patterns:
  • [on] enderman place
  • [on] enderman pickup
  • [on] sheep eat
  • [on] silverfish enter
  • [on] silverfish exit
  • [on] falling block land[ing]
Since: unknown, 2.5.2 (falling block)
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively.

Examples:

on sheep eat:
    kill entity
    broadcast "A sheep stole some grass!"
on falling block land:
    if event-entity is a falling dirt:
        cancel event

On Entity Dismount

🔗

Event

Patterns:
  • [on] dismount[ing]
Since: 2.2-dev13b
Called when an entity dismounts.

Examples:

on dismount:
    kill event-entity

On Entity Mount

🔗

Event

Patterns:
  • [on] mount[ing]
Since: 2.2-dev13b
Called when entity starts riding another.

Examples:

on mount:
    cancel event

On Entity Portal

🔗

Event

Patterns:
  • [on] entity portal
Since: 2.5.3
Called when an entity uses a nether or end portal. Cancel the event to prevent the entity from teleporting.

Examples:

on entity portal:
    broadcast "A %type of event-entity% has entered a portal!

On Experience Spawn

🔗

Event

Patterns:
  • [on] [e]xp[erience] [orb] spawn
  • [on] spawn of [a[n]] [e]xp[erience] [orb]
Since: 2.0
Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event. Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)

Examples:

on xp spawn:
    world is "minigame_world"
    cancel event

On Explode

🔗

Event

Patterns:
  • [on] explo(d(e|ing)|sion)
Since: 1.0
Called when an entity (a primed TNT or a creeper) explodes.

Examples:

on explosion:

On Explosion Prime

🔗

Event

Patterns:
  • [on] explosion prime
Since: 1.0
Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.

Examples:

on explosion prime:

On Fade

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block 'fades away', e.g. ice or snow melts.

Examples:

on fade of snow or ice:
on fade of snow[layers=2]

On Firework Explode

🔗

Event

Patterns:
  • [on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%]
Since: 2.4
Called when a firework explodes.

Examples:

on firework explode
on firework exploding colored red, light green and black
on firework explosion colored light green:
    broadcast "A firework colored %colors% was exploded at %location%!"

On First Join

🔗

Event

Patterns:
  • [on] first (join|login)
Since: 1.3.7
Called when a player joins the server for the first time.

Examples:

on first join:
    broadcast "Welcome %player% to the server!"

On Fishing

🔗

Event

Patterns:
  • [on] [player] fish[ing]
Since: 1.0
Called when a player fishes something. This is not of much use yet.

Examples:

on fish:

On Flight Toggle

🔗

Event

Patterns:
  • [on] [player] flight toggl(e|ing)
  • [on] [player] toggl(e|ing) flight
Since: 2.2-dev36
Called when a players stops/starts flying.

Examples:

on flight toggle:
    if {game::%player%::playing} exists:
        cancel event

On Flow

🔗

Event

Patterns:
  • [on] [block] flow[ing]
  • [on] block mov(e|ing)
Since: 1.0
Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.

Examples:

on block flow:
    if event-block is water:
        broadcast "Build more dams! It's starting to get wet in here"

On Form

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).

Examples:

on form of snow:
on form of a mushroom:

On Fuel Burn

🔗

Event

Patterns:
  • [on] fuel burn[ing]
Since: 1.0
Called when a furnace burns an item from its fuel slot.

Examples:

on fuel burning:

On Gamemode Change

🔗

Event

Patterns:
  • [on] game[ ]mode change [to %gamemode%]
Since: 1.0
Called when a player's gamemode changes.

Examples:

on gamemode change:
on gamemode change to adventure:

On Gliding State Change

🔗

Event

Patterns:
  • [on] (gliding state change|toggl(e|ing) gliding)
Since: 2.2-dev21
Called when an entity toggles glider on or off, or when server toggles gliding state of an entity forcibly.

Examples:

on toggling gliding:
    cancel the event # bad idea, but you CAN do it!

On Grow

🔗

Event

Patterns:
Since: 1.0 (2.2-dev20 for plants)
Called when a tree, giant mushroom or plant grows to next stage.

Examples:

on grow:
on grow of a tree:
on grow of a huge jungle tree:

On Hand Item Swap

🔗

Event

Patterns:
  • [on] swap[ping of] [(hand|held)] item[s]
Since: 2.3
Called whenever a player swaps the items in their main- and offhand slots. Works also when one or both of the slots are empty. The event is called before the items are actually swapped, so when you use the player's tool or player's offtool expressions, they will return the values before the swap - this enables you to cancel the event before anything happens.

Examples:

on swap hand items:
    event-player's tool is a diamond sword
    cancel event

On Heal

🔗

Event

Patterns:
  • [on] heal[ing]
Since: 1.0
Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).

Examples:

on heal:

On Horse Jump

🔗

Event

Patterns:
  • [on] horse jump
Since: 2.5.1
Called when a horse jumps.

Examples:

on horse jump:
    push event-entity upwards at speed 2

On Hunger Meter Change

🔗

Event

Patterns:
  • [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing)
Since: 1.4.4
Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.

Examples:

on food bar change:

On Ignition

🔗

Event

Patterns:
  • [on] [block] ignit(e|ion)
Since: 1.0
Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable. The burn event will be called when the block is about do be destroyed by the fire.

Examples:

on block ignite:
    if event-block is a ladder:
        cancel event

On Inventory Click

🔗

Event

Patterns:
  • [on] [player] inventory(-| )click[ing] [[at] %item types%]
Since: 2.2-Fixes-V10
Called when clicking on inventory slot.

Examples:

on inventory click:
    if event-item is stone:
        give player 1 stone
        remove 20$ from player's balance

On Inventory Close

🔗

Event

Patterns:
  • [on] inventory clos(ing|e[d])
Since: 2.2-dev21
Called when player's currently viewed inventory is closed.

Examples:

on inventory close:
    if player's location is {location}:
        send "You exited the shop!"

On Inventory Open

🔗

Event

Patterns:
  • [on] inventory open[ed]
Since: 2.2-dev21
Called when an inventory is opened for player.

Examples:

on inventory open:
    close player's inventory

On Inventory Pickup

🔗

Event

Patterns:
  • [on] inventory pick[ ]up
Since: 2.5.1
Called when an inventory (a hopper, a hopper minecart, etc.) picks up an item

Examples:

on inventory pickup:

On Item Break

🔗

Event

Patterns:
  • [on] [player] tool break[ing]
  • [on] [player] break[ing] [(a|the)] tool
Since: 2.1.1
Called when a player breaks their tool because its damage reached the maximum value. This event cannot be cancelled.

Examples:

on tool break:

On Item Damage

🔗

Event

Patterns:
  • [on] item damag(e|ing)
Since: 2.5
Called when an item is damaged. Most tools are damaged by using them; armor is damaged when the wearer takes damage.

Examples:

on item damage:
    cancel event

On Item Despawn

🔗

Event

Patterns:
  • [on] (item[ ][stack]|[item] %item types%) despawn[ing]
  • [on] [item[ ][stack]] despawn[ing] [[of] %item types%]
Since: 2.2-dev35
Called when an item is about to be despawned from the world, usually 5 minutes after it was dropped.

Examples:

on item despawn of diamond:
    send "Not my precious!"
    cancel event

On Item Mend

🔗

Event

Patterns:
  • [on] item mend[ing]
Since: 2.5.1
Requirements: Minecraft 1.13 or newer
Called when a player has an item repaired via the Mending enchantment.

Examples:

on item mend:
    chance of 50%:
        cancel the event
        send "Oops! Mending failed!" to player

On Item Merge

🔗

Event

Patterns:
  • [on] (item[ ][stack]|[item] %item types%) merg(e|ing)
  • [on] item[ ][stack] merg(e|ing) [[of] %item types%]
Since: 2.2-dev35
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.

Examples:

on item merge of gold blocks:
    cancel event

On Item Spawn

🔗

Event

Patterns:
Since: unknown (before 2.1)
Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of their inventory, or a dispenser dispensing an item (not shooting it).

Examples:

on item spawn of iron sword:
    broadcast "Someone dropped an iron sword!"

On Join

🔗

Event

Patterns:
  • [on] [player] (login|logging in|join[ing])
Since: 1.0
Called when the player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer on connect over this event.

Examples:

on join:
    message "Welcome on our awesome server!"
    broadcast "%player% just joined the server!"

On Jump

🔗

Event

Patterns:
  • [on] [player] jump[ing]
Since: 2.3
Called whenever a player jumps. This event requires PaperSpigot.

Examples:

on jump:
    event-player does not have permission "jump"
    cancel event

On Kick

🔗

Event

Patterns:
  • [on] [player] (kick|being kicked)
Since: 1.0
Called when a player is kicked from the server. You can change the kick message or cancel the event entirely.

Examples:

on kick:

On Language Change

🔗

Event

Patterns:
  • [on] [player] (language|locale) chang(e|ing)
  • [on] [player] chang(e|ing) (language|locale)
Since: 2.3
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.

Examples:

on language change:
    if player's language starts with "en":
        send "Hello!"

On Leaves Decay

🔗

Event

Patterns:
  • [on] leaves decay[ing]
Since: 1.0
Called when a leaf block decays due to not being connected to a tree.

Examples:

on leaves decay:

On Level Change

🔗

Event

Patterns:
  • [on] [player] level (change|up|down)
Since: 1.0, 2.4 (level up/down)
Called when a player's level changes, e.g. by gathering experience or by enchanting something.

Examples:

on level change:

On Lightning Strike

🔗

Event

Patterns:
  • [on] lightning [strike]
Since: 1.0
Called when lightning strikes.

Examples:

on lightning:
    spawn a zombie at location of event-entity

On Move

🔗

Event

Patterns:
Since: 2.6
Requirements: Paper 1.16.5+ (entity move)
Called when a player or entity moves. NOTE: Move event will only be called when the entity/player moves position, not orientation (ie: looking around). NOTE: These events can be performance heavy as they are called quite often. If you use these events, and later remove them, a server restart is recommended to clear registered events from Skript.

Examples:

on player move:
    if player does not have permission "player.can.move":
        cancel event
on skeleton move:
    if event-entity is not in world "world":
        kill event-entity

On Move On

🔗

Event

Patterns:
Since: 2.0
Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.

Examples:

on walking on dirt or grass:
on stepping on stone:

On Physics

🔗

Event

Patterns:
  • [on] [block] physics
Since: 1.4.6
Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.Please note that using this event might cause quite some lag since it gets called extremely often.

Examples:

# prevents sand from falling
on block physics:
    block is sand
    cancel event

On Pick Up

🔗

Event

Patterns:
  • [on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%]
Since: unknown (before 2.1), 2.5 (entity)
Requirements: 1.12.2+ for entity
Called when a player/entity picks up an item. Please note that the item is still on the ground when this event is called.

Examples:

on pick up:
on entity pickup of wheat:

On Pig Zap

🔗

Event

Patterns:
  • [on] pig[ ]zap
Since: 1.0
Called when a pig is stroke by lightning and transformed into a zombie pigman. Cancel the event to prevent the transformation.

Examples:

on pig zap:

On Piston Extend

🔗

Event

Patterns:
  • [on] piston extend[ing]
Since: 1.0
Called when a piston is about to extend.

Examples:

on piston extend:
    broadcast "A piston is extending!"

On Piston Retract

🔗

Event

Patterns:
  • [on] piston retract[ing]
Since: 1.0
Called when a piston is about to retract.

Examples:

on piston retract:
    broadcast "A piston is retracting!"

On Place

🔗

Event

Patterns:
Since: 1.0, 2.6 (BlockData support)
Requirements: Minecraft 1.13+ (BlockData)
Called when a player places a block.

Examples:

on place:
on place of a furnace, workbench or chest:
on place of chest[type=right] or chest[type=left]

On Player World Change

🔗

Event

Patterns:
  • [on] [player] world chang(ing|e[d])
Since: 2.2-dev28
Called when a player enters a world. Does not work with other entities!

Examples:

on player world change:
    world is "city"
    send "Welcome to the City!"

On Portal

🔗

Event

Patterns:
  • [on] [player] portal
Since: 1.0
Called when a player uses a nether or end portal. Cancel the event to prevent the player from teleporting.

Examples:

on player portal:

On Portal Create

🔗

Event

Patterns:
  • [on] portal creat(e|ion)
Since: 1.0, 2.5.3 (event-entity support)
Requirements: Minecraft 1.14+ (event-entity support)
Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld. In Minecraft 1.14+, you can use the player in this event. Please note that there may not always be a player (or other entity) in this event.

Examples:

on portal create:

On Portal Enter

🔗

Event

Patterns:
  • [on] portal enter[ing]
  • [on] entering [a] portal
Since: 1.0
Called when an entity enters a nether portal or an end portal. Please note that this event will be fired many times for a nether portal.

Examples:

on portal enter:

On Prepare Craft

🔗

Event

Patterns:
  • [on] [player] (preparing|beginning) craft[ing] [[of] %item types%]
Since: 2.2-Fixes-V10
Called just before displaying crafting result to player. Note that setting the result item might or might not work due to Bukkit bugs.

Examples:

on preparing craft of torch:

On Pressure Plate / Trip

🔗

Event

Patterns:
  • [on] [step[ping] on] [a] [pressure] plate
  • [on] (trip|[step[ping] on] [a] tripwire)
Since: 1.0 (pressure plate), 1.4.4 (tripwire)
Called when a player steps on a pressure plate or tripwire respectively.

Examples:

on step on pressure plate:

On Projectile Collide

🔗

Event

Patterns:
  • [on] projectile collide
Since: 2.5
Requirements: Paper
Called when a projectile collides with an entity.

Examples:

on projectile collide:
    teleport shooter of event-projectile to event-entity

On Projectile Hit

🔗

Event

Patterns:
  • [on] projectile hit
Since: 1.0
Called when a projectile hits an entity or a block. Use the damage event with a check for a projectile to be able to use the entity that got hit in the case when the projectile hit a living entity. A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.

Examples:

on projectile hit:
    event-projectile is arrow
    delete event-projectile

On Quit

🔗

Event

Patterns:
  • [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing))
Since: 1.0 (simple disconnection)
Called when a player leaves the server.

Examples:

on quit:
on disconnect:

On Redstone

🔗

Event

Patterns:
  • [on] redstone [current] [chang(e|ing)]
Since: 1.0
Called when the redstone current of a block changes. This event is of not much use yet.

Examples:

on redstone change:
    send "someone is using redstone" to console

On Region Enter/Leave

🔗

Event

Patterns:
  • [on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%)
  • [on] region (enter[ing]|leav(e|ing)|exit[ing])
Since: 2.1
Requirements: Supported regions plugin
Called when a player enters or leaves a region. This event requires a supported regions plugin to be installed.

Examples:

on region exit:
    message "Leaving %region%."

On Resource Pack Request Response

🔗

Event

Patterns:
Since: 2.4
Called when a player takes action on a resource pack request sent via the send resource pack effect. The resource pack condition can be used to check the resource pack state.

This event will be triggered once when the player accepts or declines the resource pack request, and once when the resource pack is successfully installed or failed to download.

Examples:

on resource pack request response:
    if the resource pack was declined or failed to download:

on resource pack deny:
    kick the player due to "You have to install the resource pack to play in this server!"

On Respawn

🔗

Event

Patterns:
  • [on] [player] respawn[ing]
Since: 1.0
Called when a player respawns. You should prefer this event over the death event as the player is technically alive when this event is called.

Examples:

on respawn:

On Resurrect Attempt

🔗

Event

Patterns:
  • [on] [entity] resurrect[ion] [attempt]
Since: 2.2-dev28
Called when an entity dies, always. If they are not holding a totem, this is cancelled - you can, however, uncancel it.

Examples:

on resurrect attempt:
    entity is player
    entity has permission "admin.undying"
    uncancel the event

On Riptide

🔗

Event

Patterns:
  • [on] [use of] riptide [enchant[ment]]
Since: 2.5
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.

Examples:

on riptide:
    send "You are riptiding!"

On Script Load/Unload

🔗

Event

Patterns:
  • [on] [async] [script] (load|init|enable)
  • [on] [async] [script] (unload|stop|disable)
Since: 2.0
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,

Examples:

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

On Server List Ping

🔗

Event

Patterns:
  • [on] server [list] ping
Since: 2.3
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. The IP expression can be used to get the IP adress of the pinger. This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).

Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.

Examples:

on server list ping:
    set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
    set the fake max players count to (online players count + 1)
    set the shown icon to a random server icon out of {server-icons::*}

On Server Start/Stop

🔗

Event

Patterns:
  • [on] (server|skript) (start|load|enable)
  • [on] (server|skript) (stop|unload|disable)
Since: 2.0
Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).

Examples:

on skript start:
on server stop:

On Sheep Regrow Wool

🔗

Event

Patterns:
  • [on] sheep [re]grow[ing] wool
Since: 2.2-dev21
Called when sheep regrows its sheared wool back.

Examples:

on sheep grow wool:
    cancel event

On Shoot

🔗

Event

Patterns:
  • [on] [projectile] shoot
Since: 1.0
Called whenever a projectile is shot. Use the shooter expression to get who shot the projectile.

Examples:

on shoot:
    if projectile is an arrow:
        send "you shot an arrow!" to shooter

On Sign Change

🔗

Event

Patterns:
  • [on] sign (chang[e]|edit)[ing]
  • [on] [player] (chang[e]|edit)[ing] [a] sign
Since: 1.0
As signs are placed empty, this event is called when a player is done editing a sign.

Examples:

on sign change:
    line 2 is empty
    set line 1 to "<red>%line 1%"

On Slime Split

🔗

Event

Patterns:
  • [on] slime split[ting]
Since: 2.2-dev26
Called when a slime splits. Usually this happens when a big slime dies.

Examples:

on slime split:

On Smelt

🔗

Event

Patterns:
  • [on] [ore] smelt[ing]
  • [on] smelt[ing] of ore
Since: 1.0
Called when a furnace smelts an item in its ore slot.

Examples:

on smelt:

On Sneak Toggle

🔗

Event

Patterns:
  • [on] [player] toggl(e|ing) sneak
  • [on] [player] sneak toggl(e|ing)
Since: 1.0
Called when a player starts or stops sneaking. Use is sneaking to get whether the player was sneaking before the event was called.

Examples:

# make players that stop sneaking jump
on sneak toggle:
    player is sneaking
    push the player upwards at speed 0.5

On Spawn

🔗

Event

Patterns:
Since: 1.0, 2.5.1 (non-living entities)
Called when an entity spawns (excluding players).

Examples:

on spawn of a zombie:
on spawn of an ender dragon:
    broadcast "A dragon has been sighted in %world%!"

On Spawn Change

🔗

Event

Patterns:
  • [on] [world] spawn change
Since: 1.0
Called when the spawn point of a world changes.

Examples:

on spawn change:
    broadcast "someone changed the spawn!"

On Sponge Absorb

🔗

Event

Patterns:
  • [on] sponge absorb
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a sponge absorbs blocks.

Examples:

on sponge absorb:
    loop absorbed blocks:
        broadcast "%loop-block% was absorbed by a sponge"!

On Spread

🔗

Event

Patterns:
  • [on] spread[ing]
Since: 1.0
Called when a new block forms as a result of a block that can spread, e.g. water or mushrooms.

Examples:

on spread:

On Sprint Toggle

🔗

Event

Patterns:
  • [on] [player] toggl(e|ing) sprint
  • [on] [player] sprint toggl(e|ing)
Since: 1.0
Called when a player starts or stops sprinting. Use is sprinting to get whether the player was sprinting before the event was called.

Examples:

on sprint toggle:
    player is not sprinting
    send "Run!"

On Swim Toggle

🔗

Event

Patterns:
  • [on] [entity] toggl(e|ing) swim
  • [on] [entity] swim toggl(e|ing)
Since: 2.3
Requirements: 1.13 or newer
Called when an entity swims or stops swimming.

Examples:

on swim toggle:
    event-entity does not have permission "swim"
    cancel event

On Tame

🔗

Event

Patterns:
  • [on] [entity] tam(e|ing)
Since: 1.0
Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.

Examples:

on tame:

On Target

🔗

Event

Patterns:
  • [on] [entity] target
  • [on] [entity] un[-]target
Since: 1.0
Called when a mob starts/stops following/attacking another entity, usually a player.

Examples:

on entity target:
    target is a player

On Teleport

🔗

Event

Patterns:
  • [on] [player] teleport[ing]
Since: 1.0
Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).

Examples:

on teleport:

On Throwing of an Egg

🔗

Event

Patterns:
  • [on] throw[ing] [of] [an] egg
  • [on] [player] egg throw
Since: 1.0
Called when a player throws an egg. You can just use the shoot event in most cases, as this event is intended to support changing the hatched mob and its chance to hatch, but Skript does not yet support that.

Examples:

on throw of an egg:

On Tool Change

🔗

Event

Patterns:
  • [on] [player['s]] (tool|item held|held item) chang(e|ing)
Since: 1.0
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.

Examples:

on player's held item change:

On Vehicle Create

🔗

Event

Patterns:
  • [on] vehicle create
  • [on] creat(e|ing|ion of) [a] vehicle
Since: 1.0
Called when a new vehicle is created, e.g. when a player places a boat or minecart.

Examples:

on vehicle create:

On Vehicle Damage

🔗

Event

Patterns:
  • [on] vehicle damage
  • [on] damag(e|ing) [a] vehicle
Since: 1.0
Called when a vehicle gets damage. Too much damage will destroy the vehicle.

Examples:

on vehicle damage:

On Vehicle Destroy

🔗

Event

Patterns:
  • [on] vehicle destroy
  • [on] destr(oy[ing]|uction of) [a] vehicle
Since: 1.0
Called when a vehicle is destroyed. Any passenger will be ejected and the vehicle might drop some item(s).

Examples:

on vehicle destroy:
    cancel event

On Vehicle Enter

🔗

Event

Patterns:
  • [on] vehicle enter
  • [on] enter[ing] [a] vehicle
Since: 1.0
Called when an entity enters a vehicle, either deliberately (players) or by falling into them (mobs).

Examples:

on vehicle enter:
    entity is a player
    cancel event

On Vehicle Exit

🔗

Event

Patterns:
  • [on] vehicle exit
  • [on] exit[ing] [a] vehicle
Since: 1.0
Called when an entity exits a vehicle.

Examples:

on vehicle exit:
    if event-entity is a spider:
        kill event-entity

On Weather Change

🔗

Event

Patterns:
Since: 1.0
Called when a world's weather changes.

Examples:

on weather change:
on weather change to sunny:

On World Init

🔗

Event

Patterns:
  • [on] world init[ialization]
Since: 1.0
Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds. World management plugins might change the behaviour of this event though.

Examples:

on world init:

On World Load

🔗

Event

Patterns:
  • [on] world load[ing]
Since: 1.0
Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).

Examples:

on world load:
    send "World is loading..." to console

On World Save

🔗

Event

Patterns:
  • [on] world sav(e|ing)
Since: 1.0
Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.

Examples:

on world saving:
    broadcast "World has been saved!"

On World Unload

🔗

Event

Patterns:
  • [on] world unload[ing]
Since: 1.0
Called when a world is unloaded. This event might never be called if you don't have a world management plugin.

Examples:

on world unload:
    cancel event

On Zombie Break Door

🔗

Event

Patterns:
  • [on] zombie break[ing] [a] [wood[en]] door
Since: 1.0
Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.

Examples:

on zombie breaking a wood door:

Periodical

🔗

Event

Patterns:
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days:

Periodical

🔗

Event

Patterns:
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds in "world":
every minecraft hour in "flatworld":
every tick in "world": # can cause lag depending on the code inside the event
every minecraft days in "plots":
\ No newline at end of file + Skript Documentation - 2.6.3

Events

At Time

🔗

Event

Patterns:
  • [on] at %time% [in %worlds%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.3.4
An event that occurs at a given minecraft time in every world or only in specific worlds.

Examples:

at 18:00
at 7am in "world"

On Anvil Damage

🔗

Event

Patterns:
  • [on] [on] anvil damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Requirements: Paper
Called when an anvil is damaged/broken from being used to repair/rename items. Note: this does not include anvil damage from falling.

Examples:

on anvil damage:
    cancel the event

On Anvil Prepare

🔗

Event

Patterns:
  • [on] [on] anvil prepar(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Called when an item is put in a slot for repair by an anvil. Please note that this event is called multiple times in a single item slot move.

Examples:

on anvil prepare:
    event-item is set # result item
    chance of 5%:
        set repair cost to repair cost * 50%
        send "You're LUCKY! You got 50% discount." to player

On AoE Cloud Effect

🔗

Event

Patterns:
  • [on] [on] (area|AoE) [cloud] effect [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when area effect cloud applies its potion effect. This happens every 5 ticks by default.

Examples:

on area cloud effect:

On Arm Swing

🔗

Event

Patterns:
  • [on] [on] [player] arm swing [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when a player swings his arm.

Examples:

on arm swing:
    send "You swung your arm!"

On Armor Change

🔗

Event

Patterns:
  • [on] [on] [player] armor change[d] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Paper
Called when armor pieces of a player are changed.

Examples:

on armor change:
    send "You equipped %event-item%!"

On Bed Enter

🔗

Event

Patterns:
  • [on] [on] bed enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] enter[ing] [a] bed [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts sleeping.

Examples:

on bed enter:

On Bed Leave

🔗

Event

Patterns:
  • [on] [on] bed leav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] leav(e|ing) [a] bed [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player leaves a bed.

Examples:

on player leaving a bed:

On Block Damage

🔗

Event

Patterns:
  • [on] [on] block damag(ing|e) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts to break a block. You can usually just use the leftclick event for this.

Examples:

on block damaging:
    if block is log:
        send "You can't break the holy log!"

On Block Fertilize

🔗

Event

Patterns:
  • [on] [on] [block] fertilize [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a player fertilizes blocks.

Examples:

on block fertilize:
    send "Fertilized %size of fertilized blocks% blocks got fertilized."

On Block Growth

🔗

Event

Patterns:
  • [on] [on] (plant|crop|block) grow[(th|ing)] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called when a crop grows. Alternative to new form of generic grow event.

Examples:

on crop growth:

On Book Edit

🔗

Event

Patterns:
  • [on] [on] book (edit|change|write) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev31
Called when a player edits a book.

Examples:

on book edit:

On Book Sign

🔗

Event

Patterns:
  • [on] [on] book sign[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev31
Called when a player signs a book.

Examples:

on book sign:

On Break / Mine

🔗

Event

Patterns:
  • [on] [on] [block] (break[ing]|min(e|ing)) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (break), unknown (mine), 2.6 (BlockData support)
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.

Examples:

on mine:
on break of stone:
on mine of any ore:
on break of chest[facing=north]:
on break of potatoes[age=7]:

On Bucket Empty

🔗

Event

Patterns:
  • [on] [on] bucket empty[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] empty[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player empties a bucket. You can also use the place event with a check for water or lava.

Examples:

on bucket empty:

On Bucket fill

🔗

Event

Patterns:
  • [on] [on] bucket fill[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] fill[ing] [a] bucket [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player fills a bucket.

Examples:

on player filling a bucket:

On Burn

🔗

Event

Patterns:
  • [on] [on] [block] burn[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block is destroyed by fire.

Examples:

on burn:
on burn of wood, fences, or chests:
on burn of oak_log[axis=y]:

On Can Build Check

🔗

Event

Patterns:
  • [on] [on] [block] can build check [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (basic), 2.0 ([un]cancellable)
Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it. Please note that the data value of the block to be placed is not available in this event, only its ID.

Examples:

on block can build check:
    cancel event

On Chat

🔗

Event

Patterns:
  • [on] [on] chat [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.1
Called whenever a player chats. Use chat format to change message format, use chat recipients to edit chat recipients.

Examples:

on chat:
    if player has permission "owner":
        set chat format to "<red>[player]<light gray>: <light red>[message]"
    else if player has permission "admin":
        set chat format to "<light red>[player]<light gray>: <orange>[message]"
    else: #default message format
        set chat format to "<orange>[player]<light gray>: <white>[message]"

On Chunk Generate

🔗

Event

Patterns:
  • [on] [on] chunk (generat|populat)(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called after a new chunk was generated.

Examples:

on chunk generate:

On Chunk Load

🔗

Event

Patterns:
  • [on] [on] chunk load[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.

Examples:

on chunk load:

On Chunk Unload

🔗

Event

Patterns:
  • [on] [on] chunk unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a chunk is unloaded due to not being near any player.

Examples:

on chunk unload:

On Click

🔗

Event

Patterns:
  • [on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a user clicks on a block, an entity or air with or without an item in their hand. Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them. Also note that a leftclick on an entity is an attack and thus not covered by the 'click' event, but the 'damage' event.

Examples:

on click:
on rightclick holding a fishing rod:
on leftclick on a stone or obsidian:
on rightclick on a creeper:
on click with a sword:

On Combust

🔗

Event

Patterns:
  • [on] [on] combust[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).

Examples:

on combust:

On Command

🔗

Event

Patterns:
  • [on] [on] command [%text%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player enters a command (not necessarily a Skript command) but you can check if command is a skript command, see Is a Skript command condition.

Examples:

on command:
on command "/stop":
on command "pm Njol ":

On Connect

🔗

Event

Patterns:
  • [on] [on] [player] connect[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when the player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over on join.

Examples:

on connect:
    player doesn't have permission "VIP"
    number of players is greater than 15
    kick the player due to "The last 5 slots are reserved for VIP players."

On Consume

🔗

Event

Patterns:
  • [on] [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.

Examples:

on consume:

On Craft

🔗

Event

Patterns:
  • [on] [on] [player] craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a player crafts an item.

Examples:

on craft:

On Creeper Power

🔗

Event

Patterns:
  • [on] [on] creeper power [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.

Examples:

on creeper power:

On Damage

🔗

Event

Patterns:
  • [on] [on] damag(e|ing) [of %entity type%] [by %entity type%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, INSERT VERSION (by entity)
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.

Examples:

on damage:
on damage of a player:
on damage of player by zombie:

On Death

🔗

Event

Patterns:
  • [on] [on] death [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a living entity (including players) dies.

Examples:

on death:
on death of player:
on death of a wither or ender dragon:
    broadcast "A %entity% has been slain in %world%!"

On Dispense

🔗

Event

Patterns:
  • [on] [on] dispens(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a dispenser dispenses an item.

Examples:

on dispense of iron block:
    send "that'd be 19.99 please!"

On Drop

🔗

Event

Patterns:
  • [on] [on] [player] drop[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called when a player drops an item from their inventory.

Examples:

on drop:

On Egg Throw

🔗

Event

Patterns:
  • [on] [on] throw[ing] [of] [an] egg [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] egg throw [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player throws an egg and it lands. You can just use the shoot event in most cases. However, this event allows modification of properties like the hatched entity type and the number of entities to hatch.

Examples:

on throw of an egg:

On Enchant

🔗

Event

Patterns:
  • [on] [on] [item] enchant [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when a player successfully enchants an item. To get the enchanted item, see the enchant item expression

Examples:

on enchant:
    if the clicked button is 1: # offer 1
        set the applied enchantments to sharpness 10 and unbreaking 10

On Enchant Prepare

🔗

Event

Patterns:
  • [on] [on] [item] enchant prepare [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when a player puts an item into enchantment table. This event may be called multiple times. To get the enchant item, see the enchant item expression

Examples:

on enchant prepare:
    set enchant offer 1 to sharpness 1
    set the cost of enchant offer 1 to 10 levels

On Enderman/Sheep/Silverfish/Falling Block

🔗

Event

Patterns:
  • [on] [on] enderman place [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] enderman pickup [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] sheep eat [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] silverfish enter [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] silverfish exit [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] falling block land[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown, 2.5.2 (falling block)
Called when an enderman places or picks up a block, a sheep eats grass, a silverfish boops into/out of a block or a falling block lands and turns into a block respectively.

Examples:

on sheep eat:
    kill entity
    broadcast "A sheep stole some grass!"
on falling block land:
    if event-entity is a falling dirt:
        cancel event

On Entity Dismount

🔗

Event

Patterns:
  • [on] [on] dismount[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev13b
Called when an entity dismounts.

Examples:

on dismount:
    kill event-entity

On Entity Mount

🔗

Event

Patterns:
  • [on] [on] mount[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev13b
Called when entity starts riding another.

Examples:

on mount:
    cancel event

On Entity Portal

🔗

Event

Patterns:
  • [on] [on] entity portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.3
Called when an entity uses a nether or end portal. Cancel the event to prevent the entity from teleporting.

Examples:

on entity portal:
    broadcast "A %type of event-entity% has entered a portal!

On Experience Spawn

🔗

Event

Patterns:
  • [on] [on] [e]xp[erience] [orb] spawn [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] spawn of [a[n]] [e]xp[erience] [orb] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event. Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only change the experience dropped by blocks or entities will be detected without problems though)

Examples:

on xp spawn:
    world is "minigame_world"
    cancel event

On Explode

🔗

Event

Patterns:
  • [on] [on] explo(d(e|ing)|sion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity (a primed TNT or a creeper) explodes.

Examples:

on explosion:

On Explosion Prime

🔗

Event

Patterns:
  • [on] [on] explosion prime [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.

Examples:

on explosion prime:

On Fade

🔗

Event

Patterns:
  • [on] [on] [block] fad(e|ing) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block 'fades away', e.g. ice or snow melts.

Examples:

on fade of snow or ice:
on fade of snow[layers=2]

On Firework Explode

🔗

Event

Patterns:
  • [on] [on] [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.4
Called when a firework explodes.

Examples:

on firework explode
on firework exploding colored red, light green and black
on firework explosion colored light green:
    broadcast "A firework colored %colors% was exploded at %location%!"

On First Join

🔗

Event

Patterns:
  • [on] [on] first (join|login) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.3.7
Called when a player joins the server for the first time.

Examples:

on first join:
    broadcast "Welcome %player% to the server!"

On Fishing

🔗

Event

Patterns:
  • [on] [on] [player] fish[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player fishes something. This is not of much use yet.

Examples:

on fish:

On Flight Toggle

🔗

Event

Patterns:
  • [on] [on] [player] flight toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] toggl(e|ing) flight [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev36
Called when a players stops/starts flying.

Examples:

on flight toggle:
    if {game::%player%::playing} exists:
        cancel event

On Flow

🔗

Event

Patterns:
  • [on] [on] [block] flow[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] block mov(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.

Examples:

on block flow:
    if event-block is water:
        broadcast "Build more dams! It's starting to get wet in here"

On Form

🔗

Event

Patterns:
  • [on] [on] [block] form[ing] [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).

Examples:

on form of snow:
on form of a mushroom:

On Fuel Burn

🔗

Event

Patterns:
  • [on] [on] fuel burn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a furnace burns an item from its fuel slot.

Examples:

on fuel burning:

On Gamemode Change

🔗

Event

Patterns:
  • [on] [on] game[ ]mode change [to %gamemode%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player's gamemode changes.

Examples:

on gamemode change:
on gamemode change to adventure:

On Gliding State Change

🔗

Event

Patterns:
  • [on] [on] (gliding state change|toggl(e|ing) gliding) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when an entity toggles glider on or off, or when server toggles gliding state of an entity forcibly.

Examples:

on toggling gliding:
    cancel the event # bad idea, but you CAN do it!

On Grow

🔗

Event

Patterns:
  • [on] [on] grow [of (%tree type%|%item type%)] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (2.2-dev20 for plants)
Called when a tree, giant mushroom or plant grows to next stage.

Examples:

on grow:
on grow of a tree:
on grow of a huge jungle tree:

On Hand Item Swap

🔗

Event

Patterns:
  • [on] [on] swap[ping of] [(hand|held)] item[s] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called whenever a player swaps the items in their main- and offhand slots. Works also when one or both of the slots are empty. The event is called before the items are actually swapped, so when you use the player's tool or player's offtool expressions, they will return the values before the swap - this enables you to cancel the event before anything happens.

Examples:

on swap hand items:
    event-player's tool is a diamond sword
    cancel event

On Heal

🔗

Event

Patterns:
  • [on] [on] heal[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).

Examples:

on heal:

On Horse Jump

🔗

Event

Patterns:
  • [on] [on] horse jump [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when a horse jumps.

Examples:

on horse jump:
    push event-entity upwards at speed 2

On Hunger Meter Change

🔗

Event

Patterns:
  • [on] [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.4
Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.

Examples:

on food bar change:

On Ignition

🔗

Event

Patterns:
  • [on] [on] [block] ignit(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable. The burn event will be called when the block is about do be destroyed by the fire.

Examples:

on block ignite:
    if event-block is a ladder:
        cancel event

On Inventory Click

🔗

Event

Patterns:
  • [on] [on] [player] inventory(-| )click[ing] [[at] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called when clicking on inventory slot.

Examples:

on inventory click:
    if event-item is stone:
        give player 1 stone
        remove 20$ from player's balance

On Inventory Close

🔗

Event

Patterns:
  • [on] [on] inventory clos(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when player's currently viewed inventory is closed.

Examples:

on inventory close:
    if player's location is {location}:
        send "You exited the shop!"

On Inventory Open

🔗

Event

Patterns:
  • [on] [on] inventory open[ed] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when an inventory is opened for player.

Examples:

on inventory open:
    close player's inventory

On Inventory Pickup

🔗

Event

Patterns:
  • [on] [on] inventory pick[ ]up [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Called when an inventory (a hopper, a hopper minecart, etc.) picks up an item

Examples:

on inventory pickup:

On Item Break

🔗

Event

Patterns:
  • [on] [on] [player] tool break[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] break[ing] [(a|the)] tool [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.1.1
Called when a player breaks their tool because its damage reached the maximum value. This event cannot be cancelled.

Examples:

on tool break:

On Item Damage

🔗

Event

Patterns:
  • [on] [on] item damag(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when an item is damaged. Most tools are damaged by using them; armor is damaged when the wearer takes damage.

Examples:

on item damage:
    cancel event

On Item Despawn

🔗

Event

Patterns:
  • [on] [on] (item[ ][stack]|[item] %item types%) despawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [item[ ][stack]] despawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev35
Called when an item is about to be despawned from the world, usually 5 minutes after it was dropped.

Examples:

on item despawn of diamond:
    send "Not my precious!"
    cancel event

On Item Mend

🔗

Event

Patterns:
  • [on] [on] item mend[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5.1
Requirements: Minecraft 1.13 or newer
Called when a player has an item repaired via the Mending enchantment.

Examples:

on item mend:
    chance of 50%:
        cancel the event
        send "Oops! Mending failed!" to player

On Item Merge

🔗

Event

Patterns:
  • [on] [on] (item[ ][stack]|[item] %item types%) merg(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] item[ ][stack] merg(e|ing) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev35
Called when dropped items merge into a single stack. event-entity will be the entity which is trying to merge, and future event-entity will be the entity which is being merged into.

Examples:

on item merge of gold blocks:
    cancel event

On Item Spawn

🔗

Event

Patterns:
  • [on] [on] item spawn[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1)
Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of their inventory, or a dispenser dispensing an item (not shooting it).

Examples:

on item spawn of iron sword:
    broadcast "Someone dropped an iron sword!"

On Join

🔗

Event

Patterns:
  • [on] [on] [player] (login|logging in|join[ing]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer on connect over this event.

Examples:

on join:
    message "Welcome on our awesome server!"
    broadcast "%player% just joined the server!"

On Jump

🔗

Event

Patterns:
  • [on] [on] [player] jump[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called whenever a player jumps. This event requires PaperSpigot.

Examples:

on jump:
    event-player does not have permission "jump"
    cancel event

On Kick

🔗

Event

Patterns:
  • [on] [on] [player] (kick|being kicked) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player is kicked from the server. You can change the kick message or cancel the event entirely.

Examples:

on kick:

On Language Change

🔗

Event

Patterns:
  • [on] [on] [player] (language|locale) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] chang(e|ing) (language|locale) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called after a player changed their language in the game settings. You can use the language expression to get the current language of the player. This event requires Minecraft 1.12+.

Examples:

on language change:
    if player's language starts with "en":
        send "Hello!"

On Leaves Decay

🔗

Event

Patterns:
  • [on] [on] leaves decay[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a leaf block decays due to not being connected to a tree.

Examples:

on leaves decay:

On Level Change

🔗

Event

Patterns:
  • [on] [on] [player] level (change|up|down) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.4 (level up/down)
Called when a player's level changes, e.g. by gathering experience or by enchanting something.

Examples:

on level change:

On Lightning Strike

🔗

Event

Patterns:
  • [on] [on] lightning [strike] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when lightning strikes.

Examples:

on lightning:
    spawn a zombie at location of event-entity

On Move

🔗

Event

Patterns:
  • [on] [on] %entity type% (move|walk|step) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.6
Requirements: Paper 1.16.5+ (entity move)
Called when a player or entity moves. NOTE: Move event will only be called when the entity/player moves position, not orientation (ie: looking around). NOTE: These events can be performance heavy as they are called quite often. If you use these events, and later remove them, a server restart is recommended to clear registered events from Skript.

Examples:

on player move:
    if player does not have permission "player.can.move":
        cancel event
on skeleton move:
    if event-entity is not in world "world":
        kill event-entity

On Move On

🔗

Event

Patterns:
  • [on] [on] (step|walk)[ing] (on|over) %*item types% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.

Examples:

on walking on dirt or grass:
on stepping on stone:

On Physics

🔗

Event

Patterns:
  • [on] [on] [block] physics [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.4.6
Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.Please note that using this event might cause quite some lag since it gets called extremely often.

Examples:

# prevents sand from falling
on block physics:
    block is sand
    cancel event

On Pick Up

🔗

Event

Patterns:
  • [on] [on] [(player|entity)] (pick[ ]up|picking up) [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: unknown (before 2.1), 2.5 (entity)
Requirements: 1.12.2+ for entity
Called when a player/entity picks up an item. Please note that the item is still on the ground when this event is called.

Examples:

on pick up:
on entity pickup of wheat:

On Pig Zap

🔗

Event

Patterns:
  • [on] [on] pig[ ]zap [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a pig is stroke by lightning and transformed into a zombie pigman. Cancel the event to prevent the transformation.

Examples:

on pig zap:

On Piston Extend

🔗

Event

Patterns:
  • [on] [on] piston extend[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a piston is about to extend.

Examples:

on piston extend:
    broadcast "A piston is extending!"

On Piston Retract

🔗

Event

Patterns:
  • [on] [on] piston retract[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a piston is about to retract.

Examples:

on piston retract:
    broadcast "A piston is retracting!"

On Place

🔗

Event

Patterns:
  • [on] [on] [block] (plac(e|ing)|build[ing]) [[of] %item types/block datas%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.6 (BlockData support)
Called when a player places a block.

Examples:

on place:
on place of a furnace, workbench or chest:
on break of chest[type=right] or chest[type=left]

On Player Trade

🔗

Event

Patterns:
  • [on] [on] player trad(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: INSERT VERSION
Requirements: Paper 1.16.5+
Called when a player has traded with a villager.

Examples:

on player trade:
    chance of 50%:
        cancel event
        send "The trade was somehow denied!" to player

On Player World Change

🔗

Event

Patterns:
  • [on] [on] [player] world chang(ing|e[d]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev28
Called when a player enters a world. Does not work with other entities!

Examples:

on player world change:
    world is "city"
    send "Welcome to the City!"

On Portal

🔗

Event

Patterns:
  • [on] [on] [player] portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player uses a nether or end portal. Cancel the event to prevent the player from teleporting.

Examples:

on player portal:

On Portal Create

🔗

Event

Patterns:
  • [on] [on] portal creat(e|ion) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.5.3 (event-entity support)
Requirements: Minecraft 1.14+ (event-entity support)
Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld. In Minecraft 1.14+, you can use the player in this event. Please note that there may not always be a player (or other entity) in this event.

Examples:

on portal create:

On Portal Enter

🔗

Event

Patterns:
  • [on] [on] portal enter[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] entering [a] portal [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity enters a nether portal or an end portal. Please note that this event will be fired many times for a nether portal.

Examples:

on portal enter:

On Prepare Craft

🔗

Event

Patterns:
  • [on] [on] [player] (preparing|beginning) craft[ing] [[of] %item types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-Fixes-V10
Called just before displaying crafting result to player. Note that setting the result item might or might not work due to Bukkit bugs.

Examples:

on preparing craft of torch:

On Pressure Plate / Trip

🔗

Event

Patterns:
  • [on] [on] [step[ping] on] [a] [pressure] plate [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] (trip|[step[ping] on] [a] tripwire) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (pressure plate), 1.4.4 (tripwire)
Called when a player steps on a pressure plate or tripwire respectively.

Examples:

on step on pressure plate:

On Projectile Collide

🔗

Event

Patterns:
  • [on] [on] projectile collide [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Paper
Called when a projectile collides with an entity.

Examples:

on projectile collide:
    teleport shooter of event-projectile to event-entity

On Projectile Hit

🔗

Event

Patterns:
  • [on] [on] projectile hit [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a projectile hits an entity or a block. Use the damage event with a check for a projectile to be able to use the entity that got hit in the case when the projectile hit a living entity. A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.

Examples:

on projectile hit:
    event-projectile is arrow
    delete event-projectile

On Quit

🔗

Event

Patterns:
  • [on] [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out|leav(e|ing)) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0 (simple disconnection)
Called when a player leaves the server.

Examples:

on quit:
on disconnect:

On Redstone

🔗

Event

Patterns:
  • [on] [on] redstone [current] [chang(e|ing)] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the redstone current of a block changes. This event is of not much use yet.

Examples:

on redstone change:
    send "someone is using redstone" to console

On Region Enter/Leave

🔗

Event

Patterns:
  • [on] [on] (enter[ing]|leav(e|ing)|exit[ing]) [of] ([a] region|[[the] region] %regions%) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] region (enter[ing]|leav(e|ing)|exit[ing]) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.1
Requirements: Supported regions plugin
Called when a player enters or leaves a region. This event requires a supported regions plugin to be installed.

Examples:

on region exit:
    message "Leaving %region%."

On Resource Pack Request Response

🔗

Event

Patterns:
  • [on] [on] resource pack [request] response [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] resource pack [request] %resource pack states% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.4
Called when a player takes action on a resource pack request sent via the send resource pack effect. The resource pack condition can be used to check the resource pack state.

This event will be triggered once when the player accepts or declines the resource pack request, and once when the resource pack is successfully installed or failed to download.

Examples:

on resource pack request response:
    if the resource pack was declined or failed to download:

on resource pack deny:
    kick the player due to "You have to install the resource pack to play in this server!"

On Respawn

🔗

Event

Patterns:
  • [on] [on] [player] respawn[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player respawns. You should prefer this event over the death event as the player is technically alive when this event is called.

Examples:

on respawn:

On Resurrect Attempt

🔗

Event

Patterns:
  • [on] [on] [entity] resurrect[ion] [attempt] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev28
Called when an entity dies, always. If they are not holding a totem, this is cancelled - you can, however, uncancel it.

Examples:

on resurrect attempt:
    entity is player
    entity has permission "admin.undying"
    uncancel the event

On Riptide

🔗

Event

Patterns:
  • [on] [on] [use of] riptide [enchant[ment]] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Called when the player activates the riptide enchantment, using their trident to propel them through the air. Note: the riptide action is performed client side, so manipulating the player in this event may have undesired effects.

Examples:

on riptide:
    send "You are riptiding!"

On Script Load/Unload

🔗

Event

Patterns:
  • [on] [on] [async] [script] (load|init|enable) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [async] [script] (unload|stop|disable) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called directly after the trigger is loaded, or directly before the whole script is unloaded. The keyword 'async' indicates the trigger can be ran asynchronously,

Examples:

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

On Server List Ping

🔗

Event

Patterns:
  • [on] [on] server [list] ping [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Called when a server list ping is coming in, generally when a Minecraft client pings the server to show its information in the server list. The IP expression can be used to get the IP adress of the pinger. This event can be cancelled on PaperSpigot 1.12.2+ only and this means the player will see the server as offline (but still can join).

Also you can use MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List and Server Icon expressions, and Player Info Visibility and Hide Player from Server List effects to modify the server list.

Examples:

on server list ping:
    set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!"
    set the fake max players count to (online players count + 1)
    set the shown icon to a random server icon out of {server-icons::*}

On Server Start/Stop

🔗

Event

Patterns:
  • [on] [on] (server|skript) (start|load|enable) [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] (server|skript) (stop|unload|disable) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.0
Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).

Examples:

on skript start:
on server stop:

On Sheep Regrow Wool

🔗

Event

Patterns:
  • [on] [on] sheep [re]grow[ing] wool [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev21
Called when sheep regrows its sheared wool back.

Examples:

on sheep grow wool:
    cancel event

On Shoot

🔗

Event

Patterns:
  • [on] [on] [projectile] shoot [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a projectile is shot. Use the shooter expression to get who shot the projectile.

Examples:

on shoot:
    if projectile is an arrow:
        send "you shot an arrow!" to shooter

On Sign Change

🔗

Event

Patterns:
  • [on] [on] sign (chang[e]|edit)[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] (chang[e]|edit)[ing] [a] sign [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
As signs are placed empty, this event is called when a player is done editing a sign.

Examples:

on sign change:
    line 2 is empty
    set line 1 to "<red>%line 1%"

On Slime Split

🔗

Event

Patterns:
  • [on] [on] slime split[ting] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.2-dev26
Called when a slime splits. Usually this happens when a big slime dies.

Examples:

on slime split:

On Smelt

🔗

Event

Patterns:
  • [on] [on] [ore] smelt[ing] [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] smelt[ing] of ore [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a furnace smelts an item in its ore slot.

Examples:

on smelt:

On Sneak Toggle

🔗

Event

Patterns:
  • [on] [on] [player] toggl(e|ing) sneak [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] sneak toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts or stops sneaking. Use is sneaking to get whether the player was sneaking before the event was called.

Examples:

# make players that stop sneaking jump
on sneak toggle:
    player is sneaking
    push the player upwards at speed 0.5

On Spawn

🔗

Event

Patterns:
  • [on] [on] spawn[ing] [of %entity types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0, 2.5.1 (non-living entities)
Called when an entity spawns (excluding players).

Examples:

on spawn of a zombie:
on spawn of an ender dragon:
    broadcast "A dragon has been sighted in %world%!"

On Spawn Change

🔗

Event

Patterns:
  • [on] [on] [world] spawn change [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when the spawn point of a world changes.

Examples:

on spawn change:
    broadcast "someone changed the spawn!"

On Sponge Absorb

🔗

Event

Patterns:
  • [on] [on] sponge absorb [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.5
Requirements: Minecraft 1.13 or newer
Called when a sponge absorbs blocks.

Examples:

on sponge absorb:
    loop absorbed blocks:
        broadcast "%loop-block% was absorbed by a sponge"!

On Spread

🔗

Event

Patterns:
  • [on] [on] spread[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a new block forms as a result of a block that can spread, e.g. water or mushrooms.

Examples:

on spread:

On Sprint Toggle

🔗

Event

Patterns:
  • [on] [on] [player] toggl(e|ing) sprint [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [player] sprint toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player starts or stops sprinting. Use is sprinting to get whether the player was sprinting before the event was called.

Examples:

on sprint toggle:
    player is not sprinting
    send "Run!"

On Swim Toggle

🔗

Event

Patterns:
  • [on] [on] [entity] toggl(e|ing) swim [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [entity] swim toggl(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 2.3
Requirements: 1.13 or newer
Called when an entity swims or stops swimming.

Examples:

on swim toggle:
    event-entity does not have permission "swim"
    cancel event

On Tame

🔗

Event

Patterns:
  • [on] [on] [entity] tam(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.

Examples:

on tame:

On Target

🔗

Event

Patterns:
  • [on] [on] [entity] target [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] [entity] un[-]target [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a mob starts/stops following/attacking another entity, usually a player.

Examples:

on entity target:
    target is a player

On Teleport

🔗

Event

Patterns:
  • [on] [on] [player] teleport[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).

Examples:

on teleport:

On Tool Change

🔗

Event

Patterns:
  • [on] [on] [player['s]] (tool|item held|held item) chang(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called whenever a player changes their held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), not by dropping or replacing the item in the current slot.

Examples:

on player's held item change:

On Vehicle Create

🔗

Event

Patterns:
  • [on] [on] vehicle create [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] creat(e|ing|ion of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a new vehicle is created, e.g. when a player places a boat or minecart.

Examples:

on vehicle create:

On Vehicle Damage

🔗

Event

Patterns:
  • [on] [on] vehicle damage [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] damag(e|ing) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a vehicle gets damage. Too much damage will destroy the vehicle.

Examples:

on vehicle damage:

On Vehicle Destroy

🔗

Event

Patterns:
  • [on] [on] vehicle destroy [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] destr(oy[ing]|uction of) [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a vehicle is destroyed. Any passenger will be ejected and the vehicle might drop some item(s).

Examples:

on vehicle destroy:
    cancel event

On Vehicle Enter

🔗

Event

Patterns:
  • [on] [on] vehicle enter [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] enter[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity enters a vehicle, either deliberately (players) or by falling into them (mobs).

Examples:

on vehicle enter:
    entity is a player
    cancel event

On Vehicle Exit

🔗

Event

Patterns:
  • [on] [on] vehicle exit [with priority (lowest|low|normal|high|highest|monitor)]
  • [on] [on] exit[ing] [a] vehicle [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when an entity exits a vehicle.

Examples:

on vehicle exit:
    if event-entity is a spider:
        kill event-entity

On Weather Change

🔗

Event

Patterns:
  • [on] [on] weather change [to %weather types%] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world's weather changes.

Examples:

on weather change:
on weather change to sunny:

On World Init

🔗

Event

Patterns:
  • [on] [on] world init[ialization] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds. World management plugins might change the behaviour of this event though.

Examples:

on world init:

On World Load

🔗

Event

Patterns:
  • [on] [on] world load[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).

Examples:

on world load:
    send "World is loading..." to console

On World Save

🔗

Event

Patterns:
  • [on] [on] world sav(e|ing) [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.

Examples:

on world saving:
    broadcast "World has been saved!"

On World Unload

🔗

Event

Patterns:
  • [on] [on] world unload[ing] [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a world is unloaded. This event might never be called if you don't have a world management plugin.

Examples:

on world unload:
    cancel event

On Zombie Break Door

🔗

Event

Patterns:
  • [on] [on] zombie break[ing] [a] [wood[en]] door [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.

Examples:

on zombie breaking a wood door:

Periodical

🔗

Event

Patterns:
  • [on] every %time span% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds:
every minecraft hour:
every tick: # can cause lag depending on the code inside the event
every minecraft days:

Periodical

🔗

Event

Patterns:
  • [on] every %time span% in [world[s]] %worlds% [with priority (lowest|low|normal|high|highest|monitor)]
Since: 1.0
An event that is called periodically.

Examples:

every 2 seconds in "world":
every minecraft hour in "flatworld":
every tick in "world": # can cause lag depending on the code inside the event
every minecraft days in "plots":
\ No newline at end of file diff --git a/expressions.html b/expressions.html index f3b55094713..7431e87405e 100644 --- a/expressions.html +++ b/expressions.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Expressions

Absorbed blocks

🔗

Expression

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

Examples:

the absorbed blocks

Affected Entities

🔗

Expression

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

Examples:

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

All Groups

🔗

Expression

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

Examples:

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

All Permissions

🔗

Expression

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

Examples:

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

All Scripts

🔗

Expression

Patterns:
  • [all [of the]] scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (enabled|loaded) scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (disabled|unloaded) scripts [(without ([subdirectory] paths|parents))]
Since: 2.5
Return Type: Text
Returns all of the scripts, or just the enabled or disabled ones.

Examples:

command /scripts:
    trigger:
        send "All Scripts: %scripts%" to player
        send "Loaded Scripts: %enabled scripts%" to player
        send "Unloaded Scripts: %disabled scripts%" to player

All commands

🔗

Expression

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

Examples:

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

Alphabetical Sort

🔗

Expression

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

Examples:

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

Altitude

🔗

Expression

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

Examples:

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

Amount

🔗

Expression

Patterns:
  • [the] (amount|number|size) of %objects%
  • [the] recursive (amount|number|size) of %objects%
Since: 1.0
Return Type: long
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.

Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.

 {list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6

Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!

Examples:

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

Amount of Items

🔗

Expression

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

Examples:

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

Applied Enchantments

🔗

Expression

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

Examples:

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

Argument

🔗

Expression

Patterns:
  • [the] last arg[ument][s]
  • [the] arg[ument][s](-| )<(\d+)>
  • [the] <(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th> arg[ument][s]
  • [the] arg[ument][s]
  • [the] %*type%( |-)arg[ument][( |-)<\d+>]
  • [the] arg[ument]( |-)%*type%[( |-)<\d+>]
Since: 1.0
Return Type: Object
Only usable in command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'.

Examples:

give the item-argument to the player-argument
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument

Arithmetic

🔗

Expression

Patterns:
Since: 1.4.2
Return Type: Number
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.

Examples:

set the player's health to 10 - the player's health
loop (argument + 2) / 5 times:
    message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"

Armour Slot

🔗

Expression

Patterns:
  • [the] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)] of %living entities%
  • %living entities%'[s] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)]
Since: 1.0
Return Type: Inventory Slot
A part of a player's armour, i.e. the boots, leggings, chestplate or helmet.

Examples:

set chestplate of the player to a diamond chestplate
helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin

Arrow Knockback Strength

🔗

Expression

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

Examples:

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

Arrows Stuck

🔗

Expression

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

Examples:

set arrows stuck in player to 5

Attack Cooldown

🔗

Expression

Patterns:
Since: 2.6.1
Requirements: Minecraft 1.15+
Return Type: float
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.

Examples:

on damage:
    if attack cooldown of attacker < 1:
        set damage to 0
        send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker

Attacked

🔗

Expression

Patterns:
  • [the] (attacked|damaged|victim) [<(.+)>]
Since: 1.3, 2.6.1 (projectile hit event)
Usable in events: damage, death, projectile hit
Return Type: Entity
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.

Examples:

on damage:
    victim is a creeper
    damage the attacked by 1 heart

Attacker

🔗

Expression

Patterns:
  • [the] (attacker|damager)
Since: 1.3
Usable in events: damage, death, destroy
Return Type: Entity
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.

Examples:

on damage:
    attacker is a player
    health of attacker is less than or equal to 2
    damage victim by 1 heart

Bed

🔗

Expression

Patterns:
  • [the] bed[s] [location[s]] of %players%
  • %players%'[s] bed[s] [location[s]]
Since: 2.0
Return Type: Location
The bed location of a player, i.e. the spawn point of a player if he ever slept in a bed and the bed still exists and is unobstructed.

Examples:

if bed of player exists:
    teleport player the the player's bed
else:
    teleport the player to the world's spawn point

Biome

🔗

Expression

Patterns:
Since: 1.4.4, 2.6.1 (3D biomes)
Return Type: Biome
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).

Examples:

# damage player in deserts constantly
every real minute:
    loop all players:
        biome at loop-player is desert
        damage the loop-player by 1

Block

🔗

Expression

Patterns:
  • [the] [event-]block
Since: 1.0
Return Type: Block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block

🔗

Expression

Patterns:
Since: 1.0
Return Type: Block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block Age

🔗

Expression

Patterns:
  • [the] [max[imum]] age of %block%
  • %block%'[s] [max[imum]] age
Since: INSERT VERSION
Requirements: Minecraft 1.13+
Return Type: integer
Returns the age or max age of a block. '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.

Examples:

set age of targeted block to max age of targeted block

Block Data

🔗

Expression

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

Examples:

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

Block Hardness

🔗

Expression

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

Examples:

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

Block Sphere

🔗

Expression

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

Examples:

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

Blocks

🔗

Expression

Patterns:
Since: 1.0, 2.5.1 (within/cuboid/chunk)
Return Type: Block
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.

Examples:

loop blocks above the player:
loop blocks between the block below the player and the targeted block:
set the blocks below the player, the victim and the targeted block to air
set all blocks within {loc1} and {loc2} to stone
set all blocks within chunk at player to air

Blocks in Region

🔗

Expression

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

Examples:

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

Book Author

🔗

Expression

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

Examples:

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

Book Pages

🔗

Expression

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

Examples:

on book sign:
    message "Book Pages: %pages of event-item%"
    message "Book Page 1: %page 1 of event-item%"

Book Title

🔗

Expression

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

Examples:

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

Burn/Cook Time

🔗

Expression

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

Examples:

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

Case Text

🔗

Expression

Patterns:
  • %texts% in (upper|lower)[ ]case
  • (upper|lower)[ ]case %texts%
  • capitali(s|z)ed %texts%
  • %texts% in [(lenient|strict) ](proper|title)[ ]case
  • [(lenient|strict) ](proper|title)[ ]case %texts%
  • %texts% in [(lenient|strict) ]camel[ ]case
  • [(lenient|strict) ]camel[ ]case %texts%
  • %texts% in [(lenient|strict) ]pascal[ ]case
  • [(lenient|strict) ]pascal[ ]case %texts%
  • %texts% in [(lower|upper|capital|screaming)[ ]]snake[ ]case
  • [(lower|upper|capital|screaming)[ ]]snake[ ]case %texts%
  • %texts% in [(lower|upper|capital)[ ]]kebab[ ]case
  • [(lower|upper|capital)[ ]]kebab[ ]case %texts%
Since: 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases)
Return Type: Text
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case

Examples:

"Oops!" in lowercase # oops!
"oops!" in uppercase # OOPS!
"hellO i'm steve!" in proper case # HellO I'm Steve!
"hellO i'm steve!" in strict proper case # Hello I'm Steve!
"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()
"spAwn neW boSs ()" in strict camel case # spawnNewBoss()
"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()
"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()
"Hello Player!" in snake case # Hello_Player!
"Hello Player!" in lower snake case # hello_player!
"Hello Player!" in upper snake case # HELLO_PLAYER!
"What is your name?" in kebab case # What-is-your-name?
"What is your name?" in lower kebab case # what-is-your-name?
"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?

Chat Format

🔗

Expression

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

Examples:

set the chat format to "<yellow>[player]<light gray>: <green>[message]"

Chat Recipients

🔗

Expression

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

Examples:

chat recipients

Chunk

🔗

Expression

Patterns:
Since: 2.0
Return Type: Chunk
The chunk a block, location or entity is in.

Examples:

add the chunk at the player to {protected chunks::*}

Clicked Block/Entity/Inventory/Slot

🔗

Expression

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

Examples:

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

Color of

🔗

Expression

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

Examples:

on click on wool:
    message "This wool block is <%color of block%>%color of block%!"
    set the color of the block to black

Colored / Uncolored

🔗

Expression

Patterns:
  • (colo[u]r-|colo[u]red )%texts%
  • (format-|formatted )%texts%
  • (un|non)[-](colo[u]r-|colo[u]red |format-|formatted )%texts%
Since: 2.0
Return Type: Text
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.

Examples:

on chat:
    set message to colored message # Safe; only colors get parsed
command /fade <player>:
    trigger:
        set display name of the player-argument to uncolored display name of the player-argument
command /format <text>:
    trigger:
        message formatted text-argument # Safe, because we're sending to whoever used this command

Command

🔗

Expression

Patterns:
  • [the] (full|complete|whole) command
  • [the] command [label]
  • [the] arguments
Since: 2.0
Usable in events: command
Return Type: Text
The command that caused an 'on command' event (excluding the leading slash and all arguments)

Examples:

# prevent any commands except for the /exit command during some game
on command:
    if {game::%player%::playing} is true:
        if the command is not "exit":
            message "You're not allowed to use commands during the game"
            cancel the event

Command Info

🔗

Expression

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

Examples:

main name of command "skript"
description of command "help"
label of command "pl"
usage of command "help"
aliases of command "bukkit:help"
permission of command "/op"
command "op"'s permission message
command "sk"'s plugin owner

Command Sender

🔗

Expression

Patterns:
  • [the] [command['s]] (sender|executor)
Since: 2.0
Usable in events: command
Return Type: Command Sender
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%

Examples:

make the command sender execute "/say hi!"
on command:
    log "%executor% used command /%command% %arguments%" to "commands.log"

Compass Target

🔗

Expression

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

Examples:

# make all player's compasses target a player stored in {compass::target::%player%}
every 5 seconds:
    loop all players:
        set the loop-player's compass target to location of {compass::target::%%loop-player%}

Console

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])
  • [the] last usage [date] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
Since: 2.2-dev33
Return Type: Object
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.

Examples:

command /home:
    cooldown: 10 seconds
    cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
    trigger:
        teleport player to {home::%player%}

Coordinate

🔗

Expression

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

Examples:

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

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

🔗

Expression

Patterns:
  • [the] [event-]<.+>
Since: 1.0
Return Type: Entity
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.

Examples:

give a diamond sword of sharpness 3 to the player
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow

Cursor Slot

🔗

Expression

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

Examples:

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

Custom Chest Inventory

🔗

Expression

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

Examples:

open chest inventory with 1 row named "test" to player
set {_inventory} to chest inventory with 1 row

Custom Model Data

🔗

Expression

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

Examples:

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

Damage

🔗

Expression

Patterns:
  • [the] damage
Since: 1.3.5
Usable in events: damage
Return Type: Number
How much damage is done in a damage event, possibly ignoring armour, criticals and/or enchantments. Can be changed (remember that in Skript '1' is one full heart, not half a heart).

Examples:

increase the damage by 2

Damage Cause

🔗

Expression

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

Examples:

damage cause is lava, fire or burning

Damaged Item

🔗

Expression

Patterns:
Since: 2.4
Return Type: Item Type
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks

Examples:

give player diamond sword with damage value 100
set player's tool to diamond hoe damaged by 250
give player diamond sword with damage 700 named "BROKEN SWORD"
set {_item} to diamond hoe with damage value 50 named "SAD HOE"
set target block of player to wool with data value 1
set target block of player to potato plant with data value 7

Data/Damage Value

🔗

Expression

Patterns:
Since: 1.2
Return Type: long
The data/damage value of an item/block. Data values of blocks are only supported on 1.12.2 and below. You usually don't need this expression as you can check and set items with aliases easily, but this expression can e.g. be used to "add 1 to data of <item>", e.g. for cycling through all wool colors.

Examples:

set damage value of player's tool to 10
set data value of target block of player to 3
add 1 to the data value of the clicked block
reset data value of block at player

Date Ago/Later

🔗

Expression

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

Examples:

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

Default Value

🔗

Expression

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

Examples:

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

Difference

🔗

Expression

Patterns:
Since: 1.4
Return Type: Object
The difference between two values, e.g. numbers, dates or times.

Examples:

if difference between {command::%player%::lastuse} and now is smaller than a minute:
    message "You have to wait a minute before using this command again!"

Difficulty

🔗

Expression

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

Examples:

set the difficulty of "world" to hard

Direction

🔗

Expression

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

Examples:

thrust the player upwards
set the block behind the player to water
loop blocks above the player:
    set {_rand} to a random integer between 1 and 10
    set the block {_rand} meters south east of the loop-block to stone
block in horizontal facing of the clicked entity from the player is air
spawn a creeper 1.5 meters horizontally behind the player
spawn a TNT 5 meters above and 2 meters horizontally behind the player
thrust the last spawned TNT in the horizontal direction of the player with speed 0.2
push the player upwards and horizontally forward at speed 0.5
push the clicked entity in in the direction of the player at speed -0.5
open the inventory of the block 2 blocks below the player to the player
teleport the clicked entity behind the player
grow a regular tree 2 meters horizontally behind the player

Distance

🔗

Expression

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

Examples:

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

Drops

🔗

Expression

Patterns:
  • [the] drops
Since: 1.0
Usable in events: death
Return Type: Item Type
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.

Examples:

clear drops
remove 4 planks from the drops

Drops Of Block

🔗

Expression

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

Examples:

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

Element of

🔗

Expression

Patterns:
  • ([the] first|[the] last|[a] random|%number%(st|nd|rd|th)) element [out] of %objects%
Since: 2.0
Return Type: Object
The first, last or a random element of a set, e.g. a list variable. See also: random

Examples:

give a random element out of {free items::*} to the player

Enchant Item

🔗

Expression

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

Examples:

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

Enchanting Experience Cost

🔗

Expression

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

Examples:

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

Enchantment Bonus

🔗

Expression

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

Examples:

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

Enchantment Level

🔗

Expression

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

Examples:

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

Enchantment Offer

🔗

Expression

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

Examples:

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

Enchantment Offer Cost

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.11 or newer
Return Type: long
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.

Examples:

set cost of enchantment offer 1 to 50

Ender Chest

🔗

Expression

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

Examples:

open the player's ender chest to the player

Entities

🔗

Expression

Patterns:
Since: 1.2.1, 2.5 (chunks)
Return Type: Entity
All entities in all worlds, in a specific world, in a chunk or in a radius around a certain location, e.g. all players, all creepers in the player's world, or players in radius 100 of the player.

Examples:

kill all creepers in the player's world
send "Psst!" to all players within 100 meters of the player
give a diamond to all ops
heal all tamed wolves in radius 2000 around {town center}
delete all monsters in chunk at player

Entity AI

🔗

Expression

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

Examples:

set artificial intelligence of target entity to false

Entity Attribute

🔗

Expression

Patterns:
Since: 2.5, 2.6.1 (final attribute value)
Return Type: Number
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.

Examples:

on damage of player:
    send "You are wounded!"
    set victim's attack speed attribute to 2

Entity Owner

🔗

Expression

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

Examples:

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

Exhaustion

🔗

Expression

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

Examples:

set exhaustion of all players to 1

Experience

🔗

Expression

Patterns:
  • [the] [(spawned|dropped)] [e]xp[erience] [orb[s]]
Since: 2.1, 2.5.3 (block break event)
Usable in events: experience spawn, break / mine
Return Type: Experience
How much experience was spawned in an experience spawn or block break event. Can be changed.

Examples:

on experience spawn:
    add 5 to the spawned experience
on break of coal ore:
    clear dropped experience
on break of diamond ore:
    if tool of player = diamond pickaxe:
        add 100 to dropped experience

Exploded Blocks

🔗

Expression

Patterns:
  • [the] exploded blocks
Since: 2.5
Usable in events: explode
Return Type: Block
Get all the blocks that were destroyed in an explode event

Examples:

on explode:
    loop exploded blocks:
        add loop-block to {exploded::blocks::*}

Explosion Block Yield

🔗

Expression

Patterns:
  • [the] [explosion['s]] block (yield|amount)
  • [the] percentage of blocks dropped
Since: 2.5
Usable in events: explosion
Return Type: Number
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.

Examples:

on explode:
set the explosion's block yield to 10%

Explosion Yield

🔗

Expression

Patterns:
  • [the] explosion (yield|radius|size)
  • [the] (yield|radius|size) of [the] explosion
Since: 2.5
Usable in events: explosion prime
Return Type: Number
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information

Examples:

on explosion prime:
    set the yield of the explosion to 10

Explosive Yield

🔗

Expression

Patterns:
  • [the] explosive (yield|radius|size) of %entities%
  • %entities%'[s] explosive (yield|radius|size)
Since: 2.5
Requirements: Minecraft 1.12 or newer for creepers
Return Type: Number
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information

Examples:

on spawn of a creeper:
    set the explosive yield of the event-entity to 10

Facing

🔗

Expression

Patterns:
Since: 1.4
Return Type: Direction
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')

Examples:

# makes a bridge
loop blocks from the block below the player in the horizontal facing of the player:
    set loop-block to cobblestone

Fall Distance

🔗

Expression

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

Examples:

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

Fertilized Blocks

🔗

Expression

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

Examples:

the fertilized blocks

Filter

🔗

Expression

Patterns:
  • %objects% (where|that match) \[<.+>\]
Since: 2.2-dev36
Return Type: Object
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.

Examples:

send "congrats on being staff!" to all players where [player input has permission "staff"]

Filter Input

🔗

Expression

Patterns:
  • input
  • %*type% input
Since: 2.2-dev36
Return Type: Object
Represents the input in a filter expression. 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.

Examples:

send "congrats on being staff!" to all players where [input has permission "staff"]

Final Damage

🔗

Expression

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

Examples:

send "%final damage%" to victim

Firework Effect

🔗

Expression

Patterns:
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors%
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors% fad(e|ing) [to] %colors%
Since: 2.4
Return Type: Firework Effect
Represents a 'firework effect' which can be used in the launch firework effect.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Flight Mode

🔗

Expression

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

Examples:

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

Food Level

🔗

Expression

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

Examples:

set the player's food level to 10

Formatted Date

🔗

Expression

Patterns:
  • %dates% formatted [human-readable] [(with|as) %text%]
Since: 2.2-dev31
Return Type: Text
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.

Examples:

now formatted human-readable

Former/Future State

🔗

Expression

Patterns:
  • [the] (former|past|old) [state] [of] %~object%
  • %~object% before [the event]
  • [the] (future|to-be|new) [state] [of] %~object%
  • %~object%(-to-be| after[(wards| the event)])
Since: 1.1
Return Type: Object
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.

Examples:

on teleport:
    former world was "world_nether" # or 'world was'
    world will be "world" # or 'world after the event is'
on tool change:
    past tool is an axe
    the tool after the event will be air
on weather change:
    set {weather::%world%::old} to past weather
    set {weather::%world%::current} to the new weather

Furnace Slot

🔗

Expression

Patterns:
  • (fuel|result) [slot]
  • (ore|fuel|result)[s] [slot[s]] of %blocks%
  • %blocks%'[s] (ore|fuel|result)[s] [slot[s]]
Since: 1.0
Usable in events: smelt, fuel burn
Return Type: Inventory Slot
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not 'furnace', as 'furnace' is not an existing expression.

Examples:

set the fuel slot of the clicked block to a lava bucket
set the block's ore slot to 64 iron ore
give the result of the block to the player
clear the result slot of the block

Game Mode

🔗

Expression

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

Examples:

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

Gamerule Value

🔗

Expression

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

Examples:

set the gamerule commandBlockOutput of world "world" to false

Gliding State

🔗

Expression

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

Examples:

set gliding of player to off

Glowing

🔗

Expression

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

Examples:

set glowing of player to true

Gravity

🔗

Expression

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

Examples:

set gravity of player off

Group

🔗

Expression

Patterns:
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: Text
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed.

Examples:

on join:
    broadcast "%group of player%" # this is the player's primary group
    broadcast "%groups of player%" # this is all of the player's groups

Hanging Entity/Remover

🔗

Expression

Patterns:
  • [the] hanging (entity|remover)
Since: 2.6.2
Return Type: Entity
Returns the hanging entity or remover in hanging break and place events.

Examples:

on break of item frame:
    if item of hanging entity is diamond pickaxe:
        cancel event
        if hanging remover is a player:
            send "You can't break that item frame!" to hanging remover

Hash

🔗

Expression

Patterns:
  • %texts% hash[ed] with (MD5|SHA-256)
Since: 2.0, 2.2-dev32 (SHA-256 algorithm)
Return Type: Text
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.

MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!

Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.

Examples:

command /setpass <text>:
    trigger:
        set {password::%uuid of player%} to text-argument hashed with SHA-256
command /login <text>:
    trigger:
        if text-argument hashed with SHA-256 is {password::%uuid of player%}:
            message "Login successful."
        else:
            message "Wrong password!"

Head location

🔗

Expression

Patterns:
Since: 2.0
Return Type: Location
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.

Examples:

set the block at the player's head to air
set the block in front of the player's eyes to glass
loop blocks in front of the player's head:

Heal Amount

🔗

Expression

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

Examples:

increase heal amount by 2
remove 0.5 from heal amount

Heal Reason

🔗

Expression

Patterns:
  • (regen|health regain|heal) (reason|cause)
Since: 2.5
Return Type: Heal Reason
The heal reason of a heal event. Please click on the link for more information.

Examples:

on heal:
    if heal reason = satiated:
        send "You ate enough food and gained health back!" to player

Health

🔗

Expression

Patterns:
Since: 1.0
Usable in events: damage
Return Type: Number
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).

Examples:

message "You have %health% HP left."

Hidden Players

🔗

Expression

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

Examples:

message "<light red>You are currently hiding: <light gray>%hidden players of the player%"

Highest Solid Block

🔗

Expression

Patterns:
  • highest [(solid|non-air)] block at %locations%
Since: 2.2-dev34
Return Type: Block
Returns the highest solid block at the x and z coordinates of the world of a given location.

Examples:

highest block at location of arg-player

Hostname

🔗

Expression

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

Examples:

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

Hotbar Button

🔗

Expression

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

Examples:

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

Hotbar Slot

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] hotbar slot of %players%
  • %players%'[s] [([currently] selected|current)] hotbar slot
Since: 2.2-dev36
Return Type: Inventory Slot
The currently selected hotbar slot. To retrieve its number use Slot Index expression.

Examples:

message "%player's current hotbar slot%"
set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left

Hover List

🔗

Expression

Patterns:
  • [the] [custom] [(player|server)] (hover|sample) ([message] list|message)
  • [the] [custom] player [(hover|sample)] list
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: Text
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.

Examples:

on server list ping:
    clear the hover list
    add "&aWelcome to the &6Minecraft &aserver!" to the hover list
    add "" to the hover list # A blank line
    add "&cThere are &6%online players count% &conline players!" to the hover list

Humidity

🔗

Expression

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

Examples:

set {_humidity} to event-block's humidity

IP

🔗

Expression

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

Examples:

ban the IP address of the player
broadcast "Banned the IP %IP of player%"

on connect:
    log "[%now%] %player% (%ip%) is connected to the server."

on server list ping:
    send "%IP-address%" to the console

Id

🔗

Expression

Patterns:
Since: 1.0
Return Type: long
The id of a specific item. You usually don't need this expression as you can likely do everything with aliases.

Examples:

message "the ID of %type of the clicked block% is %id of the clicked block%."

Index Of

🔗

Expression

Patterns:
  • [the] [(first|last)] index of %text% in %text%
Since: 2.1
Return Type: long
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.

Examples:

set {_first} to the first index of "@" in the text argument
if {_s} contains "abc":
    set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}

Indices of List

🔗

Expression

Patterns:
  • [(the|all [[of] the])] (indexes|indices) of %~objects%
  • %~objects%'[s] (indexes|indices)
  • [sorted] (indices|indexes) of %~objects% in (ascending|descending) order
  • [sorted] %~objects%'[s] (indices|indexes) in (ascending|descending) order
Since: 2.4 (indices), 2.6.1 (sorting)
Return Type: Text
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.

Examples:

set {l::*} to "some", "cool" and "values"
broadcast "%indices of {l::*}%" # result is 1, 2 and 3

set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first

Inventory

🔗

Expression

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

Examples:

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

Inventory Action

🔗

Expression

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

Examples:

inventory action is pickup all

Inventory Holder/Viewers/Rows/Slots

🔗

Expression

Patterns:
  • (holder[s]|viewers|[amount of] rows|[amount of] slots) of %inventories%
  • %inventories%'[s] (holder[s]|viewers|[amount of] rows|[amount of] slots)
Since: 2.2-dev34, 2.5 (slots)
Return Type: Object
Gets the amount of rows/slots, viewers and holder of an inventory.

NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.

Examples:

event-inventory's amount of rows
holder of player's top inventory
{_inventory}'s viewers

Inventory Slot

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: Inventory Slot
Represents a slot in an inventory. It can be used to change the item in an inventory too.

Examples:

if slot 0 of player is air:
    set slot 0 of player to 2 stones
    remove 1 stone from slot 0 of player
    add 2 stones to slot 0 of player
    clear slot 1 of player

Item

🔗

Expression

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

Examples:

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

Item Amount

🔗

Expression

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

Examples:

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

Item Enchantments

🔗

Expression

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

Examples:

clear enchantments of event-item

Item of an Entity

🔗

Expression

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

Examples:

Missing examples.

Item with CustomModelData

🔗

Expression

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

Examples:

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

Item with Lore

🔗

Expression

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

Examples:

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

Items

🔗

Expression

Patterns:
  • [(all [[of] the]|the|every)] item(s|[ ]types)
  • [(all [[of] the]|the)] items of type[s] %item types%
  • [(all [[of] the]|the|every)] block(s|[ ]types)
  • [(all [[of] the]|the)] blocks of type[s] %item types%
Since: unknown (before 2.1)
Return Type: Item / Material
Items or blocks of a specific type, useful for looping.

Examples:

loop items of type ore and log:
    block contains loop-item
    message "Theres at least one %loop-item% in this block"
drop all blocks at the player # drops one of every block at the player

Items In

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
Since: 2.0
Return Type: Inventory Slot
All items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.

Examples:

loop all items in the player's inventory:
    loop-item is enchanted
    remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory

Join & Split

🔗

Expression

Patterns:
  • (concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]
  • split %text% (at|using|by) [[the] delimiter] %text%
  • %text% split (at|using|by) [[the] delimiter] %text%
  • regex split %text% (at|using|by) [[the] delimiter] %text%
  • regex %text% split (at|using|by) [[the] delimiter] %text%
Since: 2.1, 2.5.2 (regex support)
Return Type: Text
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.

Examples:

message "Online players: %join all players with "" | ""%" # %all players% would use the default "x, y, and z"
set {_s::*} to the string argument split at ","

Language

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%
  • %players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]
Since: 2.3
Return Type: Text
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.

Examples:

message player's current language

Last Attacker

🔗

Expression

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

Examples:

send "%last attacker of event-entity%"

Last Color

🔗

Expression

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

Examples:

set {_color} to the last colors of "heyyo"

Last Damage

🔗

Expression

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

Examples:

set last damage of event-entity to 2

Last Damage Cause

🔗

Expression

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

Examples:

set last damage cause of event-entity to fire tick

Last Loaded Server Icon

🔗

Expression

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

Examples:

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

Last Resource Pack Response

🔗

Expression

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

Examples:

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

Last Spawned Entity

🔗

Expression

Patterns:
  • [the] [last[ly]] (spawned|shot) %*entity type%
  • [the] [last[ly]] dropped (item)
Since: 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item)
Return Type: Entity
Holds the entity that was spawned most recently with the spawn effect, drop with the drop effect or shot with the shoot effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.

Examples:

spawn a priest
set {healer::%spawned priest%} to true
shoot an arrow from the last spawned entity
ignite the shot projectile
drop a diamond sword
push last dropped item upwards

Last/First Login Time

🔗

Expression

Patterns:
Since: 2.5
Return Type: Date
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.

Examples:

command /onlinefor:
    trigger:
        send "You have been online for %difference between player's last login and now%."
        send "You first joined the server %difference between player's first login and now% ago."

Leash Holder

🔗

Expression

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

Examples:

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

Length

🔗

Expression

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

Examples:

set {_l} to length of the string argument

Level

🔗

Expression

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

Examples:

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

Level Progress

🔗

Expression

Patterns:
Since: 2.0
Usable in events: level change
Return Type: Number
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.

Examples:

# use the exp bar as mana
on rightclick with a blaze rod:
    player's level progress is larger than 0.2
    shoot a fireball from the player
    reduce the player's level progress by 0.2
every 2 seconds:
    loop all players:
        level progress of loop-player is smaller than 0.9:
            increase level progress of the loop-player by 0.1
        else:
            set level progress of the loop-player to 0.99
on xp spawn:
    cancel event

Light Level

🔗

Expression

Patterns:
Since: 1.3.4
Return Type: byte
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.

Examples:

# set vampire players standing in bright sunlight on fire
every 5 seconds:
    loop all players:
        {vampire::%uuid of loop-player%} is true
        sunlight level at the loop-player is greater than 10
        ignite the loop-player for 5 seconds

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

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

Examples:

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

Location

🔗

Expression

Patterns:
Since: Unknown
Return Type: Location
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.

Examples:

set {home::%uuid of player%} to the location of the player
message "You home was set to %player's location% in %player's world%."

Location At

🔗

Expression

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

Examples:

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

Loop value

🔗

Expression

Patterns:
  • [the] loop-<.+>
Since: 1.0
Return Type: Object
The currently looped value.

Examples:

# countdown:
loop 10 times:
    message "%11 - loop-number%"
    wait a second
# generate a 10x10 floor made of randomly colored wool below the player:
loop blocks from the block below the player to the block 10 east of the block below the player:
    loop blocks from the loop-block to the block 10 north of the loop-block:
        set loop-block-2 to any wool

Lore

🔗

Expression

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

Examples:

set the 1st line of the item's lore to "<orange>Excalibur 2.0"

MOTD

🔗

Expression

Patterns:
  • [the] [(default)|(shown|displayed)] (MOTD|message of [the] day)
Since: 2.3
Return Type: Text
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.

Examples:

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

Max Durability

🔗

Expression

Patterns:
Since: 2.5
Return Type: long
The maximum durability of an item.

Examples:

maximum durability of diamond sword
if max durability of player's tool is not 0: # Item is damageable

Max Health

🔗

Expression

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

Examples:

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

Max Minecart Speed

🔗

Expression

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

Examples:

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

Max Players

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] player[s] [(count|amount|number|size)]
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] (count|amount|number|size) of players
Since: 2.3
Return Type: long
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server always and can't be changed.

Examples:

on server list ping:
    set the max players count to (online players count + 1)

Maximum Stack Size

🔗

Expression

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

Examples:

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

Me

🔗

Expression

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

Examples:

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

Mending Repair Amount

🔗

Expression

Patterns:
  • [the] [mending] repair amount
Since: 2.5.1
Return Type: long
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.

Examples:

on item mend:
    set the mending repair amount to 100

Message

🔗

Expression

Patterns:
  • [the] [chat( |-)]message
  • [the] (join|log[ ]in)( |-)message
  • [the] (quit|leave|log[ ]out|kick)( |-)message
  • [the] death( |-)message
Since: 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message)
Usable in events: chat, join, quit, death
Return Type: Text
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, or the death message on a death event. This expression is mostly useful for being changed.

Examples:

on chat:
    player has permission "admin"
    set message to "&c%message%"

on first join:
    set join message to "Welcome %player% to our awesome server!"

on join:
    player has played before
    set join message to "Welcome back, %player%!"

on quit:
    set quit message to "%player% left this awesome server!"

on death:
    set the death message to "%player% died!"

Metadata

🔗

Expression

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

Examples:

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

Middle of Location

🔗

Expression

Patterns:
  • [the] (middle|center) [point] of %location%
  • %location%'[s] (middle|center) [point]
Since: 2.6.1
Return Type: Location
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.

Examples:

command /stuck:
    executable by: players
    trigger:
        teleport player to the center of player's location
        send "You're no longer stuck."

Minecart Derailed / Flying Velocity

🔗

Expression

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

Examples:

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

Money

🔗

Expression

Patterns:
Since: 2.0, 2.5 (offline player support)
Requirements: Vault, an economy plugin that supports Vault
Return Type: Money
How much virtual money a player has (can be changed). This expression requires Vault and a compatible economy plugin to be installed.

Examples:

message "You have %player's money%" # the currency name will be added automatically
remove 20$ from the player's balance # replace '$' by whatever currency you use
add 200 to the player's account # or omit the currency alltogether

Moved blocks

🔗

Expression

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

Examples:

the moved blocks

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: Text
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
  • [the] ((player|tab)[ ]list name[s]) of %players%
  • %players%'[s] ((player|tab)[ ]list name[s])
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: Text
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Named Item/Inventory

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev34 (inventories)
Return Type: Object
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.

Examples:

give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player
set tool of player to the player's tool named "<gold>Wand"
set the name of the player's tool to "<gold>Wand"
open hopper inventory named "Magic Hopper" to player

New Line

🔗

Expression

Patterns:
  • n[ew]l[ine]
  • line[ ]break
Since: 2.5
Return Type: Text
Returns a line break separator.

Examples:

send "Hello%nl%Goodbye!" to player

No Damage Ticks

🔗

Expression

Patterns:
Since: 2.5
Return Type: long
The number of ticks that an entity is invulnerable to damage for.

Examples:

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

Now

🔗

Expression

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

Examples:

broadcast "Current server time: %now%"

Number of Characters

🔗

Expression

Patterns:
  • number of upper[ ]case char(acters|s) in %text%
  • number of lower[ ]case char(acters|s) in %text%
  • number of digit char(acters|s) in %text%
Since: 2.5
Return Type: long
The number of uppercase, lowercase, or digit characters in a string.

Examples:

#Simple Chat Filter
on chat:
    if number of uppercase chars in message / length of message > 0.5
        cancel event
        send "<red>Your message has to many caps!" to player

Numbers

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%
Since: 1.4.6 (integers & numbers), 2.5.1 (decimals)
Return Type: Number
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'

Examples:

loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5
loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5
loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4

Offline players

🔗

Expression

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

Examples:

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

Online Player Count

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)
  • [the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online players
Since: 2.3
Return Type: long
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. 'real online player count' always returns the real count of online players and can't be changed.

Fake online player count requires PaperSpigot 1.12.2+.

Examples:

on server list ping:
    # This will make the max players count 5 if there are 4 players online.
    set the fake max players count to (online players count + 1)

Opened Inventory

🔗

Expression

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

Examples:

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

Parse

🔗

Expression

Patterns:
Since: 2.0
Return Type: Object
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.

Examples:

set {var} to line 1 parsed as number
on chat:
    set {var::*} to message parsed as "buying %items% for %money%"
    if parse error is set:
        message "%parse error%"
    else if {var::*} is set:
        cancel event
        remove {var::2} from the player's balance
        give {var::1::*} to the player

Parse Error

🔗

Expression

Patterns:
  • [the] [last] [parse] error
Since: 2.0
Return Type: Text
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.

Examples:

set {var} to line 1 parsed as integer
if {var} is not set:
    parse error is set:
        message "<red>Line 1 is invalid: %last parse error%"
    else:
        message "<red>Please put an integer on line 1!"

Passenger

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)
Return Type: Entity
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle

Examples:

#for 1.11 and lower
passenger of the minecart is a creeper or a cow
the saddled pig's passenger is a player
#for 1.11.2+
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat

Ping

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: long
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).

Examples:

command /ping :
    trigger:
        send "%arg-1%'s ping is %arg-1's ping%"

Plain Item

🔗

Expression

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

Examples:

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

Player List Header and Footer

🔗

Expression

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

Examples:

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

Player Protocol Version

🔗

Expression

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

Examples:

command /protocolversion <player>:
    trigger:
        send "Protocol version of %arg-1%: %protocol version of arg-1%"

Player Skull

🔗

Expression

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

Examples:

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

Player Weather

🔗

Expression

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

Examples:

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

Portal

🔗

Expression

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

Examples:

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

Potion Effect

🔗

Expression

Patterns:
  • [new] potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
  • [new] ambient potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
Since: 2.5.2
Return Type: Potion Effect
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.

Examples:

set {_p} to potion effect of speed of tier 1 without particles for 10 minutes
add {_p} to potion effects of player's tool
add {_p} to potion effects of target entity
add potion effect of speed 1 to potion effects of player

Potion Effects

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: Potion Effect
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.

Examples:

set {_p::*} to active potion effects of player
clear all the potion effects of player
clear all the potion effects of player's tool
add potion effects of player to potion effects of player's tool
add speed to potion effects of target entity
remove speed and night vision from potion effects of player

Prefix/Suffix

🔗

Expression

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

Examples:

on chat:
    cancel event
    broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world

set the player's prefix to "[<red>Admin] "

Projectile Bounce State

🔗

Expression

Patterns:
  • [the] projectile bounce (state|ability|mode) of %projectiles%
  • %projectiles%'[s] projectile bounce (state|ability|mode)
Since: 2.5.1
Return Type: Boolean
A projectile's bounce state.

Examples:

on projectile hit:
    set projectile bounce mode of event-projectile to true

Projectile Critical State

🔗

Expression

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

Examples:

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

Protocol Version

🔗

Expression

Patterns:
  • [the] [server] [(sent|required|fake)] protocol version [number]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: long
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.

This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).

Examples:

on server list ping:
    set the version string to "<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

Random

🔗

Expression

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

Examples:

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

Random Number

🔗

Expression

Patterns:
  • [a] random (integer|number) (from|between) %number% (to|and) %number%
Since: 1.4
Return Type: Number
A random number or integer between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.

Examples:

set the player's health to a random number between 5 and 10
send "You rolled a %random integer from 1 to 6%!" to the player

Random UUID

🔗

Expression

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

Examples:

set {_uuid} to random uuid

Raw Name

🔗

Expression

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

Examples:

raw name of tool of player

Redstone Block Power

🔗

Expression

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

Examples:

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

Region

🔗

Expression

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

Examples:

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

Region Members & Owners

🔗

Expression

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

Examples:

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

Regions At

🔗

Expression

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Return Type: Region
All regions at a particular location. This expression requires a supported regions plugin to be installed.

Examples:

On click on a sign:
    line 1 of the clicked block is "[region info]"
    set {_regions::*} to regions at the clicked block
    if {_regions::*} is empty:
        message "No regions exist at this sign."
    else:
        message "Regions containing this sign: <gold>%{_regions::*}%."

Remaining Air

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: Timespan
How much time a player has left underwater before starting to drown.

Examples:

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

Respawn location

🔗

Expression

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

Examples:

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

Reversed List

🔗

Expression

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

Examples:

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

Rounding

🔗

Expression

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

Examples:

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

Saturation

🔗

Expression

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

Examples:

set saturation of player to 20

Scoreboard Tags

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] scoreboard tags of %entities%
  • %entities%'[s] scoreboard tags
Since: 2.3
Return Type: Text
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.

Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).

Examples:

on spawn of a monster:
    if the spawn reason is mob spawner:
        add "spawned by a spawner" to the scoreboard tags of event-entity

on death of a monster:
    if the attacker is a player:
        if the victim doesn't have the scoreboard tag "spawned by a spawner":
            add 1$ to attacker's balance

Script Name

🔗

Expression

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

Examples:

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

Sea Level

🔗

Expression

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

Examples:

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

Server Icon

🔗

Expression

Patterns:
  • [the] [((default)|(shown|sent))] [server] icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: Server Icon
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.

Examples:

on script load:
    set {server-icons::default} to the default server icon

Shooter

🔗

Expression

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

Examples:

shooter is a skeleton

Shuffled List

🔗

Expression

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

Examples:

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

Sign Text

🔗

Expression

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

Examples:

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

Slot Index

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type: long
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.

Examples:

if index of event-slot is 10:
    send "You bought a pie!"

Sorted List

🔗

Expression

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

Examples:

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

Spawn

🔗

Expression

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

Examples:

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

Spawn Reason

🔗

Expression

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

Examples:

on spawn:
    spawn reason is reinforcements or breeding

Spawner Type

🔗

Expression

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

Examples:

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

Special Number

🔗

Expression

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

Examples:

if {_number} is NaN value:

Spectator Target

🔗

Expression

Patterns:
Since: 2.4
Return Type: Entity
Returns the entity which is followed by the camera of the player when in spectator mode.

Examples:

command /spectate :
    executable by: players
    trigger:
        set gamemode of player to spectator # otherwise below won't do anything
        set spectator target of player to arg-1
        send "Spectating %arg-1%" to player

Speed

🔗

Expression

Patterns:
  • [the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%
  • %players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speed
Since: unknown (before 2.1)
Return Type: Number
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.

Examples:

set the player's walk speed to 1
increase the argument's fly speed by 0.1

Subtext

🔗

Expression

Patterns:
  • [the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%
  • [the] (first|last) [%number%] character[s] of %texts%
  • [the] %number% (first|last) characters of %texts%
  • [the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%
Since: 2.1, 2.5.2 (character at, multiple strings support)
Return Type: Text
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).

Examples:

set {_s} to the first 5 characters of the text argument
message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console
set {_characters::*} to characters at 1, 2 and 7 in player's display name
send the last character of all players' names

TPS (ticks per second)

🔗

Expression

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

Examples:

broadcast "%tps%"

Tamer

🔗

Expression

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

Examples:

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

Target

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: Entity
For players this is the entity at the crosshair, while for mobs and experience orbs it represents the entity they are attacking/following (if any).

Examples:

on entity target:
    entity's target is a player
    send "You're being followed by an %entity%!" to target of entity

Targeted Block

🔗

Expression

Patterns:
  • [the] target[ed] block[s] [of %players%]
  • %players%'[s] target[ed] block[s]
  • [the] actual[ly] target[ed] block[s] [of %players%]
  • %players%'[s] actual[ly] target[ed] block[s]
Since: 1.0
Return Type: Block
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression.

Examples:

# A command to set the block a player looks at to a specific type:
command /setblock <material>:
    trigger:
        set targeted block to argument

Teleport Cause

🔗

Expression

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

Examples:

on teleport
    teleport cause is nether portal, end portal or end gateway

Temperature

🔗

Expression

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

Examples:

message "%temperature of the targeted block%"

Ternary

🔗

Expression

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

Examples:

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

Time

🔗

Expression

Patterns:
  • [the] time[s] [([with]in|of) %worlds%]
  • %worlds%'[s] time[s]
Since: 1.0
Return Type: Time
The time of a world.

Examples:

time in world is between 18:00 and 6:00:
    broadcast "It's night-time, watch out for monsters!"

Time Played

🔗

Expression

Patterns:
Since: 2.5
Return Type: Timespan
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu.

Examples:

set {_t} to time played of player
if player's time played is greater than 10 minutes:
    give player a diamond sword
set player's time played to 0 seconds

Time Since

🔗

Expression

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

Examples:

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

Tool

🔗

Expression

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

Examples:

player's tool is a pickaxe
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow

Type of

🔗

Expression

Patterns:
Since: 1.4, 2.5.2 (potion effect)
Return Type: Object
Type of a block, item, entity, inventory or potion effect. Types of items and blocks are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.

Examples:

on rightclick on an entity:
    message "This is a %type of clicked entity%!"

UUID

🔗

Expression

Patterns:
Since: 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs)
Return Type: Text
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!

Examples:

# prevents people from joining the server if they use the name of a player
# who has played on this server at least once since this script has been added
on login:
    if {uuid::%name of player%} exists:
        {uuid::%name of player%} is not uuid of player
        kick player due to "Someone with your name has played on this server before"
    else:
        set {uuid::%name of player%} to uuid of player

Unbreakable Items

🔗

Expression

Patterns:
Since: 2.2-dev13b
Return Type: Item Type
Creates unbreakable copies of given items.

Examples:

unbreakable iron sword #Creates unbreakable iron sword

Unix Date

🔗

Expression

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

Examples:

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

Unix Timestamp

🔗

Expression

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

Examples:

unix timestamp of now

Vectors - Angle Between

🔗

Expression

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

Examples:

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

Vectors - Arithmetic

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: Vector
Arithmetic expressions for vectors.

Examples:

set {_v} to vector 1, 2, 3 // 5
set {_v} to {_v} ++ {_v}
set {_v} to {_v} ++ 5
set {_v} to {_v} -- {_v}
set {_v} to {_v} -- 5
set {_v} to {_v} ** {_v}
set {_v} to {_v} ** 5
set {_v} to {_v} // {_v}
set {_v} to {_v} // 5

Vectors - Create from XYZ

🔗

Expression

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

Examples:

set {_v} to vector 0, 1, 0

Vectors - Cross Product

🔗

Expression

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

Examples:

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

Vectors - Cylindrical Shape

🔗

Expression

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

Examples:

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

Vectors - Dot Product

🔗

Expression

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

Examples:

set {_v} to {_v2} dot {_v3}

Vectors - Length

🔗

Expression

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

Examples:

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

Vectors - Location Vector Offset

🔗

Expression

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

Examples:

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

Vectors - Normalized

🔗

Expression

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

Examples:

set {_v} to normalized {_v}

Vectors - Random Vector

🔗

Expression

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

Examples:

set {_v} to a random vector

Vectors - Spherical Shape

🔗

Expression

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

Examples:

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

Vectors - Squared Length

🔗

Expression

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

Examples:

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

Vectors - Vector Between Locations

🔗

Expression

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

Examples:

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

Vectors - Vector from Location

🔗

Expression

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

Examples:

set {_v} to vector of {_loc}

Vectors - Vector from Pitch and Yaw

🔗

Expression

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

Examples:

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

Vectors - Velocity

🔗

Expression

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

Examples:

set player's velocity to {_v}

Vectors - XYZ Component

🔗

Expression

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

Examples:

set {_v} to vector 1, 2, 3
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"

Vehicle

🔗

Expression

Patterns:
Since: 2.0
Return Type: Entity
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger

Examples:

vehicle of the player is a minecart

Version

🔗

Expression

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

Examples:

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

Version String

🔗

Expression

Patterns:
  • [the] [(shown|custom)] version [(string|text)]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: Text
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.

Examples:

on server list ping:
    set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
    set the version string to "<light green>Version: <orange>%minecraft version%"

View Distance of Client

🔗

Expression

Patterns:
  • [the] client view distance[s] of %players%
  • %players%'[s] client view distance[s]
Since: 2.5
Requirements: 1.13.2+
Return Type: long
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.

Examples:

set {_clientView} to the client view distance of player
set view distance of player to client view distance of player

Weather

🔗

Expression

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

Examples:

set weather to clear
weather in "world" is rainy

Whitelist

🔗

Expression

Patterns:
  • [the] white[ ]list
Since: 2.5.2
Return Type: Offline Player
A server's whitelist.This expression can be used to add/remove players to/from the whitelist, to enable it and disable it (set whitelist to true / set whitelist to false), and to empty it (reset whitelist)

Examples:

set whitelist to false
add all players to whitelist
reset the whitelist

World

🔗

Expression

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

Examples:

world is "world_nether"
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk

World Seed

🔗

Expression

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

Examples:

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

World from Name

🔗

Expression

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

Examples:

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

Worlds

🔗

Expression

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

Examples:

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

X Times

🔗

Expression

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

Examples:

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

X of Item

🔗

Expression

Patterns:
Since: 1.2
Return Type: Object
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.

Examples:

give level of player of pickaxes to the player

Yaw / Pitch

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev28 (vector yaw/pitch)
Return Type: Number
The yaw or pitch of a location or vector.

Examples:

log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"
set {_yaw} to yaw of player
set {_p} to pitch of target entity
\ No newline at end of file + Skript Documentation - 2.6.3

Expressions

Absorbed blocks

🔗

Expression

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

Examples:

the absorbed blocks

Affected Entities

🔗

Expression

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

Examples:

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

Age of Block/Entity

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type:
Returns the age or maximum age of blocks and age for entities (there in no maximum age for entities). For blocks, 'Age' represents the different growth stages that a crop-like block can go through. A value of 0 indicates that the crop was freshly planted, whilst a value equal to 'maximum age' indicates that the crop is ripe and ready to be harvested. For entities, 'Age' represents the time left for them to become adults and it's in minus increasing to be 0 which means they're adults, e.g. A baby cow needs 20 minutes to become an adult which equals to 24,000 ticks so their age will be -24000 once spawned.

Examples:

# Set targeted crop to fully grown crop
set age of targeted block to maximum age of targeted block

# Spawn a baby cow that will only need 1 minute to become an adult
spawn a baby cow at player
set age of last spawned entity to -1200 # in ticks = 60 seconds

All Groups

🔗

Expression

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

Examples:

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

All Permissions

🔗

Expression

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

Examples:

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

All Scripts

🔗

Expression

Patterns:
  • [all [of the]] scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (enabled|loaded) scripts [(without ([subdirectory] paths|parents))]
  • [all [of the]] (disabled|unloaded) scripts [(without ([subdirectory] paths|parents))]
Since: 2.5
Return Type: string
Returns all of the scripts, or just the enabled or disabled ones.

Examples:

command /scripts:
    trigger:
        send "All Scripts: %scripts%" to player
        send "Loaded Scripts: %enabled scripts%" to player
        send "Unloaded Scripts: %disabled scripts%" to player

All commands

🔗

Expression

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

Examples:

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

Alphabetical Sort

🔗

Expression

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

Examples:

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

Altitude

🔗

Expression

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

Examples:

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

Amount

🔗

Expression

Patterns:
  • [the] (amount|number|size) of %objects%
  • [the] recursive (amount|number|size) of %objects%
Since: 1.0
Return Type:
The amount of something. Please note that amount of %items% will not return the number of items, but the number of stacks, e.g. 1 for a stack of 64 torches. To get the amount of items in a stack, see the item amount expression.

Also, you can get the recursive size of a list, which will return the recursive size of the list with sublists included, e.g.

 {list::*} Structure
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6

Where using %size of {list::*}% will only return 3 (the first layer of indices only), while %recursive size of {list::*}% will return 6 (the entire list) Please note that getting a list's recursive size can cause lag if the list is large, so only use this expression if you need to!

Examples:

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

Amount of Items

🔗

Expression

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

Examples:

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

Applied Enchantments

🔗

Expression

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

Examples:

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

Argument

🔗

Expression

Patterns:
  • [the] last arg[ument]
  • [the] arg[ument](-| )<(\d+)>
  • [the] <(\d*1)st|(\d*2)nd|(\d*3)rd|(\d*[4-90])th> arg[ument][s]
  • [(all [[of] the]|the)] arg[ument][s]
  • [the] %*type%( |-)arg[ument][( |-)<\d+>]
  • [the] arg[ument]( |-)%*type%[( |-)<\d+>]
Since: 1.0, INSERT VERSION (support for command events)
Return Type: object
Usable in script commands and command events. Holds the value of an argument given to the command, e.g. if the command "/tell <player> <text>" is used like "/tell Njol Hello Njol!" argument 1 is the player named "Njol" and argument 2 is "Hello Njol!". One can also use the type of the argument instead of its index to address the argument, e.g. in the above example 'player-argument' is the same as 'argument 1'. Please note that specifying the argument type is only supported in script commands.

Examples:

give the item-argument to the player-argument
damage the player-argument by the number-argument
give a diamond pickaxe to the argument
add argument 1 to argument 2
heal the last argument

Arithmetic

🔗

Expression

Patterns:
Since: 1.4.2
Return Type: number
Arithmetic expressions, e.g. 1 + 2, (health of player - 2) / 3, etc.

Examples:

set the player's health to 10 - the player's health
loop (argument + 2) / 5 times:
    message "Two useless numbers: %loop-num * 2 - 5%, %2^loop-num - 1%"
message "You have %health of player * 2% half hearts of HP!"

Armour Slot

🔗

Expression

Patterns:
  • [the] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)] of %living entities%
  • %living entities%'[s] (boot[s]|shoe[s]|leg[ging][s]|chestplate[s]|helm[et][s]) [(item|slot)]
Since: 1.0
Return Type: slot
A part of a player's armour, i.e. the boots, leggings, chestplate or helmet.

Examples:

set chestplate of the player to a diamond chestplate
helmet of player is neither a helmet nor air # player is wearing a block, e.g. from another plugin

Arrow Knockback Strength

🔗

Expression

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

Examples:

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

Arrows Stuck

🔗

Expression

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

Examples:

set arrows stuck in player to 5

Attack Cooldown

🔗

Expression

Patterns:
Since: 2.6.1
Requirements: Minecraft 1.15+
Return Type:
Returns the current cooldown for a player's attack. This is used to calculate damage, with 1.0 representing a fully charged attack and 0.0 representing a non-charged attack. NOTE: Currently this can not be set to anything.

Examples:

on damage:
    if attack cooldown of attacker < 1:
        set damage to 0
        send "Your hit was too weak! wait until your weapon is fully charged next time." to attacker

Attacked

🔗

Expression

Patterns:
  • [the] (attacked|damaged|victim) [<(.+)>]
Since: 1.3, 2.6.1 (projectile hit event)
Usable in events: damage, death, projectile hit
Return Type: entity
The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. When using Minecraft 1.11+, this also covers the hit entity in a projectile hit event.

Examples:

on damage:
    victim is a creeper
    damage the attacked by 1 heart

Attacker

🔗

Expression

Patterns:
  • [the] (attacker|damager)
Since: 1.3
Usable in events: damage, death, destroy
Return Type: entity
The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player. Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases.

Examples:

on damage:
    attacker is a player
    health of attacker is less than or equal to 2
    damage victim by 1 heart

Bed

🔗

Expression

Patterns:
  • [the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offline players%
  • %offline players%'[s] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]]
Since: 2.0, INSERT VERSION (offlineplayers, safe bed)
Return Type: location
Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. safe bed location.

NOTE: Offline players can not have their bed location changed, only online players.

Examples:

if bed of player exists:
    teleport player the the player's bed
else:
    teleport the player to the world's spawn point

set the bed location of player to spawn location of world("world") # unsafe/invalid bed location
set the safe bed location of player to spawn location of world("world") # safe/valid bed location

Biome

🔗

Expression

Patterns:
Since: 1.4.4, 2.6.1 (3D biomes)
Return Type: biome
The biome at a certain location. Please note that biomes are only defined for x/z-columns (i.e. the altitude (y-coordinate) doesn't matter), up until Minecraft 1.15.x. As of Minecraft 1.16, biomes are now 3D (per block vs column).

Examples:

# damage player in deserts constantly
every real minute:
    loop all players:
        biome at loop-player is desert
        damage the loop-player by 1

Block

🔗

Expression

Patterns:
  • [the] [event-]block
Since: 1.0
Return Type: block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block

🔗

Expression

Patterns:
Since: 1.0
Return Type: block
The block involved in the event, e.g. the clicked block or the placed block. Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'.

Examples:

block is ore
set block below to air
spawn a creeper above the block
loop blocks in radius 4:
    loop-block is obsidian
    set loop-block to water
block is a chest:
    clear the inventory of the block

Block Data

🔗

Expression

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

Examples:

set {data} to block data of target block
set block at player to {data}
set block data of target block to oak_stairs[facing=south;waterlogged=true]

Block Hardness

🔗

Expression

Patterns:
Since: 2.6
Requirements: Minecraft 1.13+
Return Type: number
Obtains the block's hardness level (also known as "strength"). This number is used to calculate the time required to break each block.

Examples:

set {_hard} to block hardness of target block
if block hardness of target block > 5:

Block Sphere

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] blocks in radius %number% [(of|around) %location%]
  • [(all [[of] the]|the)] blocks around %location% in radius %number%
Since: 1.0
Return Type: block
All blocks in a sphere around a center, mostly useful for looping.

Examples:

loop blocks in radius 5 around the player:
    set loop-block to air

Blocks

🔗

Expression

Patterns:
Since: 1.0, 2.5.1 (within/cuboid/chunk)
Return Type: block
Blocks relative to other blocks or between other blocks. Can be used to get blocks relative to other blocks or for looping. Blocks from/to and between will return a straight line whereas blocks within will return a cuboid.

Examples:

loop blocks above the player:
loop blocks between the block below the player and the targeted block:
set the blocks below the player, the victim and the targeted block to air
set all blocks within {loc1} and {loc2} to stone
set all blocks within chunk at player to air

Blocks in Region

🔗

Expression

Patterns:
  • [(all|the)] blocks (in|of) [[the] region[s]] %regions%
Since: 2.1
Requirements: Supported regions plugin
Return Type: block
All blocks in a region. This expression requires a supported regions plugin to be installed.

Examples:

loop all blocks in the region {arena.%{faction.%player%}%}:
    clear the loop-block

Book Author

🔗

Expression

Patterns:
  • [the] [book] (author|writer|publisher) of %item types%
  • %item types%'[s] [book] (author|writer|publisher)
Since: 2.2-dev31
Return Type: string
The author of a book.

Examples:

on book sign:
    message "Book Title: %author of event-item%"

Book Pages

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: string
The pages of a book.

Examples:

on book sign:
    message "Book Pages: %pages of event-item%"
    message "Book Page 1: %page 1 of event-item%"

Book Title

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: string
The title of a book.

Examples:

on book sign:
    message "Book Title: %title of event-item%"

Burn/Cook Time

🔗

Expression

Patterns:
  • [the] burn[ing] time
  • [the] (burn|cook)[ing] time of %blocks%
  • %blocks%'[s] (burn|cook)[ing] time
Since: 2.3
Return Type: timespan
The time a furnace takes to burn an item in a fuel burn event. Can also be used to change the burn/cook time of a placed furnace.

Examples:

on fuel burn:
    if fuel slot is coal:
        set burning time to 1 tick

Case Text

🔗

Expression

Patterns:
  • %texts% in (upper|lower)[ ]case
  • (upper|lower)[ ]case %texts%
  • capitali(s|z)ed %texts%
  • %texts% in [(lenient|strict) ](proper|title)[ ]case
  • [(lenient|strict) ](proper|title)[ ]case %texts%
  • %texts% in [(lenient|strict) ]camel[ ]case
  • [(lenient|strict) ]camel[ ]case %texts%
  • %texts% in [(lenient|strict) ]pascal[ ]case
  • [(lenient|strict) ]pascal[ ]case %texts%
  • %texts% in [(lower|upper|capital|screaming)[ ]]snake[ ]case
  • [(lower|upper|capital|screaming)[ ]]snake[ ]case %texts%
  • %texts% in [(lower|upper|capital)[ ]]kebab[ ]case
  • [(lower|upper|capital)[ ]]kebab[ ]case %texts%
Since: 2.2-dev16 (lowercase and uppercase), 2.5 (advanced cases)
Return Type: string
Copy of given text in Lowercase, Uppercase, Proper Case, camelCase, PascalCase, Snake_Case, and Kebab-Case

Examples:

"Oops!" in lowercase # oops!
"oops!" in uppercase # OOPS!
"hellO i'm steve!" in proper case # HellO I'm Steve!
"hellO i'm steve!" in strict proper case # Hello I'm Steve!
"spAwn neW boSs ()" in camel case # spAwnNeWBoSs()
"spAwn neW boSs ()" in strict camel case # spawnNewBoss()
"geneRate ranDom numBer ()" in pascal case # GeneRateRanDomNumBer()
"geneRate ranDom numBer ()" in strict pascal case # GenerateRandomNumber()
"Hello Player!" in snake case # Hello_Player!
"Hello Player!" in lower snake case # hello_player!
"Hello Player!" in upper snake case # HELLO_PLAYER!
"What is your name?" in kebab case # What-is-your-name?
"What is your name?" in lower kebab case # what-is-your-name?
"What is your name?" in upper kebab case # WHAT-IS-YOUR-NAME?

Chat Format

🔗

Expression

Patterns:
  • [the] (message|chat) format[ting]
Since: 2.2-dev31
Return Type: string
Can be used to get/retrieve the chat format. The sender of a message is represented by [player] or [sender], and the message by [message] or [msg].

Examples:

set the chat format to "<yellow>[player]<light gray>: <green>[message]"

Chat Recipients

🔗

Expression

Patterns:
  • [chat][( |-)]recipients
Since: 2.2-Fixes-v7, 2.2-dev35 (clearing recipients)
Return Type: player
Recipients of chat events where this is called.

Examples:

chat recipients

Chunk

🔗

Expression

Patterns:
Since: 2.0
Return Type: chunk
The chunk a block, location or entity is in.

Examples:

add the chunk at the player to {protected chunks::*}

Clicked Block/Entity/Inventory/Slot

🔗

Expression

Patterns:
  • [the] (clicked [enchant[ment]] (button|option)|clicked (block|%*item type/entity type%)|clicked slot|clicked inventory|click (type|action)|inventory action)
Since: 1.0, 2.2-dev35 (more clickable things)
Usable in events: click, inventory click
Return Type: object
The clicked block, entity, inventory, inventory slot, inventory click type or inventory action.

Examples:

message "You clicked on a %type of clicked entity%!"
if the clicked block is a chest:
    show the inventory of the clicked block to the player

Color of

🔗

Expression

Patterns:
Since: 1.2
Return Type: color
The color of an item, can also be used to color chat messages with "<%color of ...%>this text is colored!".

Examples:

on click on wool:
    message "This wool block is <%color of block%>%color of block%!"
    set the color of the block to black

Colored / Uncolored

🔗

Expression

Patterns:
  • (colo[u]r-|colo[u]red )%texts%
  • (format-|formatted )%texts%
  • (un|non)[-](colo[u]r-|colo[u]red |format-|formatted )%texts%
Since: 2.0
Return Type: string
Parses <color>s and, optionally, chat styles in a message or removes any colors and chat styles from the message. Parsing all chat styles requires this expression to be used in same line with the send effect.

Examples:

on chat:
    set message to colored message # Safe; only colors get parsed
command /fade <player>:
    trigger:
        set display name of the player-argument to uncolored display name of the player-argument
command /format <text>:
    trigger:
        message formatted text-argument # Safe, because we're sending to whoever used this command

Command

🔗

Expression

Patterns:
  • [the] (full|complete|whole) command
  • [the] command [(label|alias)]
Since: 2.0, INSERT VERSION (support for script commands)
Usable in events: command
Return Type: string
The command that caused an 'on command' event (excluding the leading slash and all arguments)

Examples:

# prevent any commands except for the /exit command during some game
on command:
    if {game::%player%::playing} is true:
        if the command is not "exit":
            message "You're not allowed to use commands during the game"
            cancel the event

Command Info

🔗

Expression

Patterns:
  • [the] main command [label] of command %texts%
  • command %texts%'[s] main command [name]
  • [the] description of command %texts%
  • command %texts%'[s] description
  • [the] label of command %texts%
  • command %texts%'[s] label
  • [the] usage of command %texts%
  • command %texts%'[s] usage
  • [(all|the|all [of] the)] aliases of command %texts%
  • command %texts%'[s] aliases
  • [the] permission of command %texts%
  • command %texts%'[s] permission
  • [the] permission message of command %texts%
  • command %texts%'[s] permission message
  • [the] plugin [owner] of command %texts%
  • command %texts%'[s] plugin [owner]
Since: 2.6
Return Type: string
Get information about a command.

Examples:

main name of command "skript"
description of command "help"
label of command "pl"
usage of command "help"
aliases of command "bukkit:help"
permission of command "/op"
command "op"'s permission message
command "sk"'s plugin owner

Command Sender

🔗

Expression

Patterns:
  • [the] [command['s]] (sender|executor)
Since: 2.0
Usable in events: command
Return Type: commandsender
The player or the console who sent a command. Mostly useful in commands and command events. If the command sender is a command block, its location can be retrieved by using %block's location%

Examples:

make the command sender execute "/say hi!"
on command:
    log "%executor% used command /%command% %arguments%" to "commands.log"

Compass Target

🔗

Expression

Patterns:
Since: 2.0
Return Type: location
The location a player's compass is pointing at.

Examples:

# make all player's compasses target a player stored in {compass::target::%player%}
every 5 seconds:
    loop all players:
        set the loop-player's compass target to location of {compass::target::%%loop-player%}

Console

🔗

Expression

Patterns:
  • [the] (console|server)
Since: 1.3.1
Return Type: commandsender
Represents the server's console which can receive messages and execute commands

Examples:

execute console command "/stop"
send "message to console" to the console

Cooldown Time/Remaining Time/Elapsed Time/Last Usage/Bypass Permission

🔗

Expression

Patterns:
  • [the] remaining [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] elapsed [time] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] ((cooldown|wait) time|[wait] time of [the] (cooldown|wait) [(of|for) [the] [current] command])
  • [the] last usage [date] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
  • [the] [cooldown] bypass perm[ission] [of [the] (cooldown|wait) [(of|for) [the] [current] command]]
Since: 2.2-dev33
Return Type: object
Only usable in command events. Represents the cooldown time, the remaining time, the elapsed time, the last usage date, or the cooldown bypass permission.

Examples:

command /home:
    cooldown: 10 seconds
    cooldown message: You last teleported home %elapsed time% ago, you may teleport home again in %remaining time%.
    trigger:
        teleport player to {home::%player%}

Coordinate

🔗

Expression

Patterns:
  • [the] (x|y|z)(-| )(coord[inate]|pos[ition]|loc[ation])[s] of %locations%
  • %locations%'[s] (x|y|z)(-| )(coord[inate]|pos[ition]|loc[ation])[s]
Since: 1.4.3
Return Type: number
Represents a given coordinate of a location.

Examples:

player's y-coordinate is smaller than 40:
    message "Watch out for lava!"

Creature/Entity/Player/Projectile/Villager/Powered Creeper/etc.

🔗

Expression

Patterns:
  • [the] [event-]<.+>
Since: 1.0
Return Type: entity
The entity involved in an event (an entity is a player, a creature or an inanimate object like ignited TNT, a dropped item or an arrow). You can use the specific type of the entity that's involved in the event, e.g. in a 'death of a creeper' event you can use 'the creeper' instead of 'the entity'.

Examples:

give a diamond sword of sharpness 3 to the player
kill the creeper
kill all powered creepers in the wolf's world
projectile is an arrow

Cursor Slot

🔗

Expression

Patterns:
Since: 2.2-dev17
Return Type: slot
The item which the player has on their cursor. This slot is always empty if player has no inventories open.

Examples:

cursor slot of player is dirt
set cursor slot of player to 64 diamonds

Custom Chest Inventory

🔗

Expression

Patterns:
  • [a [new]] chest inventory (named|with name) %text% [with %number% row[s]]
  • [a [new]] chest inventory with %number% row[s] [(named|with name) %text%]
Since: 2.2-dev34
Return Type: inventory
Returns a chest inventory with the given amount of rows and the name. Use the open inventory effect to open it.

Examples:

open chest inventory with 1 row named "test" to player
set {_inventory} to chest inventory with 1 row

Custom Model Data

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.14+
Return Type:
Get/set the CustomModelData tag for an item. (Value is an integer between 0 and 99999999)

Examples:

set custom model data of player's tool to 3
set {_model} to custom model data of player's tool

Damage

🔗

Expression

Patterns:
  • [the] damage
Since: 1.3.5
Usable in events: damage
Return Type: number
How much damage is done in a damage event, possibly ignoring armour, criticals and/or enchantments. Can be changed (remember that in Skript '1' is one full heart, not half a heart).

Examples:

increase the damage by 2

Damage Cause

🔗

Expression

Patterns:
  • [the] damage (cause|type)
Since: 2.0
Return Type: damagecause
The damage cause of a damage event. Please click on the link for more information.

Examples:

damage cause is lava, fire or burning

Damaged Item

🔗

Expression

Patterns:
Since: 2.4
Return Type: itemtype
Directly damages an item. In MC versions 1.12.2 and lower, this can be used to apply data values to items/blocks

Examples:

give player diamond sword with damage value 100
set player's tool to diamond hoe damaged by 250
give player diamond sword with damage 700 named "BROKEN SWORD"
set {_item} to diamond hoe with damage value 50 named "SAD HOE"
set target block of player to wool with data value 1
set target block of player to potato plant with data value 7

Data/Damage Value

🔗

Expression

Patterns:
Since: 1.2
Return Type:
The data/damage value of an item/block. Data values of blocks are only supported on 1.12.2 and below. You usually don't need this expression as you can check and set items with aliases easily, but this expression can e.g. be used to "add 1 to data of <item>", e.g. for cycling through all wool colors.

Examples:

set damage value of player's tool to 10
set data value of target block of player to 3
add 1 to the data value of the clicked block
reset data value of block at player

Date Ago/Later

🔗

Expression

Patterns:
Since: 2.2-dev33
Return Type: date
A date the specified timespan before/after another date.

Examples:

set {_yesterday} to 1 day ago
set {_hourAfter} to 1 hour after {someOtherDate}
set {_hoursBefore} to 5 hours before {someOtherDate}

Default Value

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: object
A shorthand expression for giving things a default value. If the first thing isn't set, the second thing will be returned.

Examples:

broadcast {score::%player's uuid%} otherwise "%player% has no score!"

Difference

🔗

Expression

Patterns:
Since: 1.4
Return Type: object
The difference between two values, e.g. numbers, dates or times.

Examples:

if difference between {command::%player%::lastuse} and now is smaller than a minute:
    message "You have to wait a minute before using this command again!"

Difficulty

🔗

Expression

Patterns:
  • [the] difficult(y|ies) of %worlds%
  • %worlds%'[s] difficult(y|ies)
Since: 2.3
Return Type: difficulty
The difficulty of a world.

Examples:

set the difficulty of "world" to hard

Direction

🔗

Expression

Patterns:
  • [%number% [(block|met(er|re))[s]] [to the]] (north[[(-| )](east|west)][(ward[(s|ly)]|er[(n|ly)])] [of]|south[[(-| )](east|west)][(ward[(s|ly)]|er[(n|ly)])] [of]|(east|west)[(ward[(s|ly)]|er[(n|ly)])] [of]|above|over|(up|down)[ward[(s|ly)]]|below|under[neath]|beneath) [%direction%]
  • [%number% [(block|met(er|re))[s]]] in [the] (direction|horizontal direction|facing|horizontal facing) of %entity/block% [(of|from)]
  • [%number% [(block|met(er|re))[s]]] in %entity/block%'[s] (direction|horizontal direction|facing|horizontal facing) [(of|from)]
  • [%number% [(block|met(er|re))[s]]] (in[ ]front [of]|forward[s]|behind|backwards|[to the] (right|left) [of])
  • [%number% [(block|met(er|re))[s]]] horizontal[ly] (in[ ]front [of]|forward[s]|behind|backwards|to the (right|left) [of])
Since: 1.0 (basic), 2.0 (extended)
Return Type: direction
A helper expression for the direction type.

Examples:

thrust the player upwards
set the block behind the player to water
loop blocks above the player:
    set {_rand} to a random integer between 1 and 10
    set the block {_rand} meters south east of the loop-block to stone
block in horizontal facing of the clicked entity from the player is air
spawn a creeper 1.5 meters horizontally behind the player
spawn a TNT 5 meters above and 2 meters horizontally behind the player
thrust the last spawned TNT in the horizontal direction of the player with speed 0.2
push the player upwards and horizontally forward at speed 0.5
push the clicked entity in in the direction of the player at speed -0.5
open the inventory of the block 2 blocks below the player to the player
teleport the clicked entity behind the player
grow a regular tree 2 meters horizontally behind the player

Distance

🔗

Expression

Patterns:
Since: 1.0
Return Type: number
The distance between two points.

Examples:

if the distance between the player and {home::%uuid of player%} is smaller than 20:
    message "You're very close to your home!"

Drops

🔗

Expression

Patterns:
  • [the] drops
Since: 1.0
Usable in events: death
Return Type: itemtype
Only works in death events. Holds the drops of the dying creature. Drops can be prevented by removing them with "remove ... from drops", e.g. "remove all pickaxes from the drops", or "clear drops" if you don't want any drops at all.

Examples:

clear drops
remove 4 planks from the drops

Drops Of Block

🔗

Expression

Patterns:
Since: 2.5.1
Requirements: Minecraft 1.15+ ('as %entity%')
Return Type: itemtype
A list of the items that will drop when a block is broken.

Examples:

on break of block:
    give drops of block using player's tool to player

Element of

🔗

Expression

Patterns:
  • ([the] first|[the] last|[a] random|%number%(st|nd|rd|th)) element [out] of %objects%
Since: 2.0
Return Type: object
The first, last or a random element of a set, e.g. a list variable. See also: random

Examples:

give a random element out of {free items::*} to the player

Enchant Item

🔗

Expression

Patterns:
  • [the] enchant[ed] item
Since: 2.5
Usable in events: enchant prepare, enchant
Return Type: itemtype
The enchant item in an enchant prepare event or enchant event. It can be modified, but enchantments will still be applied in the enchant event.

Examples:

on enchant:
    set the enchanted item to a diamond chestplate
on enchant prepare:
    set the enchant item to a wooden sword

Enchanting Experience Cost

🔗

Expression

Patterns:
  • [the] [displayed] ([e]xp[erience]|enchanting) cost
Since: 2.5
Usable in events: enchant
Return Type:
The cost of enchanting in an enchant event. This is number that was displayed in the enchantment table, not the actual number of levels removed.

Examples:

on enchant:
    send "Cost: %the displayed enchanting cost%" to player

Enchantment Bonus

🔗

Expression

Patterns:
  • [the] enchantment bonus
Since: 2.5
Usable in events: enchant prepare
Return Type:
The enchantment bonus in an enchant prepare event. This represents the number of bookshelves affecting/surrounding the enchantment table.

Examples:

on enchant:
    send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player

Enchantment Level

🔗

Expression

Patterns:
Since: 2.0
Return Type:
The level of a particular enchantment on an item.

Examples:

player's tool is a sword of sharpness:
    message "You have a sword of sharpness %level of sharpness of the player's tool% equipped"

Enchantment Offer

🔗

Expression

Patterns:
  • [all [of]] [the] enchant[ment] offers
  • enchant[ment] offer[s] %numbers%
  • [the] %number%(st|nd|rd|th) enchant[ment] offer
Since: 2.5
Usable in events: enchant prepare
Requirements: 1.11 or newer
Return Type: enchantmentoffer
The enchantment offer in enchant prepare events.

Examples:

on enchant prepare:
    send "Your enchantment offers are: %the enchantment offers%" to player

Enchantment Offer Cost

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.11 or newer
Return Type:
The cost of an enchantment offer. This is displayed to the right of an enchantment offer. If the cost is changed, it will always be at least 1. This changes how many levels are required to enchant, but does not change the number of levels removed. To change the number of levels removed, use the enchant event.

Examples:

set cost of enchantment offer 1 to 50

Ender Chest

🔗

Expression

Patterns:
Since: 2.0
Return Type: inventory
The ender chest of a player.

Examples:

open the player's ender chest to the player

Entities

🔗

Expression

Patterns:
Since: 1.2.1, 2.5 (chunks)
Return Type: entity
All entities in all worlds, in a specific world, in a chunk or in a radius around a certain location, e.g. all players, all creepers in the player's world, or players in radius 100 of the player.

Examples:

kill all creepers in the player's world
send "Psst!" to all players within 100 meters of the player
give a diamond to all ops
heal all tamed wolves in radius 2000 around {town center}
delete all monsters in chunk at player

Entity AI

🔗

Expression

Patterns:
Since: 2.5
Return Type: boolean
Returns whether an entity has AI.

Examples:

set artificial intelligence of target entity to false

Entity Attribute

🔗

Expression

Patterns:
Since: 2.5, 2.6.1 (final attribute value)
Return Type: number
The numerical value of an entity's particular attribute. Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead. Resetting an entity's attribute is only available in Minecraft 1.11 and above.

Examples:

on damage of player:
    send "You are wounded!"
    set victim's attack speed attribute to 2

Entity Owner

🔗

Expression

Patterns:
Since: 2.5
Return Type: offlineplayer
The owner of a tameable entity, such as a horse or wolf.

Examples:

set owner of target entity to player
delete owner of target entity
set {_t} to uuid of tamer of target entity

Exhaustion

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type: number
The exhaustion of a player. This is mainly used to determine the rate of hunger depletion.

Examples:

set exhaustion of all players to 1

Experience

🔗

Expression

Patterns:
  • [the] [(spawned|dropped)] [e]xp[erience] [orb[s]]
Since: 2.1, 2.5.3 (block break event)
Usable in events: experience spawn, break / mine
Return Type: experience
How much experience was spawned in an experience spawn or block break event. Can be changed.

Examples:

on experience spawn:
    add 5 to the spawned experience
on break of coal ore:
    clear dropped experience
on break of diamond ore:
    if tool of player = diamond pickaxe:
        add 100 to dropped experience

Exploded Blocks

🔗

Expression

Patterns:
  • [the] exploded blocks
Since: 2.5
Usable in events: explode
Return Type: block
Get all the blocks that were destroyed in an explode event

Examples:

on explode:
    loop exploded blocks:
        add loop-block to {exploded::blocks::*}

Explosion Block Yield

🔗

Expression

Patterns:
  • [the] [explosion['s]] block (yield|amount)
  • [the] percentage of blocks dropped
Since: 2.5
Usable in events: explosion
Return Type: number
The percentage of exploded blocks dropped in an explosion event. When changing the yield, a value greater than 1 will function the same as using 1. Attempting to change the yield to a value less than 0 will have no effect.

Examples:

on explode:
set the explosion's block yield to 10%

Explosion Yield

🔗

Expression

Patterns:
  • [the] explosion (yield|radius|size)
  • [the] (yield|radius|size) of [the] explosion
Since: 2.5
Usable in events: explosion prime
Return Type: number
The yield of the explosion in an explosion prime event. This is how big the explosion is. When changing the yield, values less than 0 will be ignored. Read this wiki page for more information

Examples:

on explosion prime:
    set the yield of the explosion to 10

Explosive Yield

🔗

Expression

Patterns:
  • [the] explosive (yield|radius|size) of %entities%
  • %entities%'[s] explosive (yield|radius|size)
Since: 2.5
Requirements: Minecraft 1.12 or newer for creepers
Return Type: number
The yield of an explosive (creeper, primed tnt, fireball, etc.). This is how big of an explosion is caused by the entity. Read this wiki page for more information

Examples:

on spawn of a creeper:
    set the explosive yield of the event-entity to 10

Facing

🔗

Expression

Patterns:
Since: 1.4
Return Type: direction
The facing of an entity or block, i.e. exactly north, south, east, west, up or down (unlike direction which is the exact direction, e.g. '0.5 south and 0.7 east')

Examples:

# makes a bridge
loop blocks from the block below the player in the horizontal facing of the player:
    set loop-block to cobblestone

Fall Distance

🔗

Expression

Patterns:
  • [the] fall[en] (distance|height) of %entities%
  • %entities%'[s] fall[en] (distance|height)
Since: 2.5
Return Type: number
The distance an entity has fallen for.

Examples:

set all entities' fall distance to 10
on damage:
    send "%victim's fall distance%" to victim

Fertilized Blocks

🔗

Expression

Patterns:
  • [all] [the] fertilized blocks
Since: 2.5
Usable in events: block fertilize
Requirements: Minecraft 1.13 or newer
Return Type: block
The blocks fertilized in block fertilize events.

Examples:

the fertilized blocks

Filter

🔗

Expression

Patterns:
  • %objects% (where|that match) \[<.+>\]
Since: 2.2-dev36
Return Type: object
Filters a list based on a condition. For example, if you ran 'broadcast "something" and "something else" where [string input is "something"]', only "something" would be broadcast as it is the only string that matched the condition.

Examples:

send "congrats on being staff!" to all players where [player input has permission "staff"]

Filter Input

🔗

Expression

Patterns:
  • input
  • %*type% input
Since: 2.2-dev36
Return Type: object
Represents the input in a filter expression. 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.

Examples:

send "congrats on being staff!" to all players where [input has permission "staff"]

Final Damage

🔗

Expression

Patterns:
  • [the] final damage
Since: 2.2-dev19
Usable in events: damage
Return Type: number
How much damage is done in a damage event, considering all types of damage reduction. Can NOT be changed.

Examples:

send "%final damage%" to victim

Firework Effect

🔗

Expression

Patterns:
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors%
  • [(flickering|trailing|flickering trailing|trailing flickering)] %firework type% [firework [effect]] colo[u]red %colors% fad(e|ing) [to] %colors%
Since: 2.4
Return Type: fireworkeffect
Represents a 'firework effect' which can be used in the launch firework effect.

Examples:

launch flickering trailing burst firework colored blue and green at player
launch trailing flickering star colored purple, yellow, blue, green and red fading to pink at target entity
launch ball large colored red, purple and white fading to light green and black at player's location with duration 1

Flight Mode

🔗

Expression

Patterns:
  • [the] fl(y[ing]|ight) (mode|state) of %players%
  • %players%'[s] fl(y[ing]|ight) (mode|state)
Since: 2.2-dev34
Return Type: boolean
Whether the player(s) are allowed to fly. Use Make Fly effect to force player(s) to fly.

Examples:

set flight mode of player to true
send "%flying state of all players%"

Food Level

🔗

Expression

Patterns:
  • [the] (food|hunger)[[ ](level|met(er|re)|bar)] [of %players%]
  • %players%'[s] (food|hunger)[[ ](level|met(er|re)|bar)]
Since: 1.0
Return Type: number
The food level of a player from 0 to 10. Has several aliases: food/hunger level/meter/bar.

Examples:

set the player's food level to 10

Formatted Date

🔗

Expression

Patterns:
  • %dates% formatted [human-readable] [(with|as) %text%]
  • [human-readable] formatted %dates% [(with|as) %text%]
Since: 2.2-dev31, INSERT VERSION (support variables in format)
Return Type: string
Converts date to human-readable text format. By default, 'yyyy-MM-dd HH:mm:ss z' (e.g. '2018-03-30 16:03:12 +01') will be used. For reference, see this Wikipedia article.

Examples:

command /date:
    trigger:
        send "Full date: %now formatted human-readable%" to sender
        send "Short date: %now formatted as ""yyyy-MM-dd""%" to sender

Former/Future State

🔗

Expression

Patterns:
  • [the] (former|past|old) [state] [of] %~object%
  • %~object% before [the event]
  • [the] (future|to-be|new) [state] [of] %~object%
  • %~object%(-to-be| after[(wards| the event)])
Since: 1.1
Return Type: object
Represents the value of an expression before an event happened or the value it will have directly after the event, e.g. the old or new level respectively in a level change event. Note: The past, future and present states of an expression are sometimes called 'time states' of an expression. Note 2: If you don't specify whether to use the past or future state of an expression that has different values, its default value will be used which is usually the value after the event.

Examples:

on teleport:
    former world was "world_nether" # or 'world was'
    world will be "world" # or 'world after the event is'
on tool change:
    past tool is an axe
    the tool after the event will be air
on weather change:
    set {weather::%world%::old} to past weather
    set {weather::%world%::current} to the new weather

Freeze Time

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type: timespan
How much time an entity has been in powdered snow for.

Examples:

player's freeze time is less than 3 seconds:
    send "you're about to freeze!" to the player

Furnace Slot

🔗

Expression

Patterns:
  • (fuel|result) [slot]
  • (ore|fuel|result)[s] [slot[s]] of %blocks%
  • %blocks%'[s] (ore|fuel|result)[s] [slot[s]]
Since: 1.0
Usable in events: smelt, fuel burn
Return Type: slot
A slot of a furnace, i.e. either the ore, fuel or result slot. Remember to use 'block' and not 'furnace', as 'furnace' is not an existing expression.

Examples:

set the fuel slot of the clicked block to a lava bucket
set the block's ore slot to 64 iron ore
give the result of the block to the player
clear the result slot of the block

Game Mode

🔗

Expression

Patterns:
Since: 1.0
Return Type: gamemode
The gamemode of a player. (Gamemodes)

Examples:

player's gamemode is survival
set the player's gamemode to creative

Gamerule Value

🔗

Expression

Patterns:
Since: 2.5
Requirements: Minecraft 1.13+
Return Type: gamerulevalue
The gamerule value of a world.

Examples:

set the gamerule commandBlockOutput of world "world" to false

Gliding State

🔗

Expression

Patterns:
Since: 2.2-dev21
Return Type: boolean
Sets of gets gliding state of player. It allows you to set gliding state of entity even if they do not have an Elytra equipped.

Examples:

set gliding of player to off

Glowing

🔗

Expression

Patterns:
Since: 2.2-dev18
Return Type: boolean
Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.

Examples:

set glowing of player to true

Gravity

🔗

Expression

Patterns:
Since: 2.2-dev21
Return Type: boolean
If entity is affected by gravity or not, i.e. if it has Minecraft 1.10+ NoGravity flag.

Examples:

set gravity of player off

Group

🔗

Expression

Patterns:
Since: 2.2-dev35
Requirements: Vault, a permission plugin that supports Vault
Return Type: string
The primary group or all groups of a player. This expression requires Vault and a compatible permissions plugin to be installed.

Examples:

on join:
    broadcast "%group of player%" # this is the player's primary group
    broadcast "%groups of player%" # this is all of the player's groups

Hanging Entity/Remover

🔗

Expression

Patterns:
  • [the] hanging (entity|remover)
Since: 2.6.2
Return Type: entity
Returns the hanging entity or remover in hanging break and place events.

Examples:

on break of item frame:
    if item of hanging entity is diamond pickaxe:
        cancel event
        if hanging remover is a player:
            send "You can't break that item frame!" to hanging remover

Hash

🔗

Expression

Patterns:
  • %texts% hash[ed] with (MD5|SHA-256)
Since: 2.0, 2.2-dev32 (SHA-256 algorithm)
Return Type: string
Hashes the given text using the MD5 or SHA-256 algorithms. Each algorithm is suitable for different use cases.

MD5 is provided mostly for backwards compatibility, as it is outdated and not secure. SHA-256 is more secure, and can used to hash somewhat confidental data like IP addresses and even passwords. It is not that secure out of the box, so please consider using salt when dealing with passwords! When hashing data, you must specify algorithms that will be used for security reasons!

Please note that a hash cannot be reversed under normal circumstanses. You will not be able to get original value from a hash with Skript.

Examples:

command /setpass <text>:
    trigger:
        set {password::%uuid of player%} to text-argument hashed with SHA-256
command /login <text>:
    trigger:
        if text-argument hashed with SHA-256 is {password::%uuid of player%}:
            message "Login successful."
        else:
            message "Wrong password!"

Hatching Entity Type

🔗

Expression

Patterns:
  • [the] hatching entity [type]
Since: INSERT VERSION
Usable in events: Egg Throw
Return Type: entitydata
The type of the entity that will be hatched in a Player Egg Throw event.

Examples:

on player egg throw:
    set the hatching entity type to a primed tnt

Hatching Number

🔗

Expression

Patterns:
  • [the] hatching number
Since: INSERT VERSION
Usable in events: Egg Throw
Return Type:
The number of entities that will be hatched in a Player Egg Throw event. Please note that no more than 127 entities can be hatched at once.

Examples:

on player egg throw:
    set the hatching number to 10

Head location

🔗

Expression

Patterns:
Since: 2.0
Return Type: location
The location of an entity's head, mostly useful for players and e.g. looping blocks in the player's line of sight. Please note that this location is only accurate for entities whose head is exactly above their center, i.e. players, endermen, zombies, skeletons, etc., but not sheep, pigs or cows.

Examples:

set the block at the player's head to air
set the block in front of the player's eyes to glass
loop blocks in front of the player's head:

Heal Amount

🔗

Expression

Patterns:
  • [the] heal amount
Since: 2.5.1
Usable in events: heal
Return Type: number
The amount of health healed in a healing event.

Examples:

increase heal amount by 2
remove 0.5 from heal amount

Heal Reason

🔗

Expression

Patterns:
  • (regen|health regain|heal) (reason|cause)
Since: 2.5
Return Type: healreason
The heal reason of a heal event. Please click on the link for more information.

Examples:

on heal:
    if heal reason = satiated:
        send "You ate enough food and gained health back!" to player

Health

🔗

Expression

Patterns:
Since: 1.0
Usable in events: damage
Return Type: number
The health of a creature, e.g. a player, mob, villager, etc. The minimum value is 0, and the maximum is the creature's max health (e.g. 10 for players).

Examples:

message "You have %health% HP left."

Hidden Players

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] hidden players (of|for) %players%
  • [(all [[of] the]|the)] players hidden (from|for|by) %players%
Since: 2.3
Return Type: player
The players hidden from a player that were hidden using the player visibility effect.

Examples:

message "<light red>You are currently hiding: <light gray>%hidden players of the player%"

Highest Solid Block

🔗

Expression

Patterns:
  • highest [(solid|non-air)] block at %locations%
Since: 2.2-dev34
Return Type: block
Returns the highest solid block at the x and z coordinates of the world of a given location.

Examples:

highest block at location of arg-player

Hostname

🔗

Expression

Patterns:
  • [the] (host|domain)[ ][name]
Since: 2.6.1
Return Type: string
The hostname used by the connecting player to connect to the server in a connect event.

Examples:

on connect:
    hostname is "testers.example.com"
    send "Welcome back tester!"

Hotbar Button

🔗

Expression

Patterns:
  • [the] hotbar button
Since: 2.5
Return Type:
The hotbar button clicked in an inventory click event.

Examples:

on inventory click:
    send "You clicked the hotbar button %hotbar button%!"

Hotbar Slot

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] hotbar slot of %players%
  • %players%'[s] [([currently] selected|current)] hotbar slot
Since: 2.2-dev36
Return Type: slot
The currently selected hotbar slot. To retrieve its number use Slot Index expression.

Examples:

message "%player's current hotbar slot%"
set player's selected hotbar slot to slot 4 of player
send "index of player's current hotbar slot = 1" # second slot from the left

Hover List

🔗

Expression

Patterns:
  • [the] [custom] [(player|server)] (hover|sample) ([message] list|message)
  • [the] [custom] player [(hover|sample)] list
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: string
The list when you hover on the player counts of the server in the server list. This can be changed using texts or players in a server list ping event only. Adding players to the list means adding the name of the players. And note that, for example if there are 5 online players (includes fake online count) in the server and the hover list is set to 3 values, Minecraft will show "... and 2 more ..." at end of the list.

Examples:

on server list ping:
    clear the hover list
    add "&aWelcome to the &6Minecraft &aserver!" to the hover list
    add "" to the hover list # A blank line
    add "&cThere are &6%online players count% &conline players!" to the hover list

Humidity

🔗

Expression

Patterns:
  • [the] humidit(y|ies) of %blocks%
  • %blocks%'[s] humidit(y|ies)
Since: 2.2-dev35
Return Type: number
Humidity of given blocks.

Examples:

set {_humidity} to event-block's humidity

IP

🔗

Expression

Patterns:
  • IP[s][( |-)address[es]] of %players%
  • %players%'[s] IP[s][( |-)address[es]]
  • IP[( |-)address]
Since: 1.4, 2.2-dev26 (when used in connect event), 2.3 (when used in server list ping event)
Return Type: string
The IP address of a player, or the connected player in a connect event, or the pinger in a server list ping event.

Examples:

ban the IP address of the player
broadcast "Banned the IP %IP of player%"

on connect:
    log "[%now%] %player% (%ip%) is connected to the server."

on server list ping:
    send "%IP-address%" to the console

Id

🔗

Expression

Patterns:
Since: 1.0
Return Type:
The id of a specific item. You usually don't need this expression as you can likely do everything with aliases.

Examples:

message "the ID of %type of the clicked block% is %id of the clicked block%."

Index Of

🔗

Expression

Patterns:
  • [the] [(first|last)] index of %text% in %text%
Since: 2.1
Return Type:
The first or last index of a character (or text) in a text, or -1 if it doesn't occur in the text. Indices range from 1 to the length of the text.

Examples:

set {_first} to the first index of "@" in the text argument
if {_s} contains "abc":
    set {_s} to the first (index of "abc" in {_s} + 3) characters of {_s} # removes everything after the first "abc" from {_s}

Indices of List

🔗

Expression

Patterns:
  • [(the|all [[of] the])] (indexes|indices) of %~objects%
  • %~objects%'[s] (indexes|indices)
  • [sorted] (indices|indexes) of %~objects% in (ascending|descending) order
  • [sorted] %~objects%'[s] (indices|indexes) in (ascending|descending) order
Since: 2.4 (indices), 2.6.1 (sorting)
Return Type: string
Returns all the indices of a list variable, optionally sorted by their values. To sort the indices, all objects in the list must be comparable; Otherwise, this expression will just return the unsorted indices.

Examples:

set {l::*} to "some", "cool" and "values"
broadcast "%indices of {l::*}%" # result is 1, 2 and 3

set {_leader-board::first} to 17
set {_leader-board::third} to 30
set {_leader-board::second} to 25
set {_leader-board::fourth} to 42
set {_ascending-indices::*} to sorted indices of {_leader-board::*} in ascending order
broadcast "%{_ascending-indices::*}%" #result is first, second, third, fourth
set {_descending-indices::*} to sorted indices of {_leader-board::*} in descending order
broadcast "%{_descending-indices::*}%" #result is fourth, third, second, first

Inventory

🔗

Expression

Patterns:
  • [the] inventor(y|ies) of %inventoryholders%
  • %inventoryholders%'[s] inventor(y|ies)
Since: 1.0
Return Type: object
The inventory of a block or player. You can usually omit this expression and can directly add or remove items to/from blocks or players.

Examples:

add a plank to the player's inventory
clear the player's inventory
remove 5 wool from the inventory of the clicked block

Inventory Action

🔗

Expression

Patterns:
  • [the] inventory action
Since: 2.2-dev16
Return Type: inventoryaction
The inventory action of an inventory event. Please click on the link for more information.

Examples:

inventory action is pickup all

Inventory Holder/Viewers/Rows/Slots

🔗

Expression

Patterns:
  • (holder[s]|viewers|[amount of] rows|[amount of] slots) of %inventories%
  • %inventories%'[s] (holder[s]|viewers|[amount of] rows|[amount of] slots)
Since: 2.2-dev34, 2.5 (slots)
Return Type: object
Gets the amount of rows/slots, viewers and holder of an inventory.

NOTE: 'Viewers' expression returns a list of players viewing the inventory. Note that a player is considered to be viewing their own inventory and internal crafting screen even when said inventory is not open.

Examples:

event-inventory's amount of rows
holder of player's top inventory
{_inventory}'s viewers

Inventory Slot

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type: slot
Represents a slot in an inventory. It can be used to change the item in an inventory too.

Examples:

if slot 0 of player is air:
    set slot 0 of player to 2 stones
    remove 1 stone from slot 0 of player
    add 2 stones to slot 0 of player
    clear slot 1 of player

Item

🔗

Expression

Patterns:
  • [the] item
Since: unknown (before 2.1)
Return Type: itemstack
The item involved in an event, e.g. in a drop, dispense, pickup or craft event.

Examples:

on dispense:
    item is a clock
    set the time to 6:00

Item Amount

🔗

Expression

Patterns:
Since: 2.2-dev24
Return Type:
The amount of an item stack.

Examples:

send "You have got %item amount of player's tool% %player's tool% in your hand!" to player

Item Enchantments

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: enchantmenttype
All the enchantments an item type has.

Examples:

clear enchantments of event-item

Item of an Entity

🔗

Expression

Patterns:
Since: 2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles)
Requirements: Minecraft 1.15.2+ (throwable projectiles)
Return Type: slot
An item associated with an entity. For dropped item entities, it gets, obviously, the item that was dropped. For item frames, the item inside the frame is returned. For throwable projectiles (snowballs, enderpearls etc.),it gets the displayed item. Other entities do not have items associated with them.

Examples:

Missing examples.

Item with CustomModelData

🔗

Expression

Patterns:
Since: 2.5
Requirements: 1.14+
Return Type: itemtype
Get an item with a CustomModelData tag. (Value is an integer between 0 and 99999999)

Examples:

give player a diamond sword with custom model data 2
set slot 1 of inventory of player to wooden hoe with custom model data 357

Item with Lore

🔗

Expression

Patterns:
Since: 2.3
Return Type: itemtype
Returns the given item type with the specified lore added to it. If multiple strings are passed, each of them will be a separate line in the lore.

Examples:

set {_test} to stone with lore "line 1" and "line 2"
give {_test} to player

Items In

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] items ([with]in|of|contained in|out of) [inventor(y|ies)] %inventories%
Since: 2.0
Return Type: slot
All items in an inventory. Useful for looping or storing in a list variable. Please note that the positions of the items in the inventory are not saved, only their order is preserved.

Examples:

loop all items in the player's inventory:
    loop-item is enchanted
    remove loop-item from the player
set {inventory::%uuid of player%::*} to items in the player's inventory

Join & Split

🔗

Expression

Patterns:
  • (concat[enate]|join) %texts% [(with|using|by) [[the] delimiter] %text%]
  • split %text% (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • %text% split (at|using|by) [[the] delimiter] %text% [with case sensitivity]
  • regex split %text% (at|using|by) [[the] delimiter] %text%
  • regex %text% split (at|using|by) [[the] delimiter] %text%
Since: 2.1, 2.5.2 (regex support), INSERT VERSION (case sensitivity)
Return Type: string
Joins several texts with a common delimiter (e.g. ", "), or splits a text into multiple texts at a given delimiter.

Examples:

message "Online players: %join all players with "" | ""%" # %all players% would use the default "x, y, and z"
set {_s::*} to the string argument split at ","

Language

🔗

Expression

Patterns:
  • [the] [([currently] selected|current)] [game] (language|locale) [setting] of %players%
  • %players%'[s] [([currently] selected|current)] [game] (language|locale) [setting]
Since: 2.3
Return Type: string
Currently selected game language of a player. The value of the language is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.

Examples:

message player's current language

Last Attacker

🔗

Expression

Patterns:
  • [the] last attacker of %entity%
  • %entity%'[s] last attacker
Since: 2.5.1
Return Type: object
The last block or entity that attacked an entity.

Examples:

send "%last attacker of event-entity%"

Last Color

🔗

Expression

Patterns:
  • [the] last color[s] of %texts%
  • %texts%'[s] last color[s]
Since: 2.6
Return Type: string
The colors used at the end of a string. The colors of the returned string will be formatted with their symbols.

Examples:

set {_color} to the last colors of "heyyo"

Last Damage

🔗

Expression

Patterns:
Since: 2.5.1
Return Type: number
The last damage that was done to an entity. Note that changing it doesn't deal more/less damage.

Examples:

set last damage of event-entity to 2

Last Damage Cause

🔗

Expression

Patterns:
Since: 2.2-Fixes-V10
Return Type: damagecause
Cause of last damage done to an entity

Examples:

set last damage cause of event-entity to fire tick

Last Loaded Server Icon

🔗

Expression

Patterns:
  • [the] [last[ly]] loaded server icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: cachedservericon
Returns the last loaded server icon with the load server icon effect.

Examples:

set {server-icon} to the last loaded server icon

Last Resource Pack Response

🔗

Expression

Patterns:
  • [the] [last] resource pack response[s] of %players%
  • %players%'[s] [last] resource pack response[s]
Since: 2.4
Requirements: Paper 1.9 or newer
Return Type: resourcepackstate
Returns the last resource pack response received from a player.

Examples:

if player's last resource pack response is deny or download fail:

Last Spawned Entity

🔗

Expression

Patterns:
  • [the] [last[ly]] (spawned|shot) %*entity type%
  • [the] [last[ly]] dropped (item)
  • [the] [last[ly]] (created|struck) (lightning)
  • [the] [last[ly]] (launched|deployed) (firework)
Since: 1.3 (spawned entity), 2.0 (shot entity), 2.2-dev26 (dropped item), INSERT VERSION (struck lightning, firework)
Return Type: entity
Holds the entity that was spawned most recently with the spawn effect (section), dropped with the drop effect, shot with the shoot effect or created with the lightning effect. Please note that even though you can spawn multiple mobs simultaneously (e.g. with 'spawn 5 creepers'), only the last spawned mob is saved and can be used. If you spawn an entity, shoot a projectile and drop an item you can however access all them together.

Examples:

spawn a priest
set {healer::%spawned priest%} to true
shoot an arrow from the last spawned entity
ignite the shot projectile
drop a diamond sword
push last dropped item upwards
teleport player to last struck lightning
delete last launched firework

Last/First Login Time

🔗

Expression

Patterns:
Since: 2.5
Return Type: date
When a player last/first logged in the server. 'last login' requires paper to get the last login, otherwise it will get the last time they were seen on the server.

Examples:

command /onlinefor:
    trigger:
        send "You have been online for %difference between player's last login and now%."
        send "You first joined the server %difference between player's first login and now% ago."

Leash Holder

🔗

Expression

Patterns:
Since: 2.3
Return Type: entity
The leash holder of a living entity.

Examples:

set {_example} to the leash holder of the target mob

Length

🔗

Expression

Patterns:
Since: 2.1
Return Type:
The length of a text, in number of characters.

Examples:

set {_l} to length of the string argument

Level

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Usable in events: level change
Return Type:
The level of a player.

Examples:

reduce the victim's level by 1
set the player's level to 0

Level Progress

🔗

Expression

Patterns:
Since: 2.0
Usable in events: level change
Return Type: number
The player's progress in reaching the next level, this represents the experience bar in the game. Please note that this value is between 0 and 1 (e.g. 0.5 = half experience bar). Changing this value can cause the player's level to change if the resulting level progess is negative or larger than 1, e.g. increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.

Examples:

# use the exp bar as mana
on rightclick with a blaze rod:
    player's level progress is larger than 0.2
    shoot a fireball from the player
    reduce the player's level progress by 0.2
every 2 seconds:
    loop all players:
        level progress of loop-player is smaller than 0.9:
            increase level progress of the loop-player by 0.1
        else:
            set level progress of the loop-player to 0.99
on xp spawn:
    cancel event

Light Level

🔗

Expression

Patterns:
Since: 1.3.4
Return Type:
Gets the light level at a certain location which ranges from 0 to 15. It can be separated into sunlight (15 = direct sunlight, 1-14 = indirect) and block light (torches, glowstone, etc.). The total light level of a block is the maximum of the two different light types.

Examples:

# set vampire players standing in bright sunlight on fire
every 5 seconds:
    loop all players:
        {vampire::%uuid of loop-player%} is true
        sunlight level at the loop-player is greater than 10
        ignite the loop-player for 5 seconds

Loaded Plugins

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] [loaded] plugins
Since: INSERT VERSION
Return Type: string
An expression to obtain a list of the names of the server's loaded plugins.

Examples:

if the loaded plugins contains "Vault":
    broadcast "This server uses Vault plugin!"

send "Plugins (%size of loaded plugins%): %plugins%" to player

Location

🔗

Expression

Patterns:
  • [the] [event-](location|position)
Since: 2.0
Return Type: location
The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).

Examples:

drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'
set {_loc} to the location 1 meter above the player

Location

🔗

Expression

Patterns:
Since: 2.0
Return Type: location
The location where an event happened (e.g. at an entity or block), or a location relative to another (e.g. 1 meter above another location).

Examples:

drop 5 apples at the event-location # exactly the same as writing 'drop 5 apples'
set {_loc} to the location 1 meter above the player

Location

🔗

Expression

Patterns:
Since: Unknown
Return Type: location
The location of a block or entity. This not only represents the x, y and z coordinates of the location but also includes the world and the direction an entity is looking (e.g. teleporting to a saved location will make the teleported entity face the same saved direction every time). Please note that the location of an entity is at it's feet, use head location to get the location of the head.

Examples:

set {home::%uuid of player%} to the location of the player
message "You home was set to %player's location% in %player's world%."

Location At

🔗

Expression

Patterns:
  • [the] (location|position) [at] [\(][x[ ][=[ ]]]%number%, [y[ ][=[ ]]]%number%, [and] [z[ ][=[ ]]]%number%[\)] [[(in|of) [[the] world]] %world%]
Since: 2.0
Return Type: location
Allows to create a location from three coordinates and a world.

Examples:

set {_loc} to the location at arg-1, arg-2, arg-3 of the world arg-4
distance between the player and the location (0, 0, 0) is less than 200

Loop value

🔗

Expression

Patterns:
  • [the] loop-<.+>
Since: 1.0
Return Type: object
The currently looped value.

Examples:

# countdown:
loop 10 times:
    message "%11 - loop-number%"
    wait a second
# generate a 10x10 floor made of randomly colored wool below the player:
loop blocks from the block below the player to the block 10 east of the block below the player:
    loop blocks from the loop-block to the block 10 north of the loop-block:
        set loop-block-2 to any wool

Lore

🔗

Expression

Patterns:
Since: 2.1
Return Type: string
An item's lore.

Examples:

set the 1st line of the item's lore to "<orange>Excalibur 2.0"

MOTD

🔗

Expression

Patterns:
  • [the] [(default)|(shown|displayed)] (MOTD|message of [the] day)
Since: 2.3
Return Type: string
The message of the day in the server list. This can be changed in a server list ping event only. 'default MOTD' returns the default MOTD always and can't be changed.

Examples:

on server list ping:
    set the motd to "Join now!"

Max Durability

🔗

Expression

Patterns:
Since: 2.5
Return Type:
The maximum durability of an item.

Examples:

maximum durability of diamond sword
if max durability of player's tool is not 0: # Item is damageable

Max Health

🔗

Expression

Patterns:
Since: 2.0
Usable in events: damage, death
Return Type: number
The maximum health of an entity, e.g. 10 for a player.

Examples:

on join:
    set the maximum health of the player to 100
spawn a giant
set the last spawned entity's max health to 1000

Max Minecart Speed

🔗

Expression

Patterns:
  • [the] max[imum] minecart (speed|velocity) of %entities%
  • %entities%'[s] max[imum] minecart (speed|velocity)
Since: 2.5.1
Return Type: number
The maximum speed of a minecart.

Examples:

on right click on minecart:
    set max minecart speed of event-entity to 1

Max Players

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] player[s] [(count|amount|number|size)]
  • [the] [((real|default)|(fake|shown|displayed))] max[imum] (count|amount|number|size) of players
Since: 2.3
Return Type:
The count of max players. This can be changed in a server list ping event only. 'real max players' returns the real count of max players of the server always and can't be changed.

Examples:

on server list ping:
    set the max players count to (online players count + 1)

Maximum Freeze Time

🔗

Expression

Patterns:
  • [the] max[imum] freeze time of %entities%
  • %entities%'[s] max[imum] freeze time
Since: INSERT VERSION
Return Type: timespan
The maximum amount of time an entity can spend in powdered snow before taking damage.

Examples:

difference between player's freeze time and player's max freeze time is less than 1 second:
    send "you're about to freeze!" to the player

Maximum Stack Size

🔗

Expression

Patterns:
Since: 2.1
Return Type:
The maximum stack size of the specified material, e.g. 64 for torches, 16 for buckets, and 1 for swords.

Examples:

send "You can only pick up %max stack size of player's tool% of %type of (player's tool)%" to player

Me

🔗

Expression

Patterns:
  • me
  • my[self]
Since: 2.1.1
Return Type: player
A 'me' expression that can be used in players' effect commands only.

Examples:

!heal me
!kick myself
!give a diamond axe to me

Mending Repair Amount

🔗

Expression

Patterns:
  • [the] [mending] repair amount
Since: 2.5.1
Return Type:
The number of durability points an item is to be repaired in a mending event. Modifying the repair amount will affect how much experience is given to the player after mending.

Examples:

on item mend:
    set the mending repair amount to 100

Message

🔗

Expression

Patterns:
  • [the] [chat( |-)]message
  • [the] (join|log[ ]in)( |-)message
  • [the] (quit|leave|log[ ]out|kick)( |-)message
  • [the] death( |-)message
Since: 1.4.6 (chat message), 1.4.9 (join & quit messages), 2.0 (death message)
Usable in events: chat, join, quit, death
Return Type: string
The (chat) message of a chat event, the join message of a join event, the quit message of a quit event, or the death message on a death event. This expression is mostly useful for being changed.

Examples:

on chat:
    player has permission "admin"
    set message to "&c%message%"

on first join:
    set join message to "Welcome %player% to our awesome server!"

on join:
    player has played before
    set join message to "Welcome back, %player%!"

on quit:
    set quit message to "%player% left this awesome server!"

on death:
    set the death message to "%player% died!"

Metadata

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: object
Metadata is a way to store temporary data on entities, blocks and more that disappears after a server restart.

Examples:

set metadata value "healer" of player to true
broadcast "%metadata value ""healer"" of player%"
clear metadata value "healer" of player

Middle of Location

🔗

Expression

Patterns:
  • [the] (middle|center) [point] of %location%
  • %location%'[s] (middle|center) [point]
Since: 2.6.1
Return Type: location
Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.

Examples:

command /stuck:
    executable by: players
    trigger:
        teleport player to the center of player's location
        send "You're no longer stuck."

Minecart Derailed / Flying Velocity

🔗

Expression

Patterns:
  • [the] [minecart] (derailed|flying) velocity of %entities%
  • %entities%'[s] [minecart] (derailed|flying) velocity
Since: 2.5.1
Return Type: vector
The velocity of a minecart as soon as it has been derailed or as soon as it starts flying.

Examples:

on right click on minecart:
    set derailed velocity of event-entity to vector 2, 10, 2

Money

🔗

Expression

Patterns:
Since: 2.0, 2.5 (offline players)
Requirements: Vault, an economy plugin that supports Vault
Return Type: money
How much virtual money a player has (can be changed).

Examples:

message "You have %player's money%" # the currency name will be added automatically
remove 20$ from the player's balance # replace '$' by whatever currency you use
add 200 to the player's account # or omit the currency altogether

Moved blocks

🔗

Expression

Patterns:
  • [the] moved blocks
Since: 2.2-dev27
Return Type: block
Blocks which are moved in a piston event. Cannot be used outside of piston events.

Examples:

the moved blocks

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: string
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Name / Display Name / Tab List Name

🔗

Expression

Patterns:
  • [the] ((player|tab)[ ]list name[s]) of %players%
  • %players%'[s] ((player|tab)[ ]list name[s])
Since: before 2.1, 2.2-dev20 (inventory name), 2.4 (non-living entity support, changeable inventory name)
Return Type: string
Represents the Minecraft account, display or tab list name of a player, or the custom name of an item, entity, block, inventory, or gamerule.

        
  • Players         
                  
    • Name: The Minecraft account name of the player. Can't be changed, but 'display name' can be changed.
    •             
    • Display Name: The name of the player that is displayed in messages. This name can be changed freely and can include color codes, and is shared among all plugins (e.g. chat plugins will use the display name).
    •         
        
  •     
  • Entities         
                  
    • Name: The custom name of the entity. Can be changed. But for living entities, the players will have to target the entity to see its name tag. For non-living entities, the name will not be visible at all. To prevent this, use 'display name'.
    •             
    • Display Name: The custom name of the entity. Can be changed, which will also enable custom name visibility of the entity so name tag of the entity will be visible always.
    •         
        
  •     
  • Items         
                  
    • Name and Display Name: The custom name of the item (not the Minecraft locale name). Can be changed.
    •         
        
  •     
  • Inventories         
                  
    • Name and Display Name: The name/title of the inventory. Changing name of an inventory means opening the same inventory with the same contents but with a different name to its current viewers.
    •         
        
  •     
  • Gamerules (1.13+)         
                  
    • Name: The name of the gamerule. Cannot be changed.
    •         
        

Examples:

on join:
    player has permission "name.red"
    set the player's display name to "<red>[admin] <gold>%name of player%"
    set the player's tab list name to "<green>%player's name%"
set the name of the player's tool to "Legendary Sword of Awesomeness"

Named Item/Inventory

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev34 (inventories)
Return Type: object
Directly names an item/inventory, useful for defining a named item/inventory in a script. If you want to (re)name existing items/inventories you can either use this expression or use set name of <item/inventory> to <text>.

Examples:

give a diamond sword of sharpness 100 named "<gold>Excalibur" to the player
set tool of player to the player's tool named "<gold>Wand"
set the name of the player's tool to "<gold>Wand"
open hopper inventory named "Magic Hopper" to player

New Line

🔗

Expression

Patterns:
  • n[ew]l[ine]
  • line[ ]break
Since: 2.5
Return Type: string
Returns a line break separator.

Examples:

send "Hello%nl%Goodbye!" to player

No Damage Ticks

🔗

Expression

Patterns:
Since: 2.5
Return Type:
The number of ticks that an entity is invulnerable to damage for.

Examples:

on damage:
    set victim's invulnerability ticks to 20 #Victim will not take damage for the next second

Now

🔗

Expression

Patterns:
  • now
Since: 1.4
Return Type: date
The current system time of the server. Use time to get the Minecraft time of a world.

Examples:

broadcast "Current server time: %now%"

Number of Characters

🔗

Expression

Patterns:
  • number of upper[ ]case char(acters|s) in %text%
  • number of lower[ ]case char(acters|s) in %text%
  • number of digit char(acters|s) in %text%
Since: 2.5
Return Type:
The number of uppercase, lowercase, or digit characters in a string.

Examples:

#Simple Chat Filter
on chat:
    if number of uppercase chars in message / length of message > 0.5
        cancel event
        send "<red>Your message has to many caps!" to player

Numbers

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] (numbers|integers|decimals) (between|from) %number% (and|to) %number%
Since: 1.4.6 (integers & numbers), 2.5.1 (decimals)
Return Type: number
All numbers between two given numbers, useful for looping. Use 'numbers' if your start is not an integer and you want to keep the fractional part of the start number constant, or use 'integers' if you only want to loop integers. You may also use 'decimals' if you want to use the decimal precision of the start number. You may want to use the 'times' expression instead, for instance 'loop 5 times:'

Examples:

loop numbers from 2.5 to 5.5: # loops 2.5, 3.5, 4.5, 5.5
loop integers from 2.9 to 5.1: # same as '3 to 5', i.e. loops 3, 4, 5
loop decimals from 3.94 to 4: # loops 3.94, 3.95, 3.96, 3.97, 3.98, 3.99, 4

Offline players

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] offline[ ]players
Since: 2.2-dev35
Return Type: offlineplayer
All players that have ever joined the server. This includes the players currently online.

Examples:

send "Size of all players who have joined the server: %size of all offline players%"

Online Player Count

🔗

Expression

Patterns:
  • [the] [((real|default)|(fake|shown|displayed))] [online] player (count|amount|number)
  • [the] [((real|default)|(fake|shown|displayed))] (count|amount|number|size) of online players
Since: 2.3
Return Type:
The amount of online players. This can be changed in a server list ping event only to show fake online player amount. 'real online player count' always returns the real count of online players and can't be changed.

Fake online player count requires PaperSpigot 1.12.2+.

Examples:

on server list ping:
    # This will make the max players count 5 if there are 4 players online.
    set the fake max players count to (online players count + 1)

Opened Inventory

🔗

Expression

Patterns:
  • [the] (current|open|top) inventory [of %players%]
  • %players%'[s] (current|open|top) inventory
Since: 2.2-dev24, 2.2-dev35 (Just 'current inventory' works in player events)
Return Type: inventory
Return the currently opened inventory of a player. If no inventory is open, it returns the own player's crafting inventory.

Examples:

set slot 1 of player's current inventory to diamond sword

Parse

🔗

Expression

Patterns:
Since: 2.0
Return Type: object
Parses text as a given type, or as a given pattern. This expression can be used in two different ways: One which parses the entire text as a single instance of a type, e.g. as a number, and one that parses the text according to a pattern. If the given text could not be parsed, this expression will return nothing and the parse error will be set if some information is available. Some notes about parsing with a pattern: - The pattern must be a Skript pattern, e.g. percent signs are used to define where to parse which types, e.g. put a %number% or %items% in the pattern if you expect a number or some items there. - You have to save the expression's value in a list variable, e.g. set {parsed::*} to message parsed as "...". - The list variable will contain the parsed values from all %types% in the pattern in order. If a type was plural, e.g. %items%, the variable's value at the respective index will be a list variable, e.g. the values will be stored in {parsed::1::*}, not {parsed::1}.

Examples:

set {var} to line 1 parsed as number
on chat:
    set {var::*} to message parsed as "buying %items% for %money%"
    if parse error is set:
        message "%parse error%"
    else if {var::*} is set:
        cancel event
        remove {var::2} from the player's balance
        give {var::1::*} to the player

Parse Error

🔗

Expression

Patterns:
  • [the] [last] [parse] error
Since: 2.0
Return Type: string
The error which caused the last parse operation to fail, which might not be set if a pattern was used and the pattern didn't match the provided text at all.

Examples:

set {var} to line 1 parsed as integer
if {var} is not set:
    parse error is set:
        message "<red>Line 1 is invalid: %last parse error%"
    else:
        message "<red>Please put an integer on line 1!"

Passenger

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev26 (Multiple passengers for 1.11.2+)
Return Type: entity
The passenger of a vehicle, or the rider of a mob. For 1.11.2 and above, it returns a list of passengers and you can use all changers in it. See also: vehicle

Examples:

#for 1.11 and lower
passenger of the minecart is a creeper or a cow
the saddled pig's passenger is a player
#for 1.11.2+
passengers of the minecart contains a creeper or a cow
the boat's passenger contains a pig
add a cow and a zombie to passengers of last spawned boat
set passengers of player's vehicle to a pig and a horse
remove all pigs from player's vehicle
clear passengers of boat

Pickup Delay

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type: timespan
The amount of time before a dropped item can be picked up by an entity.

Examples:

drop diamond sword at {_location} without velocity
set pickup delay of last dropped item to 5 seconds

Ping

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type:
Pings of players, as Minecraft server knows them. Note that they will almost certainly be different from the ones you'd get from using ICMP echo requests. This expression is only supported on some server software (PaperSpigot).

Examples:

command /ping :
    trigger:
        send "%arg-1%'s ping is %arg-1's ping%"

Plain Item

🔗

Expression

Patterns:
Since: 2.6
Return Type: itemtype
A plain item is an item with no modifications. It can be used to convert items to their default state or to match with other default items.

Examples:

if the player's tool is a plain diamond: # check if player's tool has no modifications
    send "You are holding a plain diamond!"

Player List Header and Footer

🔗

Expression

Patterns:
  • [the] (player|tab)[ ]list (header|footer) [(text|message)] of %players%
  • %players%'[s] (player|tab)[ ]list (header|footer) [(text|message)]
Since: 2.4
Requirements: Minecraft 1.13 or newer
Return Type: string
The message above and below the player list in the tab menu.

Examples:

set all players' tab list header to "Welcome to the Server!"
send "%the player's tab list header%" to player
reset all players' tab list header

Player Protocol Version

🔗

Expression

Patterns:
Since: 2.6.2
Requirements: Paper 1.12.2 or newer
Return Type:
Player's protocol version. For more information and list of protocol versions visit wiki.vg.

Examples:

command /protocolversion <player>:
    trigger:
        send "Protocol version of %arg-1%: %protocol version of arg-1%"

Player Skull

🔗

Expression

Patterns:
Since: 2.0
Return Type: itemtype
Gets a skull item representing a player. Skulls for other entities are provided by the aliases.

Examples:

give the victim's skull to the attacker
set the block at the entity to the entity's skull

Player Weather

🔗

Expression

Patterns:
  • [the] [(client|custom)] weather of %players%
  • %players%'[s] [(client|custom)] weather
Since: 2.2-dev34
Return Type: weathertype
The weather for a player.

Examples:

set weather of arg-player to rainy
reset player's weather
if arg-player's weather is rainy

Portal

🔗

Expression

Patterns:
  • [the] portal['s] blocks
  • [the] blocks of [the] portal
Since: 2.4
Usable in events: portal_create
Return Type: block
The blocks associated with a portal in the portal creation event.

Examples:

on portal creation:
    loop portal blocks:
        broadcast "%loop-block% is part of a portal!"

Potion Effect

🔗

Expression

Patterns:
  • [new] potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
  • [new] ambient potion effect of %potion% [potion] [[[of] tier] %number%] [without particles] [for %time span%]
Since: 2.5.2
Return Type: potioneffect
Create a new potion effect to apply to an entity or item type. Do note that when applying potion effects to tipped arrows/lingering potions, Minecraft reduces the timespan.

Examples:

set {_p} to potion effect of speed of tier 1 without particles for 10 minutes
add {_p} to potion effects of player's tool
add {_p} to potion effects of target entity
add potion effect of speed 1 to potion effects of player

Potion Effect Tier

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type:
An expression to obtain the amplifier of a potion effect applied to an entity.

Examples:

if the amplifier of haste of player >= 3:

Potion Effects

🔗

Expression

Patterns:
Since: 2.5.2
Return Type: potioneffect
Represents the active potion effects of entities and itemtypes. You can clear all potion effects of an entity/itemtype and add/remove a potion effect/type to/from an entity/itemtype. Do note you will not be able to clear the base potion effects of a potion item. In that case, just set the item to a water bottle. When adding a potion effect type (rather than a potion effect), it will default to 15 seconds with tier 1.

Examples:

set {_p::*} to active potion effects of player
clear all the potion effects of player
clear all the potion effects of player's tool
add potion effects of player to potion effects of player's tool
add speed to potion effects of target entity
remove speed and night vision from potion effects of player

Prefix/Suffix

🔗

Expression

Patterns:
  • [the] [chat] (prefix|suffix) of %players%
  • %players%'[s] [chat] (prefix|suffix)
Since: 2.0
Requirements: Vault, a chat plugin that supports Vault
Return Type: string
The prefix or suffix as defined in the server's chat plugin.

Examples:

on chat:
    cancel event
    broadcast "%player's prefix%%player's display name%%player's suffix%: %message%" to the player's world

set the player's prefix to "[<red>Admin] "

Projectile Bounce State

🔗

Expression

Patterns:
  • [the] projectile bounce (state|ability|mode) of %projectiles%
  • %projectiles%'[s] projectile bounce (state|ability|mode)
Since: 2.5.1
Return Type: boolean
A projectile's bounce state.

Examples:

on projectile hit:
    set projectile bounce mode of event-projectile to true

Projectile Critical State

🔗

Expression

Patterns:
  • [the] (projectile|arrow) critical (state|ability|mode) of %projectiles%
  • %projectiles%'[s] (projectile|arrow) critical (state|ability|mode)
Since: 2.5.1
Return Type: boolean
A projectile's critical state. The only currently accepted projectiles are arrows and tridents.

Examples:

on shoot:
    event-projectile is an arrow
    set projectile critical mode of event-projectile to true

Protocol Version

🔗

Expression

Patterns:
  • [the] [server] [(sent|required|fake)] protocol version [number]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type:
The protocol version that will be sent as the protocol version of the server in a server list ping event. For more information and list of protocol versions visit wiki.vg. If this protocol version doesn't match with the protocol version of the client, the client will see the version string. But please note that, this expression has no visual effect over the version string. For example if the server uses PaperSpigot 1.12.2, and you make the protocol version 107 (1.9), the version string will not be "Paper 1.9", it will still be "Paper 1.12.2". But then you can customize the version string as you wish. Also if the protocol version of the player is higher than protocol version of the server, it will say "Server out of date!", and if vice-versa "Client out of date!" when you hover on the ping bars.

This can be set in a server list ping event only (increase and decrease effects cannot be used because that wouldn't make sense).

Examples:

on server list ping:
    set the version string to "<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

Random

🔗

Expression

Patterns:
Since: 1.4.9
Return Type: object
Gets a random item out of a set, e.g. a random player out of all players online.

Examples:

give a diamond to a random player out of all players
give a random item out of all items to the player

Random Number

🔗

Expression

Patterns:
  • [a] random (integer|number) (from|between) %number% (to|and) %number%
Since: 1.4
Return Type: number
A random number or integer between two given numbers. Use 'number' if you want any number with decimal parts, or use use 'integer' if you only want whole numbers. Please note that the order of the numbers doesn't matter, i.e. random number between 2 and 1 will work as well as random number between 1 and 2.

Examples:

set the player's health to a random number between 5 and 10
send "You rolled a %random integer from 1 to 6%!" to the player

Random UUID

🔗

Expression

Patterns:
  • [a] random uuid
Since: 2.5.1
Return Type: string
Returns a random UUID.

Examples:

set {_uuid} to random uuid

Raw Name

🔗

Expression

Patterns:
Since: unknown (2.2)
Return Type: string
The raw Minecraft material name of the given item. Note that this is not guaranteed to give same results on all servers.

Examples:

raw name of tool of player

Raw String

🔗

Expression

Patterns:
Since: INSERT VERSION
Return Type: string
Returns the string without formatting (colors etc.) and without stripping them from it, e.g. raw "&aHello There!" would output &aHello There!

Examples:

send raw "&aThis text is unformatted!" to all players

Redstone Block Power

🔗

Expression

Patterns:
  • [the] redstone power of %blocks%
  • %blocks%'[s] redstone power
Since: 2.5
Return Type:
Power of a redstone block

Examples:

if redstone power of targeted block is 15:
    send "This block is very powerful!"

Region

🔗

Expression

Patterns:
  • [the] [event-]region
Since: 2.1
Requirements: Supported regions plugin
Return Type: region
The region involved in an event. This expression requires a supported regions plugin to be installed.

Examples:

on region enter:
    region is {forbidden region}
    cancel the event

Region Members & Owners

🔗

Expression

Patterns:
  • [(all|the)] (members|owner[s]) of [[the] region[s]] %regions%
  • [[the] region[s]] %regions%'[s] (members|owner[s])
Since: 2.1
Requirements: Supported regions plugin
Return Type: offlineplayer
A list of members or owners of a region. This expression requires a supported regions plugin to be installed.

Examples:

on entering of a region:
    message "You're entering %region% whose owners are %owners of region%"

Regions At

🔗

Expression

Patterns:
Since: 2.1
Requirements: Supported regions plugin
Return Type: region
All regions at a particular location. This expression requires a supported regions plugin to be installed.

Examples:

On click on a sign:
    line 1 of the clicked block is "[region info]"
    set {_regions::*} to regions at the clicked block
    if {_regions::*} is empty:
        message "No regions exist at this sign."
    else:
        message "Regions containing this sign: <gold>%{_regions::*}%."

Remaining Air

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: timespan
How much time a player has left underwater before starting to drown.

Examples:

player's remaining air is less than 3 seconds:
    send "hurry, get to the surface!" to the player

Respawn location

🔗

Expression

Patterns:
  • [the] respawn location
Since: 2.2-dev35
Return Type: location
The location that a player should respawn at. This is used within the respawn event.

Examples:

on respawn:
    set respawn location to {example::spawn}

Reversed List

🔗

Expression

Patterns:
Since: 2.4
Return Type: object
Reverses given list.

Examples:

set {_list::*} to reversed {_list::*}

Rounding

🔗

Expression

Patterns:
  • [(a|the)] round[ed] down %number%
  • [(a|the)] round[ed] %number%
  • [(a|the)] round[ed] up %number%
Since: 2.0
Return Type:
Rounds numbers normally, up (ceiling) or down (floor) respectively.

Examples:

set {var} to rounded health of player
set line 1 of the block to rounded "%(1.5 * player's level)%"
add rounded down argument to the player's health

Saturation

🔗

Expression

Patterns:
Since: 2.2-Fixes-v10, 2.2-dev35 (fully modifiable), 2.6.2 (syntax pattern changed)
Return Type: number
The saturation of a player. If used in a player event, it can be omitted and will default to event-player.

Examples:

set saturation of player to 20

Scoreboard Tags

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] scoreboard tags of %entities%
  • %entities%'[s] scoreboard tags
Since: 2.3
Return Type: string
Scoreboard tags are simple list of texts stored directly in the data of an entity. So this is a Minecraft related thing, not Bukkit, so the tags will not get removed when the server stops. You can visit visit Minecraft Wiki for more info. This is changeable and valid for any type of entity. Also you can use use the Has Scoreboard Tag condition to check whether an entity has the given tags.

Requires Minecraft 1.11+ (actually added in 1.9 to the game, but added in 1.11 to Spigot).

Examples:

on spawn of a monster:
    if the spawn reason is mob spawner:
        add "spawned by a spawner" to the scoreboard tags of event-entity

on death of a monster:
    if the attacker is a player:
        if the victim doesn't have the scoreboard tag "spawned by a spawner":
            add 1$ to attacker's balance

Script Name

🔗

Expression

Patterns:
  • [the] script[['s] name]
  • name of [the] script
Since: 2.0
Usable in events: Script Load/Unload
Return Type: string
Holds the current script's name (the file name without '.sk').

Examples:

on script load:
    set {running::%script%} to true
on script unload:
    set {running::%script%} to false

Sea Level

🔗

Expression

Patterns:
Since: 2.5.1
Return Type:
Gets the sea level of a world.

Examples:

send "The sea level in your world is %sea level in player's world%"

Server Icon

🔗

Expression

Patterns:
  • [the] [((default)|(shown|sent))] [server] icon
Since: 2.3
Requirements: Paper 1.12.2 or newer
Return Type: cachedservericon
Icon of the server in the server list. Can be set to an icon that loaded using the load server icon effect, or can be reset to the default icon in a server list ping. 'default server icon' returns the default server icon (server-icon.png) always and cannot be changed.

Examples:

on script load:
    set {server-icons::default} to the default server icon

Sets

🔗

Expression

Patterns:
  • [(all [[of] the]|the|every)] item(s|[ ]types)
  • [(all [[of] the]|the)] items of type[s] %item types%
  • [(all [[of] the]|the|every)] block(s|[ ]types)
  • [(all [[of] the]|the)] blocks of type[s] %item types%
  • ([all [[of] the]] colo[u]rs|(the|every) colo[u]r)
Since: unknown (before 1.4.2), INSERT VERSION (colors)
Return Type: object
Collection sets of items or blocks of a specific type or colours, useful for looping.

Examples:

loop items of type ore and log:
    block contains loop-item
    message "Theres at least one %loop-item% in this block"
drop all blocks at the player # drops one of every block at the player

Shooter

🔗

Expression

Patterns:
Since: 1.3.7
Return Type: livingentity
The shooter of a projectile.

Examples:

shooter is a skeleton

Shuffled List

🔗

Expression

Patterns:
Since: 2.2-dev32
Return Type: object
Shuffles given list randomly. This is done by replacing indices by random numbers in resulting list.

Examples:

set {_list::*} to shuffled {_list::*}

Sign Text

🔗

Expression

Patterns:
  • [the] line %number% [of %block%]
  • [the] (1st|first|2nd|second|3rd|third|4th|fourth) line [of %block%]
Since: 1.3
Return Type: string
A line of text on a sign. Can be changed, but remember that there is a 16 character limit per line (including color codes that use 2 characters each).

Examples:

on rightclick on sign:
    line 2 of the clicked block is "[Heal]":
        heal the player
    set line 3 to "%player%"

Slot Index

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type:
Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.

Examples:

if index of event-slot is 10:
    send "You bought a pie!"

Sorted List

🔗

Expression

Patterns:
Since: 2.2-dev19
Return Type: object
Sorts given list in natural order. All objects in list must be comparable; if they're not, this expression will return nothing.

Examples:

set {_sorted::*} to sorted {_players::*}

Spawn

🔗

Expression

Patterns:
  • [the] spawn[s] [(point|location)[s]] [of %worlds%]
  • %worlds%'[s] spawn[s] [(point|location)[s]]
Since: 1.4.2
Return Type: location
The spawn point of a world.

Examples:

teleport all players to spawn
set the spawn point of "world" to the player's location

Spawn Reason

🔗

Expression

Patterns:
  • [the] spawn[ing] reason
Since: 2.3
Return Type: spawnreason
The spawn reason in a spawn event.

Examples:

on spawn:
    spawn reason is reinforcements or breeding

Spawner Type

🔗

Expression

Patterns:
  • [the] (spawner|entity|creature) type[s] of %blocks%
  • %blocks%'[s] (spawner|entity|creature) type[s]
Since: 2.4
Return Type: entitydata
Retrieves, sets, or resets the spawner's entity type

Examples:

on right click:
    if event-block is spawner:
        send "Spawner's type is %target block's entity type%"

Special Number

🔗

Expression

Patterns:
  • (NaN|[(-|minus)](infinity|∞)) value
  • value of (NaN|[(-|minus)](infinity|∞))
Since: 2.2-dev32d
Return Type: number
Special number values, namely NaN, Infinity and -Infinity

Examples:

if {_number} is NaN value:

Spectator Target

🔗

Expression

Patterns:
Since: 2.4
Return Type: entity
Returns the entity which is followed by the camera of the player when in spectator mode.

Examples:

command /spectate :
    executable by: players
    trigger:
        set gamemode of player to spectator # otherwise below won't do anything
        set spectator target of player to arg-1
        send "Spectating %arg-1%" to player

Speed

🔗

Expression

Patterns:
  • [the] (walk[ing]|fl(y[ing]|ight))[( |-)]speed of %players%
  • %players%'[s] (walk[ing]|fl(y[ing]|ight))[( |-)]speed
Since: unknown (before 2.1)
Return Type: number
A player's walking or flying speed. Both can be changed, but values must be between -1 and 1 (excessive values will be changed to -1 or 1 respectively). Negative values reverse directions. Please note that changing a player's speed will change their FOV just like potions do.

Examples:

set the player's walk speed to 1
increase the argument's fly speed by 0.1

Subtext

🔗

Expression

Patterns:
  • [the] (part|sub[ ](text|string)) of %texts% (between|from) [ind(ex|ices)|character[s]] %number% (and|to) [(index|character)] %number%
  • [the] (first|last) [%number%] character[s] of %texts%
  • [the] %number% (first|last) characters of %texts%
  • [the] character[s] at [(index|position|indexes|indices|positions)] %numbers% (in|of) %texts%
Since: 2.1, 2.5.2 (character at, multiple strings support)
Return Type: string
Extracts part of a text. You can either get the first <x> characters, the last <x> characters, the character at index <x>, or the characters between indices <x> and <y>. The indices <x> and <y> should be between 1 and the length of the text (other values will be fit into this range).

Examples:

set {_s} to the first 5 characters of the text argument
message "%subtext of {_s} from characters 2 to (the length of {_s} - 1)%" # removes the first and last character from {_s} and sends it to the player or console
set {_characters::*} to characters at 1, 2 and 7 in player's display name
send the last character of all players' names

TPS (ticks per second)

🔗

Expression

Patterns:
  • tps from [the] last ([1] minute|1[ ]m[inute])
  • tps from [the] last 5[ ]m[inutes]
  • tps from [the] last 15[ ]m[inutes]
  • [the] tps
Since: 2.2-dev36
Return Type: number
Returns the 3 most recent TPS readings, like the /tps command. This expression is only supported on some server software (PaperSpigot).

Examples:

broadcast "%tps%"

Tamer

🔗

Expression

Patterns:
  • [the] tamer
Since: 2.2-dev25
Return Type: player
The tamer of an entity. Can only be used in entity tame events. You can use 'event-entity' to refer tamed entity itself.

Examples:

on tame:
    if the tamer is a player:
        send "someone tamed something!" to console

Target

🔗

Expression

Patterns:
Since: unknown (before 2.1)
Return Type: entity
For players this is the entity at the crosshair, while for mobs and experience orbs it represents the entity they are attacking/following (if any).

Examples:

on entity target:
    entity's target is a player
    send "You're being followed by an %entity%!" to target of entity

Targeted Block

🔗

Expression

Patterns:
  • [the] target[ed] block[s] [of %players%]
  • %players%'[s] target[ed] block[s]
  • [the] actual[ly] target[ed] block[s] [of %players%]
  • %players%'[s] actual[ly] target[ed] block[s]
Since: 1.0
Return Type: block
The block at the crosshair. This regards all blocks that are not air as fully solid, e.g. torches will be like a solid stone block for this expression.

Examples:

# A command to set the block a player looks at to a specific type:
command /setblock <material>:
    trigger:
        set targeted block to argument

Teleport Cause

🔗

Expression

Patterns:
  • [the] teleport (cause|reason|type)
Since: 2.2-dev35
Return Type: teleportcause
The teleport cause within a player teleport event.

Examples:

on teleport
    teleport cause is nether portal, end portal or end gateway

Temperature

🔗

Expression

Patterns:
  • [the] temperature[s] of %blocks%
  • %blocks%'[s] temperature[s]
Since: 2.2-dev35
Return Type: number
Temperature at given block.

Examples:

message "%temperature of the targeted block%"

Ternary

🔗

Expression

Patterns:
Since: 2.2-dev36
Return Type: object
A shorthand expression for returning something based on a condition.

Examples:

set {points} to 500 if {admin::%player's uuid%} is set else 100

The Egg

🔗

Expression

Patterns:
  • [the] [thrown] egg
Since: INSERT VERSION
Usable in events: Egg Throw
Return Type: projectile
The egg thrown in a Player Egg Throw event.

Examples:

spawn an egg at the egg

Time

🔗

Expression

Patterns:
  • [the] time[s] [([with]in|of) %worlds%]
  • %worlds%'[s] time[s]
Since: 1.0
Return Type: time
The time of a world.

Examples:

time in world is between 18:00 and 6:00:
    broadcast "It's night-time, watch out for monsters!"

Time Played

🔗

Expression

Patterns:
Since: 2.5, INSERT VERSION (offline players)
Requirements: MC 1.15+ (offline players)
Return Type: timespan
The amount of time a player has played for on the server. This info is stored in the player's statistics in the main world's data folder. Changing this will also change the player's stats which can be views in the client's statistics menu. Using this expression on offline players on Minecraft 1.14 and below will return nothing <none>.

Examples:

set {_t} to time played of player
if player's time played is greater than 10 minutes:
    give player a diamond sword

set player's time played to 0 seconds

Time Since

🔗

Expression

Patterns:
  • [the] time since %dates%
Since: 2.5
Return Type: timespan
The time that has passed since a date. If the given date is in the future, a value will not be returned.

Examples:

send "%time since 5 minecraft days ago% has passed since 5 minecraft days ago!" to player

Tool

🔗

Expression

Patterns:
  • [the] ((tool|held item|weapon)|(off[ ]hand (tool|item))) [of %living entities%]
  • %living entities%'[s] ((tool|held item|weapon)|(off[ ]hand (tool|item)))
Since: 1.0
Return Type: slot
The item an entity is holding in their main or off hand.

Examples:

player's tool is a pickaxe
player's off hand tool is a shield
set tool of all players to a diamond sword
set offhand tool of target entity to a bow

Type of

🔗

Expression

Patterns:
Since: 1.4, 2.5.2 (potion effect)
Return Type: object
Type of a block, item, entity, inventory or potion effect. Types of items and blocks are item types similar to them but have amounts of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged. Types of entities and inventories are entity types and inventory types known to Skript. Types of potion effects are potion effect types.

Examples:

on rightclick on an entity:
    message "This is a %type of clicked entity%!"

UUID

🔗

Expression

Patterns:
Since: 2.1.2, 2.2 (offline players' UUIDs), 2.2-dev24 (other entities' UUIDs)
Return Type: string
The UUID of a player, entity or world. In the future there will be an option to use a player's UUID instead of the name in variable names (i.e. when %player% is used), but for now this can be used. Please note that this expression does not work for offline players if you are under 1.8!

Examples:

# prevents people from joining the server if they use the name of a player
# who has played on this server at least once since this script has been added
on login:
    if {uuid::%name of player%} exists:
        {uuid::%name of player%} is not uuid of player
        kick player due to "Someone with your name has played on this server before"
    else:
        set {uuid::%name of player%} to uuid of player

Unbreakable Items

🔗

Expression

Patterns:
Since: 2.2-dev13b
Return Type: itemtype
Creates unbreakable copies of given items.

Examples:

unbreakable iron sword #Creates unbreakable iron sword

Unix Date

🔗

Expression

Patterns:
Since: 2.5
Return Type: date
Converts given Unix timestamp to a date. The Unix timespan represents the number of seconds elapsed since 1 January 1970.

Examples:

unix date of 946684800 #1 January 2000 12:00 AM (UTC Time)

Unix Timestamp

🔗

Expression

Patterns:
  • [the] unix timestamp of %dates%
  • %dates%'[s] unix timestamp
Since: 2.2-dev31
Return Type: number
Converts given date to Unix timestamp. This is roughly how many seconds have elapsed since 1 January 1970.

Examples:

unix timestamp of now

Vectors - Angle Between

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: number
Gets the angle between two vectors.

Examples:

send "%the angle between vector 1, 0, 0 and vector 0, 1, 1%"

Vectors - Arithmetic

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Arithmetic expressions for vectors.

Examples:

set {_v} to vector 1, 2, 3 // 5
set {_v} to {_v} ++ {_v}
set {_v} to {_v} ++ 5
set {_v} to {_v} -- {_v}
set {_v} to {_v} -- 5
set {_v} to {_v} ** {_v}
set {_v} to {_v} ** 5
set {_v} to {_v} // {_v}
set {_v} to {_v} // 5

Vectors - Create from XYZ

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Creates a vector from x, y and z values.

Examples:

set {_v} to vector 0, 1, 0

Vectors - Cross Product

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Gets the cross product between two vectors.

Examples:

send "%vector 1, 0, 0 cross vector 0, 1, 0%"

Vectors - Cylindrical Shape

🔗

Expression

Patterns:
  • [a] [new] cylindrical vector [(from|with)] [radius] %number%, [yaw] %number%(,| and) [height] %number%
Since: 2.2-dev28
Return Type: vector
Forms a 'cylindrical shaped' vector using yaw to manipulate the current point.

Examples:

loop 360 times:
    set {_v} to cylindrical vector radius 1, yaw loop-value, height 2
set {_v} to cylindrical vector radius 1, yaw 90, height 2

Vectors - Dot Product

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: number
Gets the dot product between two vectors.

Examples:

set {_v} to {_v2} dot {_v3}

Vectors - Length

🔗

Expression

Patterns:
  • [the] (vector|standard|normal) length[s] of %vectors%
  • %vectors%'[s] (vector|standard|normal) length[s]
Since: 2.2-dev28
Return Type: number
Gets or sets the length of a vector.

Examples:

send "%standard length of vector 1, 2, 3%"
set {_v} to vector 1, 2, 3
set standard length of {_v} to 2
send "%standard length of {_v}%"

Vectors - Location Vector Offset

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: location
Returns the location offset by vectors.

Examples:

set {_loc} to {_loc} ~ {_v}

Vectors - Normalized

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Returns the same vector but with length 1.

Examples:

set {_v} to normalized {_v}

Vectors - Random Vector

🔗

Expression

Patterns:
  • [a] random vector
Since: 2.2-dev28, INSERT VERSION (signed components)
Return Type: vector
Creates a random vector.

Examples:

set {_v} to a random vector

Vectors - Spherical Shape

🔗

Expression

Patterns:
  • [new] spherical vector [(from|with)] [radius] %number%, [yaw] %number%(,| and) [pitch] %number%
Since: 2.2-dev28
Return Type: vector
Forms a 'spherical shaped' vector using yaw and pitch to manipulate the current point.

Examples:

loop 360 times:
    set {_v} to spherical vector radius 1, yaw loop-value, pitch loop-value
set {_v} to spherical vector radius 1, yaw 45, pitch 90

Vectors - Squared Length

🔗

Expression

Patterns:
  • [the] squared length[s] of %vectors%
  • %vectors%'[s] squared length[s]
Since: 2.2-dev28
Return Type: number
Gets the squared length of a vector.

Examples:

send "%squared length of vector 1, 2, 3%"

Vectors - Vector Between Locations

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Creates a vector between two locations.

Examples:

set {_v} to vector between {_loc1} and {_loc2}

Vectors - Vector from Location

🔗

Expression

Patterns:
Since: 2.2-dev28
Return Type: vector
Creates a vector from a location.

Examples:

set {_v} to vector of {_loc}

Vectors - Vector from Pitch and Yaw

🔗

Expression

Patterns:
  • [a] [new] vector (from|with) yaw %number% and pitch %number%
Since: 2.2-dev28
Return Type: vector
Creates a vector from a yaw and pitch value.

Examples:

set {_v} to vector from yaw 45 and pitch 45

Vectors - Velocity

🔗

Expression

Patterns:
Since: 2.2-dev31
Return Type: vector
Gets or changes velocity of an entity.

Examples:

set player's velocity to {_v}

Vectors - XYZ Component

🔗

Expression

Patterns:
  • [the] [vector] (x|y|z) [component[s]] of %vectors%
  • %vectors%'[s] [vector] (x|y|z) [component[s]]
Since: 2.2-dev28
Return Type: number
Gets or changes the x, y or z component of a vector.

Examples:

set {_v} to vector 1, 2, 3
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"

Vehicle

🔗

Expression

Patterns:
Since: 2.0
Return Type: entity
The vehicle an entity is in, if any. This can actually be any entity, e.g. spider jockeys are skeletons that ride on a spider, so the spider is the 'vehicle' of the skeleton. See also: passenger

Examples:

vehicle of the player is a minecart

Version

🔗

Expression

Patterns:
  • ([craft]bukkit|minecraft|skript)( |-)version
Since: 2.0
Return Type: string
The version of Bukkit, Minecraft or Skript respectively.

Examples:

message "This server is running Minecraft %minecraft version% on Bukkit %bukkit version%"
message "This server is powered by Skript %skript version%"

Version String

🔗

Expression

Patterns:
  • [the] [(shown|custom)] version [(string|text)]
Since: 2.3
Usable in events: server list ping
Requirements: Paper 1.12.2 or newer
Return Type: string
The text to show if the protocol version of the server doesn't match with protocol version of the client. You can check the protocol version expression for more information about this. This can only be set in a server list ping event.

Examples:

on server list ping:
    set the protocol version to 0 # 13w41a (1.7), so it will show the version string always
    set the version string to "<light green>Version: <orange>%minecraft version%"

View Distance of Client

🔗

Expression

Patterns:
  • [the] client view distance[s] of %players%
  • %players%'[s] client view distance[s]
Since: 2.5
Requirements: 1.13.2+
Return Type:
The view distance of the client. Can not be changed. This differs from the server side view distance of player as this will retrieve the view distance the player has set on their client.

Examples:

set {_clientView} to the client view distance of player
set view distance of player to client view distance of player

Weather

🔗

Expression

Patterns:
Since: 1.0
Usable in events: weather change
Return Type: weathertype
The weather in the given or the current world.

Examples:

set weather to clear
weather in "world" is rainy

Whitelist

🔗

Expression

Patterns:
  • [the] white[ ]list
Since: 2.5.2
Return Type: offlineplayer
A server's whitelist.This expression can be used to add/remove players to/from the whitelist, to enable it and disable it (set whitelist to true / set whitelist to false), and to empty it (reset whitelist)

Examples:

set whitelist to false
add all players to whitelist
reset the whitelist

World

🔗

Expression

Patterns:
Since: 1.0
Return Type: world
The world the event occurred in.

Examples:

world is "world_nether"
teleport the player to the world's spawn
set the weather in the player's world to rain
set {_world} to world of event-chunk

World Environment

🔗

Expression

Patterns:
  • [the] [world] environment of %worlds%
  • %worlds%'[s] [world] environment
Since: INSERT VERSION
Return Type: environment
The environment of a world

Examples:

if environment of player's world is nether:
    apply fire resistance to player for 10 minutes

World Seed

🔗

Expression

Patterns:
Since: 2.2-dev35
Return Type:
The seed of given world. Note that it will be returned as Minecraft internally treats seeds, not as you specified it in world configuration.

Examples:

broadcast "Seed: %seed of player's world%"

World from Name

🔗

Expression

Patterns:
  • [the] world [(named|with name)] %text%
Since: 2.6.1
Return Type: world
Returns the world from a string.

Examples:

world named {game::world-name}
the world "world"

Worlds

🔗

Expression

Patterns:
  • [(all [[of] the]|the)] worlds
Since: 1.0
Return Type: world
All worlds of the server, useful for looping.

Examples:

loop all worlds:
    broadcast "You're in %loop-world%" to loop-world

X Times

🔗

Expression

Patterns:
Since: 1.4.6
Return Type:
Integers between 1 and X, used in loops to loop X times.

Examples:

loop 20 times:
    broadcast "%21 - loop-number% seconds left.."
    wait 1 second

X of Item

🔗

Expression

Patterns:
Since: 1.2
Return Type: object
An expression to be able to use a certain amount of items where the amount can be any expression. Please note that this expression is not stable and might be replaced in the future.

Examples:

give level of player of pickaxes to the player

Yaw / Pitch

🔗

Expression

Patterns:
Since: 2.0, 2.2-dev28 (vector yaw/pitch)
Return Type: number
The yaw or pitch of a location or vector.

Examples:

log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"
set {_yaw} to yaw of player
set {_p} to pitch of target entity
\ No newline at end of file diff --git a/functions.html b/functions.html index a67cc751c65..7084d5c87cd 100644 --- a/functions.html +++ b/functions.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Functions

Note:

These functions are defined by Skript. You may also create your own functions! Tutorial for doing so is planned, but right now you need to seek it elsewhere.

abs

🔗

Function

Patterns:
  • abs(n: number)
Since: 2.2
Return Type: Number
Returns the absolute value of the argument, i.e. makes the argument positive.

Examples:

abs(3) = 3
abs(-2) = 2

acos

🔗

Function

Patterns:
  • acos(n: number)
Since: 2.2
Return Type: Number
The inverse of the cosine, also called arccos. Returns result in degrees, not radians. Only returns values from 0 to 180.

Examples:

acos(0) = 90
acos(1) = 0
acos(0.5) = 30

asin

🔗

Function

Patterns:
  • asin(n: number)
Since: 2.2
Return Type: Number
The inverse of the sine, also called arcsin. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

asin(0) = 0
asin(1) = 90
asin(0.5) = 30

atan

🔗

Function

Patterns:
  • atan(n: number)
Since: 2.2
Return Type: Number
The inverse of the tangent, also called arctan. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

atan(0) = 0
atan(1) = 45
atan(10000) = 89.9943

atan2

🔗

Function

Patterns:
  • atan2(x: number, y: number)
Since: 2.2
Return Type: Number
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).

Examples:

atan2(0, 1) = 0
atan2(10, 0) = 90
atan2(-10, 5) = -63.4349

calcExperience

🔗

Function

Patterns:
  • calcExperience(level: long)
Since: 2.2-dev32
Return Type: long
Calculates the total amount of experience needed to achieve given level from scratch in Minecraft.

Examples:

Missing examples.

ceil

🔗

Function

Patterns:
  • ceil(n: number)
Since: 2.2
Return Type: long
Rounds a number up, i.e. returns the closest integer larger than or equal to the argument.

Examples:

ceil(2.34) = 3
ceil(2) = 2
ceil(2.99) = 3

ceiling

🔗

Function

Patterns:
  • ceiling(n: number)
Since: 2.2
Return Type: long
Alias of ceil.

Examples:

ceiling(2.34) = 3
ceiling(2) = 2
ceiling(2.99) = 3

cos

🔗

Function

Patterns:
  • cos(n: number)
Since: 2.2
Return Type: Number
The cosine function. This is basically the sine shifted by 90°, i.e. cos(a) = sin(a + 90°), for any number a. Uses degrees, not radians.

Examples:

cos(0) = 1
cos(90) = 0

date

🔗

Function

Patterns:
  • date(year: number, month: number, day: number, hour: number = [[integer:0]], minute: number = [[integer:0]], second: number = [[integer:0]], millisecond: number = [[integer:0]], zone_offset: number = [[double:NaN]], dst_offset: number = [[double:NaN]])
Since: 2.2
Return Type: Date
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).

Examples:

date(2014, 10, 1) # 0:00, 1st October 2014
date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990
date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)

exp

🔗

Function

Patterns:
  • exp(n: number)
Since: 2.2
Return Type: Number
The exponential function. You probably don't need this if you don't know what this is.

Examples:

exp(0) = 1
exp(1) = 2.7183

floor

🔗

Function

Patterns:
  • floor(n: number)
Since: 2.2
Return Type: long
Rounds a number down, i.e. returns the closest integer smaller than or equal to the argument.

Examples:

floor(2.34) = 2
floor(2) = 2
floor(2.99) = 2

ln

🔗

Function

Patterns:
  • ln(n: number)
Since: 2.2
Return Type: Number
The natural logarithm. You probably don't need this if you don't know what this is. Returns NaN (not a number) if the argument is negative.

Examples:

ln(1) = 0
ln(exp(5)) = 5
ln(2) = 0.6931

location

🔗

Function

Patterns:
  • location(x: number, y: number, z: number, world: world = event-world, yaw: number = [[integer:0]], pitch: number = [[integer:0]])
Since: 2.2
Return Type: Location
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.

Examples:

location(0, 128, 0)
location(player's x-coordinate, player's y-coordinate + 5, player's z-coordinate, player's world, 0, 90)
location(0, 64, 0, world "world_nether")
location(100, 110, -145, world("my_custom_world"))

log

🔗

Function

Patterns:
  • log(n: number, base: number = [[integer:10]])
Since: 2.2
Return Type: Number
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.

Examples:

log(100) = 2 # 10^2 = 100
log(16, 2) = 4 # 2^4 = 16

max

🔗

Function

Patterns:
  • max(ns: numbers)
Since: 2.2
Return Type: Number
Returns the maximum number from a list of numbers.

Examples:

max(1) = 1
max(1, 2, 3, 4) = 4
max({some list variable::*})

min

🔗

Function

Patterns:
  • min(ns: numbers)
Since: 2.2
Return Type: Number
Returns the minimum number from a list of numbers.

Examples:

min(1) = 1
min(1, 2, 3, 4) = 1
min({some list variable::*})

mod

🔗

Function

Patterns:
  • mod(d: number, m: number)
Since: 2.2
Return Type: Number
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.

Examples:

mod(3, 2) = 1
mod(256436, 100) = 36
mod(-1, 10) = 9

product

🔗

Function

Patterns:
  • product(ns: numbers)
Since: 2.2
Return Type: Number
Calculates the product of a list of numbers.

Examples:

product(1) = 1
product(2, 3, 4) = 24
product({some list variable::*})
product(2, {_v::*}, and the player's y-coordinate)

rgb

🔗

Function

Patterns:
  • rgb(red: long, green: long, blue: long)
Since: 2.5
Return Type: Color
Returns a RGB color from the given red, green and blue parameters.

Examples:

dye player's leggings rgb(120, 30, 45)

round

🔗

Function

Patterns:
  • round(n: number)
Since: 2.2
Return Type: long
Rounds a number, i.e. returns the closest integer to the argument.

Examples:

round(2.34) = 2
round(2) = 2
round(2.99) = 3
round(2.5) = 3

sin

🔗

Function

Patterns:
  • sin(n: number)
Since: 2.2
Return Type: Number
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.

Examples:

sin(90) = 1
sin(60) = 0.866

sqrt

🔗

Function

Patterns:
  • sqrt(n: number)
Since: 2.2
Return Type: Number
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.

Examples:

sqrt(4) = 2
sqrt(2) = 1.4142
sqrt(-1) = NaN

sum

🔗

Function

Patterns:
  • sum(ns: numbers)
Since: 2.2
Return Type: Number
Sums a list of numbers.

Examples:

sum(1) = 1
sum(2, 3, 4) = 9
sum({some list variable::*})
sum(2, {_v::*}, and the player's y-coordinate)

tan

🔗

Function

Patterns:
  • tan(n: number)
Since: 2.2
Return Type: Number
The tangent function. This is basically sin(arg)/cos(arg). Uses degrees, not radians.

Examples:

tan(0) = 0
tan(45) = 1
tan(89.99) = 5729.5779

vector

🔗

Function

Patterns:
  • vector(x: number, y: number, z: number)
Since: 2.2-dev23
Return Type: Vector
Creates a new vector, which can be used with various expressions, effects and functions.

Examples:

vector(0, 0, 0)

world

🔗

Function

Patterns:
  • world(name: string)
Since: 2.2
Return Type: World
Gets a world from its name.

Examples:

set {_nether} to world("%{_world}%_nether")
\ No newline at end of file + Skript Documentation - 2.6.3

Functions

Note:

These functions are defined by Skript. You may also create your own functions! Tutorial for doing so is planned, but right now you need to seek it elsewhere.

abs

🔗

Function

Patterns:
  • abs(n: number)
Since: 2.2
Return Type: number
Returns the absolute value of the argument, i.e. makes the argument positive.

Examples:

abs(3) = 3
abs(-2) = 2

acos

🔗

Function

Patterns:
  • acos(n: number)
Since: 2.2
Return Type: number
The inverse of the cosine, also called arccos. Returns result in degrees, not radians. Only returns values from 0 to 180.

Examples:

acos(0) = 90
acos(1) = 0
acos(0.5) = 30

asin

🔗

Function

Patterns:
  • asin(n: number)
Since: 2.2
Return Type: number
The inverse of the sine, also called arcsin. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

asin(0) = 0
asin(1) = 90
asin(0.5) = 30

atan

🔗

Function

Patterns:
  • atan(n: number)
Since: 2.2
Return Type: number
The inverse of the tangent, also called arctan. Returns result in degrees, not radians. Only returns values from -90 to 90.

Examples:

atan(0) = 0
atan(1) = 45
atan(10000) = 89.9943

atan2

🔗

Function

Patterns:
  • atan2(x: number, y: number)
Since: 2.2
Return Type: number
Similar to atan, but requires two coordinates and returns values from -180 to 180. The returned angle is measured counterclockwise in a standard mathematical coordinate system (x to the right, y to the top).

Examples:

atan2(0, 1) = 0
atan2(10, 0) = 90
atan2(-10, 5) = -63.4349

calcExperience

🔗

Function

Patterns:
  • calcExperience(level: long)
Since: 2.2-dev32
Return Type:
Calculates the total amount of experience needed to achieve given level from scratch in Minecraft.

Examples:

Missing examples.

ceil

🔗

Function

Patterns:
  • ceil(n: number)
Since: 2.2
Return Type:
Rounds a number up, i.e. returns the closest integer larger than or equal to the argument.

Examples:

ceil(2.34) = 3
ceil(2) = 2
ceil(2.99) = 3

ceiling

🔗

Function

Patterns:
  • ceiling(n: number)
Since: 2.2
Return Type:
Alias of ceil.

Examples:

ceiling(2.34) = 3
ceiling(2) = 2
ceiling(2.99) = 3

cos

🔗

Function

Patterns:
  • cos(n: number)
Since: 2.2
Return Type: number
The cosine function. This is basically the sine shifted by 90°, i.e. cos(a) = sin(a + 90°), for any number a. Uses degrees, not radians.

Examples:

cos(0) = 1
cos(90) = 0

date

🔗

Function

Patterns:
  • date(year: number, month: number, day: number, hour: number = [[integer:0]], minute: number = [[integer:0]], second: number = [[integer:0]], millisecond: number = [[integer:0]], zone_offset: number = [[double:NaN]], dst_offset: number = [[double:NaN]])
Since: 2.2
Return Type: date
Creates a date from a year, month, and day, and optionally also from hour, minute, second and millisecond. A time zone and DST offset can be specified as well (in minutes), if they are left out the server's time zone and DST offset are used (the created date will not retain this information).

Examples:

date(2014, 10, 1) # 0:00, 1st October 2014
date(1990, 3, 5, 14, 30) # 14:30, 5th May 1990
date(1999, 12, 31, 23, 59, 59, 999, -3*60, 0) # almost year 2000 in parts of Brazil (-3 hours offset, no DST)

exp

🔗

Function

Patterns:
  • exp(n: number)
Since: 2.2
Return Type: number
The exponential function. You probably don't need this if you don't know what this is.

Examples:

exp(0) = 1
exp(1) = 2.7183

floor

🔗

Function

Patterns:
  • floor(n: number)
Since: 2.2
Return Type:
Rounds a number down, i.e. returns the closest integer smaller than or equal to the argument.

Examples:

floor(2.34) = 2
floor(2) = 2
floor(2.99) = 2

ln

🔗

Function

Patterns:
  • ln(n: number)
Since: 2.2
Return Type: number
The natural logarithm. You probably don't need this if you don't know what this is. Returns NaN (not a number) if the argument is negative.

Examples:

ln(1) = 0
ln(exp(5)) = 5
ln(2) = 0.6931

location

🔗

Function

Patterns:
  • location(x: number, y: number, z: number, world: world = event-world, yaw: number = [[integer:0]], pitch: number = [[integer:0]])
Since: 2.2
Return Type: location
Creates a location from a world and 3 coordinates, with an optional yaw and pitch. If for whatever reason the world is not found, it will fallback to the server's main world.

Examples:

location(0, 128, 0)
location(player's x-coordinate, player's y-coordinate + 5, player's z-coordinate, player's world, 0, 90)
location(0, 64, 0, world "world_nether")
location(100, 110, -145, world("my_custom_world"))

log

🔗

Function

Patterns:
  • log(n: number, base: number = [[integer:10]])
Since: 2.2
Return Type: number
A logarithm, with base 10 if none is specified. This is the inverse operation to exponentiation (for positive bases only), i.e. log(base ^ exponent, base) = exponent for any positive number 'base' and any number 'exponent'. Another useful equation is base ^ log(a, base) = a for any numbers 'base' and 'a'. Please note that due to how numbers are represented in computers, these equations do not hold for all numbers, as the computed values may slightly differ from the correct value. Returns NaN (not a number) if any of the arguments are negative.

Examples:

log(100) = 2 # 10^2 = 100
log(16, 2) = 4 # 2^4 = 16

max

🔗

Function

Patterns:
  • max(ns: numbers)
Since: 2.2
Return Type: number
Returns the maximum number from a list of numbers.

Examples:

max(1) = 1
max(1, 2, 3, 4) = 4
max({some list variable::*})

min

🔗

Function

Patterns:
  • min(ns: numbers)
Since: 2.2
Return Type: number
Returns the minimum number from a list of numbers.

Examples:

min(1) = 1
min(1, 2, 3, 4) = 1
min({some list variable::*})

mod

🔗

Function

Patterns:
  • mod(d: number, m: number)
Since: 2.2
Return Type: number
Returns the modulo of the given arguments, i.e. the remainder of the division d/m, where d and m are the arguments of this function. The returned value is always positive. Returns NaN (not a number) if the second argument is zero.

Examples:

mod(3, 2) = 1
mod(256436, 100) = 36
mod(-1, 10) = 9

product

🔗

Function

Patterns:
  • product(ns: numbers)
Since: 2.2
Return Type: number
Calculates the product of a list of numbers.

Examples:

product(1) = 1
product(2, 3, 4) = 24
product({some list variable::*})
product(2, {_v::*}, and the player's y-coordinate)

rgb

🔗

Function

Patterns:
  • rgb(red: long, green: long, blue: long)
Since: 2.5
Return Type: color
Returns a RGB color from the given red, green and blue parameters.

Examples:

dye player's leggings rgb(120, 30, 45)

round

🔗

Function

Patterns:
  • round(n: number)
Since: 2.2
Return Type:
Rounds a number, i.e. returns the closest integer to the argument.

Examples:

round(2.34) = 2
round(2) = 2
round(2.99) = 3
round(2.5) = 3

sin

🔗

Function

Patterns:
  • sin(n: number)
Since: 2.2
Return Type: number
The sine function. It starts at 0° with a value of 0, goes to 1 at 90°, back to 0 at 180°, to -1 at 270° and then repeats every 360°. Uses degrees, not radians.

Examples:

sin(90) = 1
sin(60) = 0.866

sqrt

🔗

Function

Patterns:
  • sqrt(n: number)
Since: 2.2
Return Type: number
The square root, which is the inverse operation to squaring a number (for positive numbers only). This is the same as (argument) ^ (1/2) – other roots can be calculated via number ^ (1/root), e.g. set {_l} to {_volume}^(1/3). Returns NaN (not a number) if the argument is negative.

Examples:

sqrt(4) = 2
sqrt(2) = 1.4142
sqrt(-1) = NaN

sum

🔗

Function

Patterns:
  • sum(ns: numbers)
Since: 2.2
Return Type: number
Sums a list of numbers.

Examples:

sum(1) = 1
sum(2, 3, 4) = 9
sum({some list variable::*})
sum(2, {_v::*}, and the player's y-coordinate)

tan

🔗

Function

Patterns:
  • tan(n: number)
Since: 2.2
Return Type: number
The tangent function. This is basically sin(arg)/cos(arg). Uses degrees, not radians.

Examples:

tan(0) = 0
tan(45) = 1
tan(89.99) = 5729.5779

vector

🔗

Function

Patterns:
  • vector(x: number, y: number, z: number)
Since: 2.2-dev23
Return Type: vector
Creates a new vector, which can be used with various expressions, effects and functions.

Examples:

vector(0, 0, 0)

world

🔗

Function

Patterns:
  • world(name: string)
Since: 2.2
Return Type: world
Gets a world from its name.

Examples:

set {_nether} to world("%{_world}%_nether")
\ No newline at end of file diff --git a/index.html b/index.html index aee5aaa89ea..d5441f538b1 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - Skript Documentation - 2.6.3

Documentation

Skript is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.

This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.

Quick Look

 command /sethome:
+              Skript Documentation - 2.6.3                

Documentation

Skript is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.

This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.

Quick Look

 command /sethome:
      permission: skript.home # Permission required for this command
      description: Set your home # Description of this command
      executable by: players # Console won't be able to run this command
@@ -19,4 +19,4 @@
          # Teleport the player to their home
          teleport player to {home::%uuid of player%}
          send "&aYou have been teleported."
- 

Latest Stable Version

Skript ${stable-version}

Latest Version

Skript ${latest-version}

Found something incorrect in this documentation? Please report it to the issue tracker.

We are looking for docs authors! Currently, the only documentation is generated automatically. It would be nice to have some hand-written content such as tutorials on the docs as well. For example, currently we don't have a tutorial on how to use loops here; This makes it harder for newcomers to learn. Check this issue for more details and if you're interested in helping out.

SkriptLang Team • Site developed by Ayham Al-Ali • Site Version ${site-version} • Generated on 30/07/2022

\ No newline at end of file +

Latest Stable Version

Skript ${stable-version}

Latest Version

Skript ${latest-version}

Found something incorrect in this documentation? Please report it to the issue tracker.

We are looking for docs authors! Currently, the only documentation is generated automatically. It would be nice to have some hand-written content such as tutorials on the docs as well. For example, currently we don't have a tutorial on how to use loops here; This makes it harder for newcomers to learn. Check this issue for more details and if you're interested in helping out.

SkriptLang Team • Site developed by Ayham Al-Ali • Site Version ${site-version} • Generated on 28/10/2022

\ No newline at end of file diff --git a/js/functions.js b/js/functions.js new file mode 100644 index 00000000000..d6f785ee7d9 --- /dev/null +++ b/js/functions.js @@ -0,0 +1,353 @@ +let isCookiesAccepted = getCookie("cookies-accepted") === "true"; + +// <> Cookies +function setCookie(cname, cvalue, exdays, force = false) { + if (!isCookiesAccepted && !force) + return; + + const d = new Date(); + d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); + let expires = "expires=" + d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/; SameSite=None; Secure"; +} + +function getCookie(cname) { + let name = cname + "="; + let ca = document.cookie.split(';'); + for (let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) == ' ') { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ""; +} + +// Cookies + +// <> localStorage + +/** + * Set the value of local storage item + * @param {string} item id + * @param {object} value + * @param {double} exdays time in days + */ +function setStorageItem(item, value, exdays, force = false) { + if (!isCookiesAccepted && !force) + return; + + const d = new Date(); + d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); + localStorage.setItem(item, value + "; " + d.getTime()); +} + +/** + * Remove a local storage item + * @param {string} item the id of the item + */ +function removeStorageItem(item) { + localStorage.removeItem(item) +} + +/** + * Get local storage item (value & time if has one) + * @param {string} item the item id + * @param {boolean} noExpireationCheck whether to check for expiration time and remove the item + * @returns the item object + */ +function getStorageItem(item, noExpireationCheck = false) { + let result = localStorage.getItem(item); + if (!result) + return null; + + if (!noExpireationCheck) { + if (isStorageItemExpired(result)) { + removeStorageItem(item); + return null; + } + } + result = result.split("; ")[0]; + return result; +} + +/** + * Get local storage item value after split at ';' + * @param {string} item the id of th item + * @returns the item value + */ +function getStorageItemValue(item) { + let result = localStorage.getItem(item); + if (!result) + return null; + return result.split("; ")[0]; +} + +/** + * @param {string} string the value of the item not the item id (the value without splitting) + * @returns the expiration date + */ +function getStorageItemExpiration(value) { + let expires = localStorage.getItem(value).split("; ")[1]; + if (!expires) { // item with no expiration date + return null; + } + return new Date(expires); +} + +/** + * + * @param string the value of the item not the item id (the value without splitting) + * @returns whether expired or not + */ +function isStorageItemExpired(value) { + let expires = parseInt(value.split("; ")[1]); + if (!expires) { // item with no expiration date + return null; + } + return new Date(expires) < new Date(); +} + +// localStorage + + + +function getApiValue(element, placeholder, apiPathName, callback, noReplace = false) { + let placeholderName = placeholder.replace("ghapi-", ""); + let cv = getStorageItem(placeholder); // cached value + if (noReplace) { + if (cv) { + callback(cv, true); + } else { + $.getJSON(ghAPI + `/${apiPathName}`, (data) => { + let value = callback(data, false); + setStorageItem(placeholder, value, 0.2); + }) + } + return; + } + + let innerHTML = element.innerHTML; + if (innerHTML.includes(`\${${placeholderName}}`)) { + if (cv) { + element.innerHTML = element.innerHTML.replaceAll(`\${${placeholderName}}`, cv); + } else { + $.getJSON(ghAPI + `/${apiPathName}`, (data) => { + let value = callback(data, false); + element.innerHTML = element.innerHTML.replaceAll(`\${${placeholderName}}`, value); + setStorageItem(placeholder, value, 0.2); + }) + } + } +} + +// Copy texts/links to clipboard +function copyToClipboard(value) { + setTimeout(() => { + let cb = document.body.appendChild(document.createElement("input")); + cb.value = value; + cb.focus(); + cb.select(); + document.execCommand('copy'); + cb.parentNode.removeChild(cb); + }, 50) +} + +// Show notification +function showNotification(text, bgColor, color) { + var noti = document.body.appendChild(document.createElement("span")); + noti.id = "notification-box"; + + setTimeout(() => { + noti.textContent = text; + if (bgColor) + noti.styles.backgroundColor = bgColor; + if (color) + noti.styles.backgroundColor = color; + noti.classList.add("activate-notification"); + setTimeout(() => { + noti.classList.remove("activate-notification"); + setTimeout(() => { + noti.parentNode.removeChild(noti); + }, 200); + }, 1500); + }, 50); +} + +// <> Magic Text (&k) +function getRandomChar() { + chars = "ÂÃÉÊÐÑÙÚÛÜéêëãòóôēĔąĆćŇň1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()-=_+{}["; + return chars.charAt(Math.floor(Math.random() * chars.length) + 1) +} + +function magicTextGen(element) { + var msg = element.textContent; + var length = msg.length; + + setInterval(() => { + var newMsg = ""; + for (i = 0; i <= length; i++) { + newMsg += getRandomChar(msg.charAt(i)); + } + element.textContent = newMsg; + + }, 30) +} + +function renderMagicText() { + document.querySelectorAll('.magic-text').forEach((e) => { + magicTextGen(e); + }) +} +// Magic Text (&k) + +// Replace Github placeholders +function replacePlaceholders(element) { + let innerHTML = element.innerHTML; + if (innerHTML.includes("${latest-version}")) { + getApiValue(element, "ghapi-latest-version", "releases", (data) => { + return data[0]["tag_name"]; + }); + } + + if (innerHTML.includes("${latest-version-changelog}")) { + getApiValue(element, "ghapi-latest-version-changelog", "releases", (data) => { + return data["body"].replaceAll("\\r\\n", "
"); + }); + } + + if (innerHTML.includes("${stable-version}")) { + getApiValue(element, "ghapi-stable-version", "releases/latest", (data) => { + return data["tag_name"]; + }); + } + + if (innerHTML.includes("${stable-version-changelog}")) { + getApiValue(element, "ghapi-stable-version-changelog", "releases/latest", (data) => { + return data["body"].replaceAll("\\r\\n", "
"); + }); + } + + if (innerHTML.includes("${latest-issue-")) { + getApiValue(element, "ghapi-latest-issue-user", "issues?per_page=1", (data) => { + return data[0]["user"]["login"]; + }); + getApiValue(element, "ghapi-latest-issue-title", "issues?per_page=1", (data) => { + return data[0]["title"]; + }); + getApiValue(element, "ghapi-latest-issue-date", "issues?per_page=1", (data) => { + return data[0]["created_at"]; + }); + } + + if (innerHTML.includes("${latest-pull-")) { + getApiValue(element, "ghapi-latest-pull-user", "pulls?per_page=1", (data) => { + return data[0]["user"]["login"]; + }); + getApiValue(element, "ghapi-latest-pull-title", "pulls?per_page=1", (data) => { + return data[0]["title"]; + }); + getApiValue(element, "ghapi-latest-pull-date", "pulls?per_page=1", (data) => { + return data[0]["created_at"]; + }); + } + + if (innerHTML.includes("${site-version}")) { + element.innerHTML = element.innerHTML.replaceAll("${site-version}", siteVersion); + } + + if (innerHTML.includes("${contributors-size}")) { + getApiValue(element, "ghapi-contributors-size", "contributors?per_page=500", (data) => { + return data.length; + }); + } +} + +// <> Syntax Highlighting + +// ORDER MATTERS!! +// All regexes must be sorrouneded with () to be able to use group 1 as the whole match since Js doesn't have group 0 +// Example: .+ = X +// Example: (.+) = ✓ +var patterns = []; // [REGEX, CLASS] + +function registerSyntax(regexString, flags, clazz) { + try { + regex = new RegExp(regexString, flags); + patterns.push([regex, clazz]); + } catch (error) { + console.warn(`Either your browser doesn't support this regex or the regex is incorrect (${regexString}):` + error); + } +} + +registerSyntax("((?") + + for (let j = 0; j < lines.length; j++) { + Loop2: for (let i = 0; i < patterns.length; i++) { + let match; + let regex = patterns[i][0]; + let oldLine = lines[j]; + + while ((match = regex.exec(oldLine)) != null) { + lines[j] = lines[j].replaceAll(regex, `$1`) + if (regex.lastIndex == 0) // Break after it reaches the end of exec count to avoid inf loop + continue Loop2; + } + } + } + element.innerHTML = lines.join("
") +} +// Syntax Highlighting + +// Offset page's scroll - Used for anchor scroll correction +function offsetAnchor(event, id) { // event can be null + let content = document.querySelector("#content"); + let element = document.getElementById(id); + + if (content && element) { + if (event != null) + event.preventDefault(); + content.scroll(0, element.offsetTop - 25); // Should be less than the margin in .item-wrapper so it doesn't show the part of the previous .item-wrapper + } +} + +// <> Toggle a specific doc element block + +// Active syntax +var lastActiveSyntaxID; +function toggleSyntax(elementID) { + let element = document.getElementById(elementID) + if (!element) + return + + if (lastActiveSyntaxID != null) + document.getElementById(lastActiveSyntaxID).classList.remove("active-syntax"); + + element.classList.add("active-syntax"); + lastActiveSyntaxID = elementID; +} + +// Toggle a specific doc element block \ No newline at end of file diff --git a/js/main.js b/js/main.js index 8fa83c97761..4281214b178 100644 --- a/js/main.js +++ b/js/main.js @@ -39,20 +39,6 @@ if (pageLink === "" || pageLink == window.location.toString()) // home page - wh else document.querySelectorAll(`#global-navigation a[href="${pageLink}.html"]`)[0].classList.add("active-tab"); -// Active syntax -var lastActiveSyntaxID; - -function toggleSyntax(elementID) { - let element = document.getElementById(elementID) - if (!element) - return - - if (lastActiveSyntaxID != null) - document.getElementById(lastActiveSyntaxID).classList.remove("active-syntax"); - - element.classList.add("active-syntax"); - lastActiveSyntaxID = elementID; -} // No Left Panel for (e in {"content-no-docs": 0, "content": 1}) { @@ -61,47 +47,10 @@ for (e in {"content-no-docs": 0, "content": 1}) { document.querySelectorAll('#side-nav')[0].classList.add('no-left-panel'); } -// <> Magic Text -function getRandomChar() { - chars = "ÂÃÉÊÐÑÙÚÛÜéêëãòóôēĔąĆćŇň1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()-=_+{}["; - return chars.charAt(Math.floor(Math.random() * chars.length) + 1) -} - -function magicTextGen(element) { - var msg = element.textContent; - var length = msg.length; - - setInterval(() => { - var newMsg = ""; - for (i = 0; i <= length; i++) { - newMsg += getRandomChar(msg.charAt(i)); - } - element.textContent = newMsg; - - }, 30) -} - -function renderMagicText() { - document.querySelectorAll('.magic-text').forEach((e) => { - magicTextGen(e); - }) -} +// Magic Text renderMagicText(); -// Magic Text - -// <> Anchor scroll correction -function offsetAnchor(event, id) { // event can be null - let content = document.querySelector("#content"); - let element = document.getElementById(id); - - if (content && element) { - if (event != null) - event.preventDefault(); - content.scroll(0, element.offsetTop - 25); // Should be less than the margin in .item-wrapper so it doesn't show the part of the previous .item-wrapper - } -} - +// Anchor scroll correction document.querySelectorAll(".link-icon").forEach((e) => { e.addEventListener("click", (event) => { let id = e.getAttribute("href").replace("#", ""); @@ -112,7 +61,6 @@ document.querySelectorAll(".link-icon").forEach((e) => { } }); }) -// Anchor correction // Open description/pattern links in same tab rather than scrolling because hash links uses search bar document.querySelectorAll(".item-wrapper a:not(.link-icon)").forEach((e) => { @@ -122,39 +70,8 @@ document.querySelectorAll(".item-wrapper a:not(.link-icon)").forEach((e) => { }); }) -// <> Anchor click copy link -function copyToClipboard(value) { - setTimeout(() => { - let cb = document.body.appendChild(document.createElement("input")); - cb.value = value; - cb.focus(); - cb.select(); - document.execCommand('copy'); - cb.parentNode.removeChild(cb); - }, 50) -} - -// Show notification -function showNotification(text, bgColor, color) { - var noti = document.body.appendChild(document.createElement("span")); - noti.id = "notification-box"; - - setTimeout(() => { - noti.textContent = text; - if (bgColor) - noti.styles.backgroundColor = bgColor; - if (color) - noti.styles.backgroundColor = color; - noti.classList.add("activate-notification"); - setTimeout(() => { - noti.classList.remove("activate-notification"); - setTimeout(() => { - noti.parentNode.removeChild(noti); - }, 200); - }, 1500); - }, 50); -} +// Anchor click copy link const currentPageLink = window.location.toString().replaceAll(/(.+?.html)(.*)/gi, '$1'); document.querySelectorAll(".item-title > a").forEach((e) => { e.addEventListener("click", (event) => { @@ -162,17 +79,14 @@ document.querySelectorAll(".item-title > a").forEach((e) => { showNotification("✅ Link copied successfully.") }); }) -// Anchor click copy link -// <> New element label click +// New element label click document.querySelectorAll(".new-element").forEach((e) => { e.addEventListener("click", (event) => { searchNow("is:new"); }); }) -// New element label click - // <> Search Bar const versionComparePattern = /.*?(\d\.\d(?:\.\d|))(\+|-|).*/gi; const versionPattern = / ?v(?:ersion|):(\d\.\d(?:\.\d|-(?:beta|alpha|dev)\d*|))(\+|-|)/gi; @@ -426,97 +340,6 @@ if (searchBar) { // Search Bar // <> Placeholders - -function replacePlaceholders(element) { - let innerHTML = element.innerHTML; - if (innerHTML.includes("${latest-version}")) { - getApiValue(element, "ghapi-latest-version", "releases", (data) => { - return data[0]["tag_name"]; - }); - } - - if (innerHTML.includes("${latest-version-changelog}")) { - getApiValue(element, "ghapi-latest-version-changelog", "releases", (data) => { - return data["body"].replaceAll("\\r\\n", "
"); - }); - } - - if (innerHTML.includes("${stable-version}")) { - getApiValue(element, "ghapi-stable-version", "releases/latest", (data) => { - return data["tag_name"]; - }); - } - - if (innerHTML.includes("${stable-version-changelog}")) { - getApiValue(element, "ghapi-stable-version-changelog", "releases/latest", (data) => { - return data["body"].replaceAll("\\r\\n", "
"); - }); - } - - if (innerHTML.includes("${latest-issue-")) { - getApiValue(element, "ghapi-latest-issue-user", "issues?per_page=1", (data) => { - return data[0]["user"]["login"]; - }); - getApiValue(element, "ghapi-latest-issue-title", "issues?per_page=1", (data) => { - return data[0]["title"]; - }); - getApiValue(element, "ghapi-latest-issue-date", "issues?per_page=1", (data) => { - return data[0]["created_at"]; - }); - } - - if (innerHTML.includes("${latest-pull-")) { - getApiValue(element, "ghapi-latest-pull-user", "pulls?per_page=1", (data) => { - return data[0]["user"]["login"]; - }); - getApiValue(element, "ghapi-latest-pull-title", "pulls?per_page=1", (data) => { - return data[0]["title"]; - }); - getApiValue(element, "ghapi-latest-pull-date", "pulls?per_page=1", (data) => { - return data[0]["created_at"]; - }); - } - - if (innerHTML.includes("${site-version}")) { - element.innerHTML = element.innerHTML.replaceAll("${site-version}", siteVersion); - } - - if (innerHTML.includes("${contributors-size}")) { - getApiValue(element, "ghapi-contributors-size", "contributors?per_page=500", (data) => { - return data.length; - }); - } -} - -function getApiValue(element, placeholder, apiPathName, callback, noReplace = false) { - let placeholderName = placeholder.replace("ghapi-", ""); - let cv = getStorageItem(placeholder); // cached value - if (noReplace) { - if (cv) { - callback(cv, true); - } else { - $.getJSON(ghAPI + `/${apiPathName}`, (data) => { - let value = callback(data, false); - setStorageItem(placeholder, value, 0.2); - }) - } - return; - } - - let innerHTML = element.innerHTML; - if (innerHTML.includes(`\${${placeholderName}}`)) { - if (cv) { - element.innerHTML = element.innerHTML.replaceAll(`\${${placeholderName}}`, cv); - } else { - $.getJSON(ghAPI + `/${apiPathName}`, (data) => { - let value = callback(data, false); - element.innerHTML = element.innerHTML.replaceAll(`\${${placeholderName}}`, value); - setStorageItem(placeholder, value, 0.2); - }) - } - } -} - // To save performance we use the class "placeholder" on the wrapper element of elements that contains the placeholder // To only select those elements and replace their innerHTML document.querySelectorAll(".placeholder").forEach(e => { @@ -524,168 +347,7 @@ document.querySelectorAll(".placeholder").forEach(e => { }); // Placeholders -// <> Cookies -function setCookie(cname, cvalue, exdays) { - const d = new Date(); - d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); - let expires = "expires=" + d.toUTCString(); - document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/; SameSite=None; Secure"; -} - -function getCookie(cname) { - let name = cname + "="; - let ca = document.cookie.split(';'); - for (let i = 0; i < ca.length; i++) { - let c = ca[i]; - while (c.charAt(0) == ' ') { - c = c.substring(1); - } - if (c.indexOf(name) == 0) { - return c.substring(name.length, c.length); - } - } - return ""; -} - -// Cookies - -// <> localStorage - -/** - * Set the value of local storage item - * @param {string} item id - * @param {object} value - * @param {double} exdays time in days - */ -function setStorageItem(item, value, exdays) { - const d = new Date(); - d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); - localStorage.setItem(item, value + "; " + d.toUTCString()); -} - -/** - * Remove a local storage item - * @param {string} item the id of the item - */ -function removeStorageItem(item) { - localStorage.removeItem(item) -} - -/** - * Get local storage item (value & time if has one) - * @param {string} item the item id - * @param {boolean} noExpireationCheck whether to check for expiration time and remove the item - * @returns the item object - */ -function getStorageItem(item, noExpireationCheck = false) { - let result = localStorage.getItem(item); - if (!result) - return null; - - if (!noExpireationCheck) { - result = result.split("; ")[0]; - if (isStorageItemExpired(item)) { - removeStorageItem(item); - return null; - } - } - return result; -} - -/** - * Get local storage item value after split at ';' - * @param {string} item the id of th item - * @returns the item value - */ -function getStorageItemValue(item) { - let result = localStorage.getItem(item); - if (!result) - return null; - return result.split("; ")[0]; -} - -/** - * @param {string} string the value of the item not the item id (the value without splitting) - * @returns the expiration date - */ -function getStorageItemExpiration(value) { - let expires = localStorage.getItem(value).split("; ")[1]; - if (!expires) { // item with no expiration date - return null; - } - return new Date(expires); -} - -/** - * - * @param string the value of the item not the item id (the value without splitting) - * @returns whether expired or not - */ -function isStorageItemExpired(value) { - let expires = value.split("; ")[1]; - if (!expires) { // item with no expiration date - return null; - } - return new Date(expires) < new Date(); -} - -// localStorage - // <> Syntax Highlighting - -// ORDER MATTERS!! -// All regexes must be sorrouneded with () to be able to use group 1 as the whole match since Js doesn't have group 0 -// Example: .+ = X -// Example: (.+) = ✓ -var patterns = []; // [REGEX, CLASS] - -function registerSyntax(regexString, flags, clazz) { - try { - regex = new RegExp(regexString, flags); - patterns.push([regex, clazz]); - } catch (error) { - console.warn(`Either your browser doesn't support this regex or the regex is incorrect (${regexString}):` + error); - } -} - -registerSyntax("((?") - - for (let j = 0; j < lines.length; j++) { - Loop2: for (let i = 0; i < patterns.length; i++) { - let match; - let regex = patterns[i][0]; - let oldLine = lines[j]; - - while ((match = regex.exec(oldLine)) != null) { - lines[j] = lines[j].replaceAll(regex, `$1`) - if (regex.lastIndex == 0) // Break after it reaches the end of exec count to avoid inf loop - continue Loop2; - } - } - } - element.innerHTML = lines.join("
") -} - document.addEventListener("DOMContentLoaded", function (event) { setTimeout(() => { document.querySelectorAll('.item-examples .skript-code-block').forEach(el => { @@ -723,4 +385,23 @@ if (examples) { }) }, 50) } -// Example Collapse \ No newline at end of file +// Example Collapse + +// <> Cookies Accecpt +if (!isCookiesAccepted) { + content.insertAdjacentHTML('beforeend', `

We use cookies and local storage to enhance your browsing experience and store github related statistics. By clicking "Accept", you consent to our use of cookies and local storage.

`); +} + +let cookiesBar = document.querySelector("#cookies-bar");; +let cookiesAccept = document.querySelector("#cookies-accept"); +let cookiesDeny = document.querySelector("#cookies-deny"); +if (cookiesAccept && cookiesDeny) { + cookiesAccept.addEventListener('click', () => { + setCookie('cookies-accepted', true, 99, true); + cookiesBar.remove(); + }); + cookiesDeny.addEventListener('click', () => { + cookiesBar.remove(); + }); +} +// Cookies Accecpt \ No newline at end of file diff --git a/js/theme-switcher.js b/js/theme-switcher.js index d160f7d8631..9e6314187fb 100644 --- a/js/theme-switcher.js +++ b/js/theme-switcher.js @@ -2,57 +2,6 @@ // This file is made to fix theme flicker at load due to 'defer' in main.js loading // -// A quick fix to not use modules due to CORS on localhost -function setStorageItem(item, value, exdays) { - const d = new Date(); - d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); - localStorage.setItem(item, value + "; " + d.toUTCString()); -} - -function removeStorageItem(item) { - localStorage.removeItem(item) -} - -function getStorageItem(item, noExpireationCheck = false) { - let result = localStorage.getItem(item); - if (!noExpireationCheck) { - let expires; - expires, result = result.split("; ")[1], result.split("; ")[0]; - if (expires) { // item with no expiration date - if (new Date(expires) < new Date()) { - removeStorageItem(item); - return null; - } - } - } - return result; -} - - -// <> Cookies -function setCookie(cname, cvalue, exdays) { - const d = new Date(); - d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); - let expires = "expires=" + d.toUTCString(); - document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/; SameSite=None; Secure"; -} - -function getCookie(cname) { - let name = cname + "="; - let ca = document.cookie.split(';'); - for (let i = 0; i < ca.length; i++) { - let c = ca[i]; - while (c.charAt(0) == ' ') { - c = c.substring(1); - } - if (c.indexOf(name) == 0) { - return c.substring(name.length, c.length); - } - } - return ""; -} -// Cookies - // Auto load DarkMode from cookies if (getCookie("darkMode") == "false") { document.body.setAttribute('data-theme', 'white') @@ -63,10 +12,10 @@ if (getCookie("darkMode") == "false") { // Auto load from system theme // const darkThemeMq = window.matchMedia("(prefers-color-scheme: dark)"); // if (darkThemeMq.matches) { - // document.body.removeAttribute('data-theme'); - // } else { - // document.body.setAttribute('data-theme', 'white') - // } + // document.body.removeAttribute('data-theme'); + // } else { + // document.body.setAttribute('data-theme', 'white') + // } } setTimeout(() => { @@ -82,4 +31,4 @@ setTimeout(() => { setCookie("darkMode", "true", 99); } }); -}, 500); // For some reason this wouldn't work in index.html (only) unless I add some delay o.O \ No newline at end of file +}, 500); // For some reason this wouldn't work in index.html (only) unless some delay is added o.O \ No newline at end of file diff --git a/sections.html b/sections.html index dcb00114ed8..d31d3809401 100644 --- a/sections.html +++ b/sections.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Sections

Conditionals

🔗

Section

Patterns:
  • else
  • else [parse] if <.+>
  • [(parse if|if)] <.+>
Since: 1.0
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed

parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true

Examples:

if player's health is greater than or equal to 4:
    send "Your health is okay so far but be careful!"

else if player's health is greater than 2:
    send "You need to heal ASAP, your health is very low!"

else: # Less than 2 hearts
    send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"

parse if plugin "SomePluginName" is enabled: # parse if %condition%
    # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section

Loop

🔗

Section

Patterns:
Since: 1.0
Loop sections repeat their code with multiple values.

A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.

Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.

List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).

Examples:

loop all players:
    send "Hello %loop-player%!" to loop-player

loop items in player's inventory:
    if loop-item is dirt:
        set loop-item to air

loop 10 times:
    send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc.
    wait 1 second

loop {Coins::*}:
    set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200

Spawn

🔗

Section

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""

While Loop

🔗

Section

Patterns:
  • [do] while <.+>
Since: 2.0, 2.6 (do while)
While Loop sections are loops that will just keep repeating as long as a condition is met.

Examples:

while size of all players < 5:
    send "More players are needed to begin the adventure" to all players
    wait 5 seconds

set {_counter} to 1
do while {_counter} > 1: # false but will increase {_counter} by 1 then get out
    add 1 to {_counter}

# Be careful when using while loops with conditions that are almost
# always true for a long time without using 'wait %timespan%' inside it,
# otherwise it will probably hang and crash your server.
while player is online:
    give player 1 dirt
    wait 1 second # without using a delay effect the server will crash
\ No newline at end of file + Skript Documentation - 2.6.3

Sections

Conditionals

🔗

Section

Patterns:
  • else
  • else [parse] if <.+>
  • [(parse if|if)] <.+>
Since: 1.0
Conditional sections if: executed when its condition is true else if: executed if all previous chained conditionals weren't executed, and its condition is true else: executed if all previous chained conditionals weren't executed

parse if: a special case of 'if' condition that its code will not be parsed if the condition is not true else parse if: another special case of 'else if' condition that its code will not be parsed if all previous chained conditionals weren't executed, and its condition is true

Examples:

if player's health is greater than or equal to 4:
    send "Your health is okay so far but be careful!"

else if player's health is greater than 2:
    send "You need to heal ASAP, your health is very low!"

else: # Less than 2 hearts
    send "You are about to DIE if you don't heal NOW. You have only %player's health% heart(s)!"

parse if plugin "SomePluginName" is enabled: # parse if %condition%
    # This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section

Loop

🔗

Section

Patterns:
Since: 1.0
Loop sections repeat their code with multiple values.

A loop will loop through all elements of the given expression, e.g. all players, worlds, items, etc. The conditions & effects inside the loop will be executed for every of those elements, which can be accessed with ‘loop-’, e.g. send "hello" to loop-player. When a condition inside a loop is not fulfilled the loop will start over with the next element of the loop. You can however use stop loop to exit the loop completely and resume code execution after the end of the loop.

Loopable Values All expressions that represent more than one value, e.g. ‘all players’, ‘worlds’, etc., as well as list variables, can be looped. You can also use a list of expressions, e.g. loop the victim and the attacker, to execute the same code for only a few values.

List Variables When looping list variables, you can also use loop-index in addition to loop-value inside the loop. loop-value is the value of the currently looped variable, and loop-index is the last part of the variable's name (the part where the list variable has its asterisk *).

Examples:

loop all players:
    send "Hello %loop-player%!" to loop-player

loop items in player's inventory:
    if loop-item is dirt:
        set loop-item to air

loop 10 times:
    send title "%11 - loop-value%" and subtitle "seconds left until the game begins" to player for 1 second # 10, 9, 8 etc.
    wait 1 second

loop {Coins::*}:
    set {Coins::%loop-index%} to loop-value + 5 # Same as "add 5 to {Coins::%loop-index%}" where loop-index is the uuid of the player and loop-value is the actually coins value such as 200

Spawn

🔗

EffectSection

Patterns:
Since: 1.0, 2.6.1 (with section)
Spawn a creature. This can be used as an effect and as a section. If it is used as a section, the section is run before the entity is added to the world. You can modify the entity in this section, using for example 'event-entity' or 'cow'. Do note that other event values, such as 'player', won't work in this section.

Examples:

spawn 3 creepers at the targeted block
spawn a ghast 5 meters above the player
spawn a zombie at the player:
    set name of the zombie to ""

While Loop

🔗

Section

Patterns:
  • [do] while <.+>
Since: 2.0, 2.6 (do while)
While Loop sections are loops that will just keep repeating as long as a condition is met.

Examples:

while size of all players < 5:
    send "More players are needed to begin the adventure" to all players
    wait 5 seconds

set {_counter} to 1
do while {_counter} > 1: # false but will increase {_counter} by 1 then get out
    add 1 to {_counter}

# Be careful when using while loops with conditions that are almost
# always true for a long time without using 'wait %timespan%' inside it,
# otherwise it will probably hang and crash your server.
while player is online:
    give player 1 dirt
    wait 1 second # without using a delay effect the server will crash
\ No newline at end of file diff --git a/text.html b/text.html index ec260088973..5bce5e92452 100644 --- a/text.html +++ b/text.html @@ -1,2 +1,2 @@ - Skript Documentation - 2.6.3

Text in Scripts

Text (String)

Skript allows you to write pieces of text (programmers usually call them strings) in the scripts. This is done by putting the text inside double quotes, as follows:

"this is text"

Simple, isn't it? If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to write it right there!

Formatting Text

But isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.

Colors

Minecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:

Color name tags, for example <red> + Skript Documentation - 2.6.3

Text in Scripts

Text (String)

Skript allows you to write pieces of text (programmers usually call them strings) in the scripts. This is done by putting the text inside double quotes, as follows:

"this is text"

Simple, isn't it? If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to write it right there!

Formatting Text

But isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.

Colors

Minecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:

Color name tags, for example <red> Minecraft color codes, like §c; using & works, too

Here's a table of all colors, including both Skript names and color codes:

Color Code Name Alternative Names
§0 black
§1 blue dark blue
§2 green dark green
§3 cyan aqua, dark cyan, dark aqua, dark turquoise, dark turquois
§4 red dark red
§5 purple dark purple
§6 orange orange, gold, dark yellow
§7 grey light grey, gray, light gray, silver
§8 dark gray dark grey
§9 light blue light blue, indigo
§a light green lime, lime green
§b light cyan light aqua, turquoise, turquois, light blue
§c light red pink
§d magenta light purple
§e yellow light yellow
§f white

In Minecraft 1.16, support was added for 6-digit hexadecimal colors to specify custom colors other than the 16 default color codes. A new tag can be used to format with these colors. The tag looks like this:

<##hex code>

Here's what the tag would look like when used in a script:

send "<##123456>Hey %player%!" to player

For information not related to Skript, see Minecraft Wiki page concerning colors. Note that depending on Skript configuration, color codes may do more than just change color of text after them. By default, for backwards compatibility, they clear following styles: magic, bold, strikethrough, underlined, italic. Other styles are not affected, and this feature can be toggled of in config.sk.

Other Styles

Minecraft also has various other styles available. The following are available everywhere, including item and entity names:

Code Name Alternative Names
§k magic test obfuscated
§l bold b
§m strikethrough strike, s
§n underlined underline, u
§o italic italics, i
§r reset r

If it wasn't clear from the table, §r clears all other formatting and colors. You'll probably use it quite often when sending chat messages from scripts.

Skript also supports certain newer features, which are only available in chat. Those do not have formatting codes, so you must use tags for them.

                        
Name Alternative Names Description
link open url, url Opens a link when player clicks on text
run command command, cmd Makes player execute a chat command when they click on text
suggest command sgt Adds a command to chat prompt of player when clicked
tooltip show text, ttp Shows a tooltip when player hovers over text with their mouse
fontfChange the font of the text (1.16+)
insertion insert, ins Will append a text at player's current cursor in chat input only while holding SHIFT.

All of these styles require a parameter, in format

<name:parameter>

For link, parameter must be either http or https url if you want clients to recognize it. For others, it can be any text you'd like (you can make player run invalid commands if you wish).

Text and Variables

Variable names are text, but obviously formatting that text does no good. However, everything else you can do for text, you can do for variable names. A guide about this is coming... some day.

Guide written by bensku.

\ No newline at end of file diff --git a/tutorials.html b/tutorials.html index 4e011159558..0b1ab89ae15 100644 --- a/tutorials.html +++ b/tutorials.html @@ -1 +1 @@ - Skript Documentation - 2.6.3

Tutorials

Note:

Skript Tutorials are coming soon.

  1. Loops
  2. Commands
  3. Functions
  4. Variables
  5. Visual effects

\ No newline at end of file + Skript Documentation - 2.6.3

Tutorials

Note:

Skript Tutorials are coming soon.

  1. Loops
  2. Commands
  3. Functions
  4. Variables
  5. Visual effects

\ No newline at end of file