Input
stringlengths
10
1.56k
Instruction
stringlengths
2
70
Output
stringlengths
2
1.79k
The seed of given world. Note that it will be returned as Minecraft internally treats seeds, not as you specified it in world configuration.
World Seed
[the] seed[s] (from|of) %worlds%
Returns the world from a string.
World from Name
[the] world [(named|with name)] %text%
All worlds of the server, useful for looping.
Worlds
[(all [[of] the]|the)] worlds
Integers between 1 and X, used in loops to loop X times.
X Times
%number% time[s]
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.
X of Item
%number% of %item stacks/item types/entity type%
The yaw or pitch of a location or vector.
Yaw / Pitch
[the] (yaw|pitch) of %locations/vectors%
Returns the absolute value of the argument, i.e. makes the argument positive.
abs
abs(n: number)
The inverse of the cosine, also called arccos. Returns result in degrees, not radians. Only returns values from 0 to 180.
acos
acos(n: number)
The inverse of the sine, also called arcsin. Returns result in degrees, not radians. Only returns values from -90 to 90.
asin
asin(n: number)
The inverse of the tangent, also called arctan. Returns result in degrees, not radians. Only returns values from -90 to 90.
atan
atan(n: 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).
atan2
atan2(x: number, y: number)
Calculates the total amount of experience needed to achieve given level from scratch in Minecraft.
calcExperience
calcExperience(level: long)
Checks if the contents of a list of strings are strictly equal with case sensitivity.
caseEquals
caseEquals(strs: strings)
Rounds a number up, i.e. returns the closest integer larger than or equal to the argument.
ceil
ceil(n: number)
Alias of ceil.
ceiling
ceiling(n: number)
Clamps one or more values between two numbers.
clamp
clamp(values: numbers, min: number, max: 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.
cos
cos(n: number)
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).
date
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]])
The exponential function. You probably don't need this if you don't know what this is.
exp
exp(n: number)
Rounds a number down, i.e. returns the closest integer smaller than or equal to the argument.
floor
floor(n: number)
Returns true if the input is NaN (not a number).
isNaN
isNaN(n: 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.
ln
ln(n: number)
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.
location
location(x: number, y: number, z: number, world: world = event-world, yaw: number = [[integer:0]], pitch: number = [[integer:0]])
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.
log
log(n: number, base: number = [[integer:10]])
Returns the maximum number from a list of numbers.
max
max(ns: numbers)
Returns the minimum number from a list of numbers.
min
min(ns: numbers)
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.
mod
mod(d: number, m: number)
Returns a offline player from their name or UUID. This function will still return the player if they're online.
offlineplayer
offlineplayer(nameOrUUID: string)
Returns an online player from their name or UUID, if player is offline function will return nothing. Setting 'getExactPlayer' parameter to true will return the player whose name is exactly equal to the provided name instead of returning a player that their name starts with the provided name.
player
player(nameOrUUID: string, getExactPlayer: boolean = [[boolean:false]])
Calculates the product of a list of numbers.
product
product(ns: numbers)
Returns a RGB color from the given red, green and blue parameters.
rgb
rgb(red: long, green: long, blue: long)
Rounds a number, i.e. returns the closest integer to the argument. Place a second argument to define the decimal placement.
round
round(n: number, d: number = [[integer:0]])
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.
sin
sin(n: 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.
sqrt
sqrt(n: number)
Sums a list of numbers.
sum
sum(ns: numbers)
The tangent function. This is basically sin(arg)/cos(arg). Uses degrees, not radians.
tan
tan(n: number)
Creates a new vector, which can be used with various expressions, effects and functions.
vector
vector(x: number, y: number, z: number)
Gets a world from its name.
world
world(name: string)
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 executedparse 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
Conditionals
else
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 *).
Loop
loop %objects%
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.
Spawn
(spawn|summon) %entity types% [%directions% %locations%]
While Loop sections are loops that will just keep repeating as long as a condition is met.
While Loop
[do] while <.+>
Used for registering custom aliases for a script.
Aliases
aliases
Used for registering custom commands.
Command
command <.+>
Functions are structures that can be executed with arguments/parameters to run code. They can also return a value to the trigger that is executing the function. Note that local functions come before global functions execution
Function
[local] function <.+>
Options are used for replacing parts of a script with something else. For example, an option may represent a message that appears in multiple locations. Take a look at the example below that showcases this.
Options
options
Used for defining variables present within a script. This section is not required, but it ensures that a variable has a value if it doesn't exist when the script is loaded.
Variables
variables