sin(arg)/cos(arg). Uses degrees, not radians.
Examples:
tan(0) = 0
tan(45) = 1
tan(89.99) = 5729.5779
## isNaN
Addon: Skript
Category: Function
Syntax: isNaN(n: number) :: boolean
Description: Returns true if the input is NaN (not a number).
Examples:
isNaN(0) # false
isNaN(0/0) # true
isNaN(sqrt(-1)) # true
## additions
Addon: Skript
Category: Function
Syntax: additions(sound-id: string, tick-chance: number) :: addition
Description: Creates ambient addition sound data for biome effects.
Examples:
set {_additions} to additions("ambient.cave", 0.01)
## mod
Addon: Skript
Category: Function
Syntax: mod(d: number, m: number) :: number
Description: 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
## log
Addon: Skript
Category: Function
Syntax: log(n: number, [base: number]) :: number
Description: 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
## blockVector
Addon: Skript
Category: Function
Syntax: blockVector(x: integer, y: integer, z: integer) :: blockvector
Description: Creates a block vector with integer x, y, and z coordinates.
Examples:
set {_bv} to blockVector(0, 64, 0)
## blockVibrationData
Addon: Skript
Category: Function
Syntax: blockVibrationData(block: point, travel-time: timespan) :: vibrationdata
Description: Creates vibration data targeting a block.
Examples:
set {_data} to blockVibrationData(blockVector(0, 64, 0), 5 seconds)
## ambientParticle
Addon: Skript
Category: Function
Syntax: ambientParticle(particle: particle, probability: number) :: ambientparticle
Description: Creates ambient particle data with a spawn probability for biome effects.
Examples:
set {_particle} to ambientParticle(white ash, 0.118093334)
## ceiling
Addon: Skript
Category: Function
Syntax: ceiling(n: number) :: long
Description: Alias of ceil.
Examples:
ceiling(2.34) = 3
ceiling(2) = 2
ceiling(2.99) = 3
## product
Addon: Skript
Category: Function
Syntax: product(ns: number) :: number
Description: 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)
## sin
Addon: Skript
Category: Function
Syntax: sin(n: number) :: number
Description: 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
## min
Addon: Skript
Category: Function
Syntax: min(ns: number) :: number
Description: Returns the minimum number from a list of numbers.
Examples:
min(1) = 1
min(1, 2, 3, 4) = 1
min({some list variable::*})
## mood
Addon: Skript
Category: Function
Syntax: mood(sound-id: string, delay: timespan, block-search-extent: integer, offset: number) :: mood
Description: Creates ambient mood sound data for biome effects.
Examples:
set {_mood} to mood("ambient.cave", 1 second, 8, 2)
## music
Addon: Skript
Category: Function
Syntax: music(sound-id: string, min-delay: timespan, max-delay: timespan, replaces-current-music: boolean) :: music
Description: Creates background music data with min/max delay and whether it replaces current music.
Examples:
set {_music} to music("music.overworld", 1 minute, 2 minutes, true)
## mm
Addon: Skript
Category: Function
Syntax: mm(input: string, [resolvers: tagresolver]) :: component
Description: Deserializes a MiniMessage string into a Component, with optional tag resolvers.
You can also use (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
## formatNumber
Addon: Skript
Category: Function
Syntax: formatNumber(number: number, [format: string]) :: string
Description: Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this article.
Examples:
command /balance:
aliases: bal
executable by: players
trigger:
set {_money} to formatNumber({money::%sender's uuid%})
send "Your balance: %{_money}%" to sender
## clamp
Addon: Skript
Category: Function
Syntax: clamp(values: number, min: number, max: number) :: numbers
Description: Clamps one or more values between two numbers.
Examples:
clamp(5, 0, 10) = 5
clamp(5.5, 0, 5) = 5
clamp(0.25, 0, 0.5) = 0.25
clamp(5, 7, 10) = 7
clamp((5, 0, 10, 9, 13), 7, 10) = (7, 7, 10, 9, 10)
set {_clamped::*} to clamp({_values::*}, 0, 10)
## player
Addon: Skript
Category: Function
Syntax: player(from: string, [strict: boolean]) :: player
Description: Find an online player from their username or UUID.
Examples:
send "test" to player("bob")
## exp
Addon: Skript
Category: Function
Syntax: exp(n: number) :: number
Description: 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
## atan
Addon: Skript
Category: Function
Syntax: atan(n: number) :: number
Description: 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
## max
Addon: Skript
Category: Function
Syntax: max(ns: number) :: number
Description: Returns the maximum number from a list of numbers.
Examples:
max(1) = 1
max(1, 2, 3, 4) = 4
max({some list variable::*})
## dustTransition
Addon: Skript
Category: Function
Syntax: dustTransition(color: rgblike, transition-color: rgblike, [size: number]) :: dusttransition
Description: Creates a dust transition with the given color, transition color and size.
Examples:
set {_data} to dustTransition(red, blue, 1)
## suggestionEntry
Addon: Skript
Category: Function
Syntax: suggestionEntry(entry: string, tooltip: component) :: suggestionentry
Description: Creates a command suggestion entry with an optional tooltip component.
Examples:
command /home:
argument cos(a) = sin(a + 90°), for any number a. Uses degrees, not radians.
Examples:
cos(0) = 1
cos(90) = 0
## position
Addon: Skript
Category: Function
Syntax: position(x: number, y: number, z: number, [yaw: number], [pitch: number]) :: position
Description: Creates a position with the given x, y, z, yaw and pitch.
Examples:
set {_pos} to position(0, 64, 0, 90, 0)
## atan2
Addon: Skript
Category: Function
Syntax: atan2(x: number, y: number) :: number
Description: 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
## ceil
Addon: Skript
Category: Function
Syntax: ceil(n: number) :: long
Description: 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
## effectData
Addon: Skript
Category: Function
Syntax: effectData(color: rgblike, power: number) :: effectdata
Description: Creates effect data for an effect particle.
Examples:
set {_data} to effectData(red, 1)
## date
Addon: Skript
Category: Function
Syntax: date(year: number, month: number, day: number, [hour: number], [minute: number], [second: number], [millisecond: number], [zone_offset: number], [dst_offset: number]) :: date
Description: 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)
## ln
Addon: Skript
Category: Function
Syntax: ln(n: number) :: number
Description: 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
## acos
Addon: Skript
Category: Function
Syntax: acos(n: number) :: number
Description: 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
## vector
Addon: Skript
Category: Function
Syntax: vector(x: number, y: number, z: number) :: vector
Description: Creates a vector with the given x, y and z.
Examples:
set {_vec} to vector(1, 0, 0)
## Cancel Event
Addon: Skript
Category: Effect
Syntax: cancel [the] event
Description: Cancels the event (e.g. prevent blocks from being placed, or damage being taken).
Examples:
on chat:
cancel event
## Locally Suppress Warning
Addon: Skript
Category: Effect
Syntax: [local[ly]] suppress [the] (1:conflict|2:variable save|[missing] conjunction[s]|4:starting [with] expression[s]|5:deprecated syntax) warning[s]
Description: Suppresses target warnings from the current script.
Examples:
locally suppress missing conjunction warnings
suppress the variable save warnings
## Unregister Instance
Addon: Skript
Category: Effect
Syntax: unregister [instance[s]] %instances%
Description: Unregisters one or more instances from the server.
Examples:
unregister {-worlds::lobby}
## Continue
Addon: Skript
Category: Effect
Syntax: continue [this loop|[the] [current] loop]
Description: Moves the loop to the next iteration. You may also continue an outer loop from an inner one. The loops are labelled from 1 until the current loop, starting with the outermost one.
Examples:
# Broadcast online moderators
loop all players:
if loop-value does not have permission "moderator":
continue # filter out non moderators
broadcast "%loop-player% is a moderator!" # Only moderators get broadcast
# Game starting counter
set {_counter} to 11
while {_counter} > 0:
remove 1 from {_counter}
wait a second
if {_counter} != 1, 2, 3, 5 or 10:
continue # only print when counter is 1, 2, 3, 5 or 10
broadcast "Game starting in %{_counter}% second(s)"
## Clear Resource Pack
Addon: Skript
Category: Effect
Syntax: clear %players%'[s] [resource] pack[s]
Description: Clears all resource packs from the given players.
Examples:
clear player's resource pack
## Delay
Addon: Skript
Category: Effect
Syntax: (wait|halt) [for] %timespan%
Description: 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!
NOTE: Using sleep/pause will completely pause the thread this effect is run on. It's intended for pausing on another thread.
Examples:
wait 2 minutes
halt for 5 minecraft hours
wait a tick
sleep for 2 ticks # completely pauses the thread this effect is on for 2 ticks
## Refresh Commands
Addon: Skript
Category: Effect
Syntax: refresh %players%'[s] commands
Description: Refreshes the command list sent to the given players.
Examples:
refresh player's commands
## Delete Team
Addon: Skript
Category: Effect
Syntax: (delete|unregister) team[s] %teams%
Description: Unregisters a team and removes it from every client that can see it.
Examples:
delete team named "red"
## Regenerate Chunk
Addon: Skript
Category: Effect
Syntax: regen[erate] %chunks%
Description: Regenerates the given chunks using the instance's chunk generator.
Examples:
regenerate chunk at player
## Kill/Remove
Addon: Skript
Category: Effect
Syntax: (:remove|kill) %entities%
Description: If the provided entity is a livingentity and 'kill' was typed, its death animation will play. Otherwise, the entity will be removed permanently.
Examples:
kill all entities
## Save Instance
Addon: Skript
Category: Effect
Syntax: save %instances% [without:without [saving] tags]
Description: Saves the given instances.
Examples:
save current instance
## Spectator Collision
Addon: Skript
Category: Effect
Syntax: enable spectator collision [mode] (on|for) %players%
Description: Enables spectator collision mode for the given players, allowing them to collide with blocks even in spectator mode.
Examples:
enable spectator collision for all players
## Swing Hand
Addon: Skript
Category: Effect
Syntax: make %livingentities% swing [their] [main] hand
Description: 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
## Reconfigure
Addon: Skript
Category: Effect
Syntax: reconfigure %players%
Description: Puts the given players back into the configuration phase.
Examples:
reconfigure player
## Make Fly
Addon: Skript
Category: Effect
Syntax: force %players% to [(start|stop)] fly[ing]
Description: Forces a player to start/stop flying.
Examples:
make player fly
force all players to stop flying
## Heal
Addon: Skript
Category: Effect
Syntax: heal %livingentities%
Description: Heals the given living entities to their maximum health.
Examples:
heal all players
## Respawn
Addon: Skript
Category: Effect
Syntax: respawn %players%
Description: Respawns the given players.
Examples:
respawn player
## Enable/Disable/Reload Script File
Addon: Skript
Category: Effect
Syntax: ((enable|load)|2:reload|(disable|unload)) s(c|k)ript [file] %string%
Description: Enables, disables, or reloads a script file.
Examples:
reload script "test"
enable script file "testing"
unload script file "script.sk"
## Destroy BossBar
Addon: Skript
Category: Effect
Syntax: destroy boss[ ]bar[s] %bossbars%
Description: Effectively deletes the provided bossbar
Examples:
destroy bossbar {-b}
## Feed
Addon: Skript
Category: Effect
Syntax: feed %players%
Description: Fills the player's hunger bar.
Examples:
feed all players
## Return
Addon: Skript
Category: Effect
Syntax: return %objects%
Description: Makes a trigger (e.g. a function) return a value
Examples:
function double(i: number) :: number:
return 2 * {_i}
function divide(i: number) returns number:
return {_i} / 2
## Use Item
Addon: Skript
Category: Effect
Syntax: make %livingentities% (begin|start) using item [in %equipmentslot%]
Description: Makes living entities begin, stop, or complete using an item in their hand. Dispatches the corresponding Minestom item use events for players.
Examples:
make player begin using item
make player stop using active item
make player complete using active item
## Kick
Addon: Skript
Category: Effect
Syntax: kick %players% [due to %component%]
Description: Kicks the given players from the server with an optional message. During a connect event, kicks the connecting player through that event instead.
Examples:
kick player due to "You have been banned"
## Log
Addon: Skript
Category: Effect
Syntax: log %strings% [(to|in) [file[s]] %strings%] [with [the|a] severity [of] (1:warning|2:severe)]
Description: 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 join:
log "%player% has just joined the server!"
## Look At
Addon: Skript
Category: Effect
Syntax: (force|make) %livingentities% [to] (face [towards]|look [(at|towards)]) %entity%'s (feet:feet|eyes)
Description: Forces the mob(s) or player(s) to look at an entity, vector or position. Vanilla max head pitches range from 10 to 50.
Examples:
force the player to look towards event-entity's feet
## Save NBT
Addon: Skript
Category: Effect
Syntax: save %nbtcompound% (in|to) file[s] %strings%
Description: Saves an NBT compound to a gzip-compressed file in the server directory.
Examples:
save {_nbt} to file "data/player.dat"
## Set/Assign Chunk Block
Addon: Skript
Category: Effect
Syntax: (set|assign) [:absolute|relative] chunk [generat(or|ion)] (biome|block) at %points% to %block/biome%
Description: Sets a block at a specific point within a chunk generator.
Examples:
set chunk block at vector(0, 64, 0) to stone
## Switch Entity Type
Addon: Skript
Category: Effect
Syntax: (switch|change) %entities%'[s] entity[ ]type to %entitytype%
Description: Changes the entity type of the given entities without despawning them. Slightly broken at times and may be removed.
Examples:
switch player's entity type to pig
## Make Say
Addon: Skript
Category: Effect
Syntax: make %players% (say|send [the] message[s]) %strings%
Description: Forces a player to send a message to the chat.
If the message starts with a slash the player is made to run it as a command instead.
A chat message goes through the normal chat pipeline, so the chat event fires and any format or recipient
changes made there apply, exactly as if the player had typed it.
Examples:
make the player say "Hello."
force all players to send the message "I love this server"
make player say "/spawn"
## Bundle Material
Addon: Skript
Category: Effect
Syntax: make %items% [act like] a bundle material for %players%
Description: Make the provided players' clients view the provided items' material as bundle-acting (so you can detect scrolling).
If you, for some reason, need more than one item, you must send all of the extra items you want in one effect, otherwise the old ones
will not work.
## Action Bar
Addon: Skript
Category: Effect
Syntax: send action[ ]bar %component% [to %players%]
Description: Sends an action bar to the given players.
Examples:
send action bar "Hello World!" to all players
## Open/Close Inventory
Addon: Skript
Category: Effect
Syntax: close %players%'[s] inventory [view]
Description: Opens an inventory to a player. The player can then access and modify the inventory as if it was a chest that they 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:
open the player's inventory for the player
## Show / Close Dialog
Addon: Skript
Category: Effect
Syntax: show [dialog] %dialog/string% to %players%
Description: Shows a dialog to players, or closes whatever dialog they currently have open.
A dialog can be given as a value or as the namespaced key of a registered dialog,
including dialogs that came from a datapack.
Examples:
show {_d} to player
show "myserver:shop" to all players
close dialog of player
## Message
Addon: Skript
Category: Effect
Syntax: (message|send [message[s]]) %objects% [to %senders%]
Description: 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 {_entity} exists:
message "You're currently looking at a %type of the {_entity}%!"
on chat:
cancel event
send "[%player%] >> %message%" to all players from player
## Copy Into Variable
Addon: Skript
Category: Effect
Syntax: copy %objects% [in]to %objects%
Description: Copies objects into a variable. When copying a list over to another list, the source list and its sublists are also copied over. Note: Copying a value into a variable/list will overwrite the existing data.
Examples:
set {_foo::bar} to 1
set {_foo::sublist::foobar} to "hey"
copy {_foo::*} to {_copy::*}
broadcast indices of {_copy::*} # bar, sublist
broadcast {_copy::bar} # 1
broadcast {_copy::sublist::foobar} # "hey!"
## Push
Addon: Skript
Category: Effect
Syntax: (push|thrust|pull) %entities% [along] %direction% [(at|with) [a] (speed|velocity|force) [of] %number%]
Description: Push entities in a given direction or towards a specific point.
Velocity values on Minestom are 1/20th (20 ticks per second is why) the value of Paper's.
Examples:
push the player upwards
push the victim downwards at speed 0.5
push player towards player's target at speed 2
pull player along vector(1,1,1) at speed 1.5
## Transition Weather
Addon: Skript
Category: Effect
Syntax: transition [the] weather (of|in) %instances% to %weather% over %timespan%
Description: Changes the weather of an instance over the given duration. Setting the weather without a duration lets minestom pick one based on how far the levels have to move. The duration is at least one tick.
Examples:
transition weather of {_instance} to thundering weather over 10 seconds
transition weather of {_instance} to clear weather over 1 minute
## Replace
Addon: Skript
Category: Effect
Syntax: replace [all|every|[the] first] %strings% in %strings% with %string% [case:with case sensitivity]
Description: 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 "(was|were) or will be instead of (is|are) respectively, which check different time states of the first expression.
Examples:
sender is a player
## Script Name
Addon: Skript
Category: Expression
Syntax: [the] script[['s] name]
Description: 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
## MSPT
Addon: Skript
Category: Expression
Syntax: [(mean|average)] mspt [(from|over|in) [the] last (1:10 seconds|2:minute|3:5 minutes)]
Description: The duration of the server's ticks in milliseconds, as measured by spark.
Defaults to the mean tick duration of the window, but the minimum, maximum, median and 95th percentile can be asked for instead.
Without a window, this returns all three of spark's averages, in order: the last 10 seconds, minute and 5 minutes.
Examples:
broadcast "%mspt from the last minute%"
every 30 seconds:
if 95th percentile mspt from the last 10 seconds > 45:
broadcast mm("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!"
## Loop Iteration
Addon: Skript
Category: Expression
Syntax: [the] loop(-| )(counter|iteration)[-%*number%]
Description: Returns the loop's current iteration count (for both normal and while loops).
Examples:
while player is online:
give player 1 stone
wait 5 ticks
if loop-counter > 30:
stop loop
loop {top-balances::*}:
if loop-iteration <= 10:
broadcast "#%loop-iteration% %loop-index% has $%loop-value%"
## Dialog Input
Addon: Skript
Category: Expression
Syntax: [the] [dialog] input %string%
Description: The value a player entered into a named dialog input, available inside a dialog button's
code section and inside the dialog click event.
Text inputs return text, checkboxes return their true or false value as text, sliders return
a number, and dropdowns return the id of the chosen option.
Returns nothing if the dialog had no input under that name.
Examples:
set {_buy} to new dialog button labeled "Buy" running code:
send "You asked for %dialog input ""qty""%" to player
## Normalized Vector
Addon: Skript
Category: Expression
Syntax: normalized %vectors%
Description: Returns normalized (unit length) vectors.
Examples:
set {_v} to normalized vector(3, 4, 0)
## Case Text
Addon: Skript
Category: Expression
Syntax: %strings% in (upper|lower)[ ]case
Description: 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?
## X Times
Addon: Skript
Category: Expression
Syntax: %number% time[s]
Description: 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
## Angle
Addon: Skript
Category: Expression
Syntax: %number% [in] deg[ree][s]
Description: Represents the passed number value in degrees. If radians is specified, converts the passed value to degrees. This conversion may not be entirely accurate, due to floating point precision.
Examples:
set {_angle} to 90 degrees
{_angle} is 90 # true
180 degrees is pi # false
pi radians is 180 degrees # true
## Vectors - Cylindrical Shape
Addon: Skript
Category: Expression
Syntax: [a] [new] cylindrical vector [from|with] [radius] %number%, [yaw] %number%(,[ and]| and) [height] %number%
Description: 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 - Spherical Shape
Addon: Skript
Category: Expression
Syntax: [a] [new] spherical vector [(from|with)] [radius] %number%, [yaw] %number%(,[ and]| and) [pitch] %number%
Description: 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
## Biome
Addon: Skript
Category: Expression
Syntax: biome[s] %directions% %points% [in [(world|instance)] %instances%]
Description: The biome at a location in an instance.
Examples:
set {_b} to biome at player's position in player's instance
## Block
Addon: Skript
Category: Expression
Syntax: block[s] [type[s]] %directions% %points% [in [(world|instance)] %instances%] [1:with updates]
Description: The block at a certain point in an instance.
Examples:
set block at player's position to stone
## MOTD Description
Addon: Skript
Category: Expression
Syntax: motd description
Description: The description shown in the server list ping event.
Examples:
set motd description to "raw "&aHello There!" would output &aHello There!
Examples:
send raw "&aThis text is unformatted!" to all players
## Team
Addon: Skript
Category: Expression
Syntax: [the] team[s] named %strings%
Description: An existing team, by name. Returns nothing if no team with that name exists.
Deleting this unregisters the team and removes it from every client that can see it.
Teams live in memory and are not saved across restarts, so scripts should recreate them on load.
The word 'named' is required: without it the pattern would swallow expressions such as 'team prefix of {_t}'.
Examples:
set {_team} to team named "red"
if team named "red" is not set:
set {_team} to a new team named "red"
## Item Without Tooltip
Addon: Skript
Category: Expression
Syntax: %items% with[:out] [the|its|their] (entire|:additional) tool[ ]tip[s]
Description: An item with its tooltip hidden, or shown again.
The entire tooltip hides everything, including the name and lore of the item.
The additional tooltip hides the same parts as the hide additional tooltip item flag, such as potion effects, banner patterns and the contents of a container.
Examples:
give player stone without entire tooltip
give player potion of healing without its additional tooltip
set {_item} to {_hidden item} with entire tooltip
## Reversed List
Addon: Skript
Category: Expression
Syntax: reversed %objects%
Description: Reverses given list.
Examples:
set {_list::*} to reversed {_list::*}
## NBT Compound
Addon: Skript
Category: Expression
Syntax: [:custom] nbt [compound[s]] (of|from) %taggables/strings/items%
Description: The NBT compound of a taggable, string, item, or file.
Examples:
set {_nbt} to nbt compound of player's tool
## Centered Point
Addon: Skript
Category: Expression
Syntax: centered %points%
Description: Returns the center of a block position (adds 0.5 to x and z).
Examples:
set {_p} to centered player's position
## Keyed
Addon: Skript
Category: Expression
Syntax: (keyed|indexed) %objects%
Description: This expression is used to explicitly pass the keys of an expression alongside its values. For example, when setting a list variable or passing an expression to a function.
Examples:
set {_first::foo} to "value1"
set {_first::bar} to "value2"
set {_second::*} to keyed {_first::*}
# {_second::foo} is "value1" and {_second::bar} is "value2"
function indices(objects: objects) returns strings:
return indices of {_objects::*}
on load:
set {_list::foo} to "value1"
set {_list::bar} to "value2"
set {_list::baz} to "value3"
broadcast indices({_list::*}) # "1", "2", "3"
broadcast indices(keyed {_list::*}) # "foo", "bar", "baz"
function plusOne(numbers: numbers) returns numbers:
loop {_numbers::*}:
set {_numbers::%loop-index%} to loop-value + 1
return {_numbers::*}
on load:
set {_numbers::foo} to 1
set {_numbers::bar} to 2
set {_numbers::baz} to 3
set {_result::*} to keyed plusOne(keyed {_numbers::*})
# {_result::foo} is 2, {_result::bar} is 3, {_result::baz} is 4
## New Weather
Addon: Skript
Category: Expression
Syntax: [a] [new] weather with rain level %number% [[(,|and)] [with] thunder level %number%]
Description: Creates a weather with the given rain and thunder levels. Both are numbers between 0 and 1 and are clamped to that range. A level that isn't given defaults to 0.
Examples:
set weather of {_instance} to new weather with rain level 0.4 and thunder level 0.2
set {_drizzle} to new weather with rain level 0.15
## Particle With Data
Addon: Skript
Category: Expression
Syntax: %*particle% (using|with) %item/dustoption/dusttransition/block/rgblike/number/integer/vibrationdata/traildata/effectdata%
Description: A particle with extra data such as block, item, or dust options.
Examples:
set {_p} to block particle using stone
## Entity Attribute
Addon: Skript
Category: Expression
Syntax: [the] %attributetypes% [((total|final|modified))] attribute[s] [value[s]] of %livingentities%
Description: The numerical value of an entity's particular attribute(s).
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 join:
set player's scale attribute to 0.5
set player's (max health and scale) attributes to 10
## Distance
Addon: Skript
Category: Expression
Syntax: [the] distance between %point% and %point%
Description: 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!"
## Vectors - Vec Projection
Addon: Skript
Category: Expression
Syntax: [vector] projection [of] %vector% on[to] %vector%
Description: An expression to get the vector projection of two vectors.
Examples:
set {_projection} to vector projection of vector(1, 2, 3) onto vector(4, 4, 4)
## Index Of
Addon: Skript
Category: Expression
Syntax: [the] (|first|last) index of %string% in %string%
Description: 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}
## Join & Split
Addon: Skript
Category: Expression
Syntax: (concat[enate]|join) %strings% [(with|using|by) [[the] delimiter] %string%]
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 name of all players with "" | ""%" # %all players% would use the default "x, y, and z"
set {_s::*} to the string argument split at ","
## Item With Flags
Addon: Skript
Category: Expression
Syntax: %items% with [the] item flag[s] %itemflags%
Description: An item with the given item flags applied, hiding those parts of its tooltip.
Examples:
give player diamond sword with the hide attributes item flag
set {_potion} to potion of healing with all item flags
set {_i} to stone with the item flags hide dye and hide enchants
## Parse
Addon: Skript
Category: Expression
Syntax: %string% parsed as (%*classinfo%|"<.*>")
Description: 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
## Point with Property
Addon: Skript
Category: Expression
Syntax: %point% with (:x|:y|:z|:yaw|:pitch) [value] [of] %number%
Description: A point with a specific property (x, y, z, yaw, pitch) modified.
Examples:
set {_p} to player's position with yaw 90
## Random Number
Addon: Skript
Category: Expression
Syntax: [a] random (:integer|number) (from|between) %number% (to|and) %number%
Description: 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
## Item with Lore
Addon: Skript
Category: Expression
Syntax: %item% with lore %components%
Description: An item with a specific lore.
Examples:
give player stone with lore "First line" and "Second line"
## Direction
Addon: Skript
Category: Expression
Syntax: [%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%]
Description: 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
## Difference
Addon: Skript
Category: Expression
Syntax: difference (between|of) %object% and %object%
Description: The difference between two values Supported types include numbers, dates and times.
Examples:
if difference between {command::%player%::lastuse} and now is smaller than a minute:
message "You have to wait a minute before using this command again!"
## Point Offset
Addon: Skript
Category: Expression
Syntax: %points%[ ](offset by|~)[ ]%point%
Description: A point offset by a certain amount.
Examples:
set {_p} to player's position offset by vector(1, 2, 3)
## Vector Rotated Around XYZ Axis
Addon: Skript
Category: Expression
Syntax: %vectors% rotated around (x|y|z)(-| )axis by %number% [degrees]
Description: Rotates a vector around the x, y, or z axis by a number of degrees.
Examples:
set {_v} to vector(1, 0, 0) rotated around y-axis by 90 degrees
## Item Named
Addon: Skript
Category: Expression
Syntax: %item% (with [the] name|named) %component%
Description: An item with a specific custom name.
Examples:
give player stone named "Lucky Stone"
## New Dialog Option
Addon: Skript
Category: Expression
Syntax: [new] [dialog] option %string% [labeled %component%] [selected:selected]
Description: Creates one entry for a single option input.
The id is what comes back in the click payload; the label is what the player sees and
defaults to the id. Marking an option as selected makes it the initial choice.
Examples:
set {_easy} to new dialog option "easy" labeled mm("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 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!"
## Item Material Id
Addon: Skript
Category: Expression
Syntax: [the] material id of %items%
Description: Allows you to get the material id (namespace) of an item.
Examples:
send material id of wooden shovel to player # prints minecraft:wooden_shovel
## Team Of
Addon: Skript
Category: Expression
Syntax: [the] team of %entities%
Description: The team a player, entity or raw member name belongs to, if any.
Examples:
if team of player is set:
broadcast team name of team of player
## Shadow
Addon: Skript
Category: Expression
Syntax: [the] [text] shadow [property] of %entities%
Description: The shadow state of a text display entity.
Examples:
set shadow of {_entity} to true
## Vectors - Length
Addon: Skript
Category: Expression
Syntax: [the] (vector|standard|normal) length[s] of %vectors%
Description: Gets or sets the length of a vector.
Examples:
send "%standard length of vector 1, 2, 3%"
## Absorption Hearts
Addon: Skript
Category: Expression
Syntax: [the] absorption hearts of %players%
Description: The absorption hearts of a player.
Examples:
set absorption hearts of player to 20
## Physics
Addon: Skript
Category: Expression
Syntax: [the] physics [property] of %entities%
Description: Whether physics is enabled for an entity.
Examples:
set physics property of {_entity} to false
## Item Pickup State
Addon: Skript
Category: Expression
Syntax: [the] item pick[ ]up[ability] [state] of %entities%
Description: Whether a living entity is allowed to pick dropped items up, which is disabled for every entity by default.
The item pickup event only runs for entities that have this enabled.
Entities that are not living entities are ignored.
Examples:
set item pickup state of player to true
on item pickup:
if item pickup state of event-entity is true:
give event-item to event-entity
## Timespan Details
Addon: Skript
Category: Expression
Syntax: [the] (:(tick|second|minute|hour|day|week|month|year))s of %timespans%
Description: Retrieve specific information of a timespan such as hours/minutes/etc.
Examples:
set {_t} to difference between now and {Payouts::players::%uuid of player%::last-date}
send "It has been %days of {_t}% day(s) since last payout."
## Slot Index
Addon: Skript
Category: Expression
Syntax: [the] ([slot] index|slot number[s]) of %slots%
Description: The index/number of a slot.
Examples:
broadcast "%slot index of player's tool%"
## Time Since Spawn
Addon: Skript
Category: Expression
Syntax: [the] time since spawn of %entities%
Description: How long ago a dropped item entered its instance.
This is real time rather than ticks, so it keeps counting for a non ticking dropped item.
Examples:
on item pickup:
if time since spawn of event-entity is less than 5 seconds:
cancel event
## Slime Size
Addon: Skript
Category: Expression
Syntax: [the] slime size of %entities%
Description: The size of a slime entity.
Examples:
set slime size of {_entity} to 3
## Display Block
Addon: Skript
Category: Expression
Syntax: [the] display block of %entities%
Description: The block displayed by a block display entity.
Examples:
set display block of {_entity} to stone
## Dialog Buttons
Addon: Skript
Category: Expression
Syntax: [the] [dialog] buttons of %dialogs%
Description: The action buttons of a multi action dialog. Supports set, add, remove, and clear. Does nothing for other dialog kinds, which have named buttons instead.
Examples:
add {_buy} to buttons of {_d}
## World Border
Addon: Skript
Category: Expression
Syntax: [the] world border of %instances%
Description: The world border of an instance. While a border is transitioning to a new diameter, this is its state on the current tick rather than the diameter it is heading towards.
Examples:
set world border of {_instance} to new world border with diameter 500
set world border of {_instance} to default world border
reset world border of {_instance}
## Boss Bar Progress
Addon: Skript
Category: Expression
Syntax: [the] [bar] progress of %bossbars%
Description: How full a boss bar is, as number between 0 and 1.
Changing it updates the bar for everybody already seeing it.
Examples:
set progress of {_bar} to 0.5
every second:
subtract 0.05 from progress of {_bar}
## Host Name
Addon: Skript
Category: Expression
Syntax: [the] host[ ]name of %players%
Description: The hostname a player connected with.
Examples:
broadcast "%host name of player%"
## Glow Color Override
Addon: Skript
Category: Expression
Syntax: [the] glow color override of %entities%
Description: The glow color override of a display entity.
Examples:
set glow color override of {_entity} to red
## Automatic Viewability
Addon: Skript
Category: Expression
Syntax: [the] auto[matic] viewab(le|ility) [(state|property)] of %entities%
Description: The automatic viewability state of an entity. If this is false, in order to see the entity, a viewer must be manually added to this entity.
Examples:
set auto viewable state of player to true
## World Border Diameter/Warning Distance/Teleport Boundary
Addon: Skript
Category: Expression
Syntax: [the] ([world] border size|[world border] (diameter|warning:warning distance|boundary:dimension teleport boundary)) of %worldborders/instances%
Description: A number making up a world border, either of a world border itself or of the one an instance is using. The diameter can't go below 0, and neither can the warning distance or the teleport boundary. Resetting one restores it to the value the default world border uses. Only the numbers of an instance's border can be changed, as a world border itself can't be modified. 'size' always needs the 'world border' prefix, as 'size of' on its own is the amount of a list.
Examples:
set diameter of world border of {_instance} to 100
add 50 to world border size of {_instance}
set warning distance of world border of {_instance} to 8
## Custom Name Visibility
Addon: Skript
Category: Expression
Syntax: [the] custom name visibil(e|ity) [state] of %entities%
Description: The custom name visibility state of an entity.
Examples:
set custom name visibility of {_zombie} to true
## Level Progress
Addon: Skript
Category: Expression
Syntax: [the] level progress of %players%
Description: 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.
├──── {list::1}: 1
├──── {list::2}: 2
│ ├──── {list::2::1}: 3
│ │ └──── {list::2::1::1}: 4
│ └──── {list::2::2}: 5
└──── {list::3}: 6 increase the player's level progress by 0.5 will make the player gain a level if their progress was more than 50%.
Examples:
on rightclick with diamnod sword:
add 0.05 to player's level progress
## Sorted List
Addon: Skript
Category: Expression
Syntax: sorted %objects%
Description: 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::*}
command /leaderboard:
trigger:
loop reversed sorted {most-kills::*}:
send "%loop-counter%. %loop-index% with %loop-value% kills" to sender
## Boss Bars of Player
Addon: Skript
Category: Expression
Syntax: [the] boss[ ]bars of %players%
Description: Every boss bar currently being shown to a player.
Adding a boss bar shows it, removing one hides it, and clearing hides all of them.
Setting this hides every boss bar the player can currently see, including any another script showed them, before showing the given ones.
Examples:
add {_bar} to boss bars of all players
remove {_bar} from player's boss bars
broadcast "%player% can see %size of boss bars of player% boss bars"
on quit:
clear player's boss bars
## Eye Position
Addon: Skript
Category: Expression
Syntax: [the] (head|eye[s]) [position[s]] of %entities%
Description: The eye position of an entity.
Examples:
set {_pos} to eye position of player
## Sprinting
Addon: Skript
Category: Expression
Syntax: [the] sprint[ing] [state] of %entities%
Description: Whether an entity is sprinting.
Examples:
set sprinting state of player to true
## Navigation Target
Addon: Skript
Category: Expression
Syntax: [the] (path|navigat(or|ion)) target of %entitycreatures%
Description: The navigation target of an entity. Minestom's pathfinding system isn't great right now.
Examples:
set navigation target of {_entity} to player
## Alive Ticks
Addon: Skript
Category: Expression
Syntax: [the] (alive ticks|ticks lived) of %entities%
Description: The number of ticks an entity has been alive.
Examples:
broadcast "%alive ticks of player%"
## Display Shadow Strength
Addon: Skript
Category: Expression
Syntax: [the] [display] shadow strength of %entities%
Description: The shadow strength of a display entity.
Examples:
set display shadow strength of {_entity} to 1
## Skull Item
Addon: Skript
Category: Expression
Syntax: [the] (skull|player[ ]head)[s] of %skins%
Description: Creates a skull item from a skin.
Examples:
give player skull of skin from "jeb_"
give player skull of player # doesn't fetch skin
## Player Skin
Addon: Skript
Category: Expression
Syntax: [the] skin of %players%
Description: The skin of a player.
Examples:
set skin of player to skin from "jeb_"
## Sneaking
Addon: Skript
Category: Expression
Syntax: [the] (sneak|crouch)[ing] [state] of %entities%
Description: Whether an entity is sneaking/crouching.
Examples:
set sneaking state of player to true
## Permission Level
Addon: Skript
Category: Expression
Syntax: [the] permission level of %players%
Description: A player's permission level. This is only used to tell the client what "permissions" it has.
This is used for whether the player can use the gamemode switcher, operator creative tab, entity selector in commands (@s, @a, etc.), etc.
Examples:
set permission level of player to 4
## Gravity
Addon: Skript
Category: Expression
Syntax: [the] gravity [state] of %entities%
Description: The gravity state of an entity.
Examples:
set gravity of player to false
## Tag Namespaced Key
Addon: Skript
Category: Expression
Syntax: [the] [namespace[d]] key[s] of %minecrafttags%
Description: The namespaced key of a minecraft tag, written as "namespace:value".
Tags loaded from vanilla data always use the "minecraft" namespace.
Examples:
broadcast namespaced key of block tag "logs"
set {_keys::*} to namespaced keys of tags of player's tool
## Passengers
Addon: Skript
Category: Expression
Syntax: [the] passengers of %entities%
Description: The passengers of an entity.
Examples:
set {_passengers::*} to passengers of player
add {_entity} to passengers of player
remove player from passengers of vehicle
## Weather
Addon: Skript
Category: Expression
Syntax: [the] weather of %instances%
Description: The weather of an instance. Setting it lets minestom pick how long the change takes; use the transition weather effect to control the duration yourself.
Examples:
set weather of {_instance} to thundering weather
set weather of {_instance} to new weather with rain level 0.4
reset weather of {_instance}
## Display Item
Addon: Skript
Category: Expression
Syntax: [the] display item [slot] of %entities%
Description: The item displayed by an item display entity.
Examples:
set display item of {_entity} to diamond sword
## Rounding
Addon: Skript
Category: Expression
Syntax: (a|the|) round[ed] down %number%
Description: 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
## Held Item
Addon: Skript
Category: Expression
Syntax: [the] (tool|held item|weapon) [of %equipmenthandlers%]
Description: The held item (tool) of an entity.
Examples:
set tool of player to diamond sword
## Item Display Context
Addon: Skript
Category: Expression
Syntax: [the] [item] display context of %entities%
Description: The display context of an item display entity.
Examples:
set display context of {_entity} to head
## Height
Addon: Skript
Category: Expression
Syntax: [the] height of %entities%
Description: The height of a display or interaction entity.
Examples:
set height of {_entity} to 1.5
## Viewers
Addon: Skript
Category: Expression
Syntax: [the] viewers of %entities%
Description: The viewers of an entity.
Examples:
add {_owner} to viewers of {_invisible-admin} # reveal admin to owner
remove {_owner} from viewers of {_invisible-admin} # owner can't see admin anymore
## Team Friendly Fire / See Invisible Teammates
Addon: Skript
Category: Expression
Syntax: [the] (friendly fire|invisible:see invisible [teammates]) of %teams%
Description: Whether members of a team can damage each other, and whether they can see invisible teammates.
Changing either updates every client that can see the team.
Examples:
set friendly fire of {_team} to false
set see invisible teammates of {_team} to true
## Debug Info
Addon: Skript
Category: Expression
Syntax: [the] debug info[rmation] of %objects%
Description: Returns a string version of the given objects, but with their type attached:
debug info of 1, "a", 0.5 -> 1 (long), "a" (string), 0.5 (double)
This is intended to make debugging easier, not as a reliable method of getting the type of a value.
Examples:
broadcast debug info of {list::*}
## Particle Setting
Addon: Skript
Category: Expression
Syntax: [the] particle setting of %players%
Description: A player's particle display setting.
Examples:
send particle setting of player to player
## Reduced Debug Information
Addon: Skript
Category: Expression
Syntax: [the] reduced debug info[rmation] [property] of %players%
Description: Whether a player has reduced debug information enabled. Limits their F3 menu's capabilities and disables hitboxes (F3+b).
Examples:
set reduced debug information property of player to true
## Arrow Count
Addon: Skript
Category: Expression
Syntax: [the] arrow count of %livingentities%
Description: The number of arrows in a living entity.
Examples:
set arrow count of player to 5
## Length
Addon: Skript
Category: Expression
Syntax: [the] length of %strings%
Description: The length of a text, in number of characters.
Examples:
set {_l} to length of "bob" # 3
## Group
Addon: Skript
Category: Expression
Syntax: [the] group[plural:s] of %players%
Description: The primary group or all groups of a player
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
## Listed
Addon: Skript
Category: Expression
Syntax: [the] listed [property] of %players%
Description: Whether a player is listed in the tab list.
Examples:
set listed property of player to false
## Name
Addon: Skript
Category: Expression
Syntax: [the] [custom[ ]]name of %entities/inventories/items%
Description: The name of a player, entity, or item.
Examples:
set name of {_entity} to "Custom Name"
## Mergeable State
Addon: Skript
Category: Expression
Syntax: [the] mergeab(le|ility) [state] of %entities%
Description: Whether a dropped item merges with other dropped items of the same kind near it, which is
enabled by default.
A non ticking dropped item never merges either way.
Examples:
drop 32 of stone at player's position:
before spawn:
set mergeable state of entity to false
## Camera Target
Addon: Skript
Category: Expression
Syntax: [the] camera [target] of %players%
Description: The camera target of a player
Examples:
set camera target of player to {_entity}
## Prefix/Suffix
Addon: Skript
Category: Expression
Syntax: [the] (:prefix|suffix) of %players%
Description: A player's LuckPerms prefix or suffix.
Examples:
broadcast "%prefix of player%"
## Player Input Keys
Addon: Skript
Category: Expression
Syntax: [the] [current] (inputs|input keys) of %players%
Description: Get the current input keys of a player.
Examples:
broadcast "%player% is pressing %current input keys of player%"
## Text Alignment
Addon: Skript
Category: Expression
Syntax: [the] text alignment of %entities%
Description: The alignment of a text display entity.
Examples:
set alignment of {_entity} to center
## Instance/World
Addon: Skript
Category: Expression
Syntax: [the] instance of %entities%
Description: The instance an entity is in.
Examples:
broadcast "%instance of player%"
## Velocity
Addon: Skript
Category: Expression
Syntax: [the] velocity of %entities%
Description: The velocity of an entity. Velocity values on Minestom are 1/20th (20 ticks per second is why) the value of Paper's.
Examples:
set velocity of player to vector(0, 20, 0)
## Instance Time
Addon: Skript
Category: Expression
Syntax: [the] time [:rate] of %instances%
Description: The time or time rate of an instance.
Examples:
set time of {_instance} to 6000 # noon
set time rate of {_instance} to 0 # sun won't move
## Group Weight
Addon: Skript
Category: Expression
Syntax: weight of group[s] [named] %strings%
Description: The weight of a LuckPerms group.
Examples:
set {_weight} to weight of group named "default"
## Display Brightness Override
Addon: Skript
Category: Expression
Syntax: [the] [display] (:block|sky) brightness [override] of %entities%
Description: The block or sky brightness override of a display entity.
Examples:
set display block brightness override of {_entity} to 15
## Max Health
Addon: Skript
Category: Expression
Syntax: [the] max health of %livingentities%
Description: The maximum health of a living entity.
Examples:
set max health of player to 40
## Unix Timestamp
Addon: Skript
Category: Expression
Syntax: [the] unix timestamp of %dates%
Description: Converts given date to Unix timestamp. This is roughly how many seconds have elapsed since 1 January 1970.
Examples:
unix timestamp of now
## Entity ID
Addon: Skript
Category: Expression
Syntax: [the] entity id of %entities%
Description: The network entity ID of an entity.
Examples:
broadcast "ID: %entity id of player%"
## Unix Date
Addon: Skript
Category: Expression
Syntax: [the] unix date of %numbers%
Description: 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)
## Inventory
Addon: Skript
Category: Expression
Syntax: [the] [(current|open)] [:slot] inventory of %players/slots%
Description: The inventory of a player/slot.
Examples:
clear inventory of player
## Width
Addon: Skript
Category: Expression
Syntax: [the] width of %entities%
Description: The width of a display or interaction entity.
Examples:
set width of {_entity} to 1
## Cursor Slot
Addon: Skript
Category: Expression
Syntax: [the] cursor slot of %players%
Description: The item which the player has on their inventory cursor
Examples:
cursor slot of player is dirt
set cursor slot of player to 64 diamond
## Dropped Item
Addon: Skript
Category: Expression
Syntax: [the] drop[ped] item [slot] of %entities%
Description: The item a dropped item entity is showing.
This also works on an item entity that was spawned through the spawn section rather than
dropped, which is how such an entity is given an item to show.
Examples:
on item pickup:
give dropped item of event-entity to player
spawn item at player's position:
before spawn:
set dropped item of entity to diamond
## Translation Key
Addon: Skript
Category: Expression
Syntax: [the] translation key of %entitytypes/items/attributetypes/blocks%
Description: The translation key of an entity type, item, attribute, block, or sound.
Examples:
broadcast "%translation key of zombie%"
## Username/UUID From Mojang
Addon: Skript
Category: Expression
Syntax: [mojang] (:uuid|username)[s] from %strings%
Description: Looks up a Mojang username from a UUID or vice versa.
Examples:
set {_name} to username from "%uuid of player%"
## Sidebar/Scoreboard
Addon: Skript
Category: Expression
Syntax: [the] (score[ ]board|side[ ]bar) of %players%
Description: The sidebar/scoreboard of a player.
Examples:
set sidebar of player to new sidebar named "bob"
## Glowing
Addon: Skript
Category: Expression
Syntax: [the] glow[ing] [state] of %entities%
Description: The glowing state of an entity.
Examples:
set glowing of player to true
## Display View Range
Addon: Skript
Category: Expression
Syntax: [the] [display] view[ ]range of %entities%
Description: The view range of a display entity.
Examples:
set display view range of {_entity} to 2
## Dialog Title
Addon: Skript
Category: Expression
Syntax: [the] [dialog] title of %dialogs%
Description: The title of a dialog. Changing it only affects dialogs shown after the change.
Examples:
set title of {_d} to mm("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
## Edit Entity Meta
Addon: Skript
Category: Section
Syntax: (modify|edit) [entity] meta[data] of %entities%
Description: Edits the metadata of one or more entities. Unnecessary unless you want entity meta to apply in one packet.
Examples:
edit meta of {_zombie}:
set name of entity to "New Name"
set custom name visibility of entity to true
## Create Environment
Addon: Skript
Category: Section
Syntax: create (:dimension|biome) [type] under [name[ ]space] %string% [(and store it|stored) in %objects%]
Description: Registers a custom dimension type or biome under the provided namespace.
Namespace must be in 'prefix:value' format.
Both dimensions and biomes can have environment attributes. You can find a list of them at
https://javadoc.minestom.net/net.minestom.server/net/minestom/server/world/attribute/EnvironmentAttribute.html.
Entries should be in lower case with spaces instead of underscores.
NOTE: Since both dimensions and biomes can have environment attributes, one may override the other, so if for example
you find that your sky color isn't showing up, the default biome may be overriding that, so you may need a custom biome.
- Dimension-specific Entries
fixed time -> boolean
sky light -> boolean
ceiling -> boolean
coordinate scale -> number
minimum y -> integer
maximum y -> integer
logical y -> integer
infiniburn -> integer
ambient light -> number (typically between 0 and 1)
skybox -> skybox
cardinal light -> cardinal light
- Biome-specific Entries
precipitation -> boolean
temperature -> number
temperature modifier -> temperature modifier
downfall -> number
water color -> color
foliage color -> color
dry foliage color -> color
grass color -> color
grass color modifier -> grass color modifier
Examples:
create biome under "test:lobby" stored in {_b}:
sky color: rgb(111, 223, 249)
fog color: rgb(253, 252, 198)
foliage color: rgb(71, 255, 0)
water color: rgb(111, 223, 249)
create instance container stored in {-worlds::lobby}:
loader: polar
file: "worlds/lobby/lobby.polar"
preload biome: {_b}
preload option: strict
## Create Instance/World
Addon: Skript
Category: Section
Syntax: create instance [container] (and store it|stored) in %objects%
Description: Creates a new instance container or a shared instance. Instances are Minestom's lightweight world equivalent.
Shared instances are an ultra lightweight 'world' that share the chunk data (blocks) from its parent world. Entities are not shared.
- Entries
dynamic lighting -> boolean
file -> string
file dimension -> string (only used if world was made after 26.1, example: minecraft:overworld)
loader -> anvil/polar (Anvil is the world format that Minecraft uses and Polar was custom in-memory format made for smaller worlds by hollowcube for Minestom)
dimension -> dimensiontype
preload biome -> biome (fills the entire world with the provided biome)
[async] preload option -> normal/strict (strict will not allow default generation of new chunks, even blank ones, as the player travels the world)
preload chunk amount -> number (the radius in chunks to preload when there is no world file to read chunks from, defaults to the server's chunk view distance)
generator -> section allowing custom generation of each chunk as the world loads (complex generation not recommended as it can get laggy with Skript)
Examples:
create biome under "test:lobby" stored in {_b}:
sky color: rgb(111, 223, 249)
fog color: rgb(253, 252, 198)
foliage color: rgb(71, 255, 0)
water color: rgb(111, 223, 249)
create instance container stored in {-worlds::lobby}:
loader: polar
file: "worlds/lobby/lobby.polar"
preload biome: {_b}
async preload option: strict
## For Each Loop
Addon: Skript
Category: Section
Syntax: (for [each]|loop) [value] %object% in %objects%
Description: A specialised loop section run for each element in a list.
Unlike the basic loop, this is designed for extracting the key & value from pairs.
The loop element's key/index and value can be stored in a variable for convenience.
When looping a simple (non-indexed) set of values, e.g. all players, the index will be the loop counter number.
Examples:
for each {_player} in players:
send "Hello %{_player}%!" to {_player}
loop {_item} in {list of items::*}:
broadcast {_item}'s name
for each key {_index} in {list of items::*}:
broadcast {_index}
## Teleport
Addon: Skript
Category: Section
Syntax: teleport %entities% to %point% [instance:in [(world|instance)] %instance%] [:sync]
Description: Teleports one or more entities to a location.
Optionally specify an instance to move entities into a different world.
Use 'sync' to wait for each teleport to finish before continuing.
An optional subsection runs once the teleport completes.
Examples:
teleport player to vector(0, 64, 0):
broadcast "Player arrived!"
teleport {_entity} to {_loc} in instance {_instance} sync:
set health of entity to 20
## Send Resource Pack
Addon: Skript
Category: Section
Syntax: send [resource] pack [from [url]] %string% with (uuid|id) %string% with hash %string% [with prompt %component%] to %players% [(forcefully|with force)] [replace:to replace [current packs]]
Description: Sends a resource pack to one or more players.
Examples:
send resource pack from "https://example.com/pack.zip" with uuid "..." with hash "..." to player:
if resource pack status is successfully loaded:
broadcast "Pack loaded!"
## Subcommand
Addon: Skript
Category: Section
Syntax: subcommand <.+>
Description: Allows you to define a subcommand within a command. Works exactly like a command.
## Command Argument
Addon: Skript
Category: Section
Syntax: arg[ument] <.+>
Description: This section allows you to create and more finely control custom command arguments.
List of argument types with the skript type that will be stored in the variable:
- literal -> string
- boolean -> boolean
- integer -> integer
- long -> integer
- double -> number
- float -> number
- string -> string # can be unlimited length, just must be surrounded by quotation marks if there are spaces for this argument
- word -> string # singular piece of text
- stringarray -> strings # should eat the rest of the command (typically how bukkit commands work)
- gamemode -> gamemode # format entry supported
- soundcategory -> soundcategory # format entry supported
- particle -> particle
- entitytype -> entitytype
- block -> block # essentially paper's blockdata
- entity -> entity
- entities -> entities
- player -> player
- players -> players
- item -> item
- component -> component
- uuid -> string
- nbtcompound -> nbtcompound
- blockposition -> position # relative, can use ~ in arguments for example
- vector -> position # relative, can use ~ in arguments for example
- 2dvector -> vector # relative, can use ~ in arguments for example. Relative part is for sender's yaw/pitch. X and Z are the values, y is 0.
- attributetype -> attributetype
- biome -> biome
- damagetype -> string
- enchant -> enchantment
- sound -> string # sound id
NOTE: Entity/player selectors (@s, @a, etc.) are supported, but the sender must have the proper permission level in order for it to show up.
See the 'Permission Level' expression
Examples:
# Rough Syntax
arg[ument]