Releases: SkriptLang/Skript
Feature Release 2.13.0
Skript 2.13.0
Today, we are excited to release Skript 2.13.0. This release includes a handful of new features, bug fixes, and behind-the-scenes API improvements to play with. For addon developers, we strongly recommend reviewing the Type Properties section below.
Please also note our changes to the supported versions. 2.13 will be 1.20.4+, and Paper is required.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Per our release model, we plan to release 2.13.1 on November 1st. We may release emergency patches before then should the need arise.
Happy Skripting!
Changes to Supported Versions and Platforms
As announced with 2.12, we have updated our policy for supported versions. Going forward, Skript will guarantee support for the last 18 months of Minecraft releases. This means 2.13 will be 1.20.4+, while 2.14 will be 1.21+.
Additionally, with Paper forking itself from Spigot, it has become increasingly difficult to support both platforms. As a result, this version of Skript has dropped support for Spigot. Skript now requires Paper or a downstream fork of Paper, such as Purpur or Pufferfish.
Major Changes
Equippable Components (Experimental)
Added in #7194
Note
This feature is currently experimental and can be used by enabling the equippable components
experiment.
Equippable components allow retrieving and changing the data of an item in the usage as equipment/armor.
Below is an example of creating a blank equippable component, modifying it, and applying it to an item:
set {_component} to a blank equippable component:
set the camera overlay to "custom_overlay"
set the allowed entities to a zombie and a skeleton
set the equip sound to "block.note_block.pling"
set the equipped model id to "custom_model"
set the shear sound to "ui.toast.in"
set the equipment slot to chest slot
allow event-equippable component to be damage when hurt
allow event-equippable component to be dispensed
allow event-equippable component to be equipped onto entities
allow event-equippable component to be sheared off
allow event-equippable component to swap equipment
set the equippable component of {_item} to {_component}
Automatic Reloading
Added in #7464
A new Structure has been added that enables automatic reloading of a script when it is updated (e.g. the file is saved). This feature is only supported if asynchronous loading is enabled in Skript's configuration file (config.sk
).
automatically reload this script:
recipients: "Sahvde" # The names or uuids of players who, apart from console, will see the success/error messages in chat.
OR
auto reload:
permission: myserver.see_auto_reloads # all players with this permission will see the messages.
Debug Information Expression
Added in #8207
A new expression that returns additional information about a value has been added. Currently, this consists of the value itself and its class, though this is subject to change in the future.
set {my_list::*} to 1, "2", and vector(1, 2, 3)
broadcast debug info of {my_list::*}
# prints:
# 1 (integer)
# "2" (text)
# x: 1, y: 2, z: 3 (vector)
Type Properties (Experimental)
Added in #8165
Included in 2.13 is an experimental opt-in API for what we're tenatively calling 'type properties'. These are a way for addons to be able to use the same generic name of x
or x contains y
syntaxes that Skript does without causing syntax conflicts. You can register your type (ClassInfo
) as having a property, such as Property#NAME
for name of x
, and Skript will automatically allow it to be used in the name of
expression. For more details on how to do this and what else you can do with type properties, see the PR. We plan on making a more comprehensive API spec/tutorial once the implementation is solidified, but for now the PR description should be more than sufficient to try it out.
However, since this is still experimental and not well tested, it requires a secret config option to enable. To activate property syntaxes, add the line use type properties: true
somewhere in your config.sk
. Without it, Skript will still use the old syntaxes for things like name of
. We hope you try out this new API and give us feedback on what works, what doesn't, and what you'd like to see for its full release in 2.14. The number of property-driven syntaxes is rather small, but we plan on adding many more in the coming months!
⚠ Breaking Changes
- #7985 Changes the method signature for the abstract
EntityData#init
. Adds parametermatchedCodeName
and refactorsmatchedPattern
. - #8072 Enforces using
physics
instead ofphysic
in the block update effect.
Changelog
Additions
- #7194 Adds experimental support for equippable components and all correlating data.
- #7275 Adds elements for brewing stands such as brewing stand slots, fuel, time, and events.
- #7464 Adds a structure that allows a script to be automatically reloaded when it is saved, if async loading is enabled in config.sk.
- #7878 Adds support for specifying the amount of damage in the 'force attack' effect.
- #7888 Adds a 'midpoint' expression to obtain the midpoint between two locations or vectors.
- #7985 Adds an 'is spawnable' condition to check whether an entity is spawnable in a world.
- #8008 Adds literals for the maximum 'double', 'float', 'integer', and 'long' values and the minimum 'double', 'float', 'integer', and 'long' values.
- #8092 Adds support for using 'vehicle' alone in the 'mount' event.
- #8101 Adds a 'tablisted players' expression to obtain and modify the players listed in the tablist menu for a given player.
- #8113 Adds the ability to enchant an item at as a specific level, as if an enchanting table was used, to the 'enchant' effect.
- #8134 Adds a 'time lived' expression to get the duration an entity has been alive for.
- #8196 Adds a runtime error when attempting to get the distance between locations in different worlds.
- #8197 Adds support for changing the
event-location
for 'portal' event. - #8206 Adds a runtime error when using the sort effect and mapping the input to a null value, which cannot be sorted.
- #8207 Adds a 'debug info' expression that returns extra information about a value.
- #8219 Adds early support for Minecraft 1.21.10.
- #8229 Adds
playtime
as an alias to the 'time played' expression. - #8230 Adds
pull
as an alias to the 'push' effect.
Changes
- #8072 Enforces using
physics
instead ofphysic
in the block update effect.
Bug Fixes
- #7985 Fixes being unable to spawn certain entities in certain states, such as
red fox
andsnow fox
. - #8064 Fixes an issue where it was not possible to spawn a
minecart
. - #8177 Fixes the 'cannot reset' and 'cannot delete' error messages of the 'change' effect being swapped around.
- #8182 Fixes an issue where variable changes across multiple threads could be processed in the wrong order, resulting in data loss.
- #8185 Fixes the 'system time' event not triggering on the main thread.
- #8189 Fixes an issue where function calls with a single parameter to functions with 0 required parameters would fail to parse.
- #8195 Fixes an issue where the 'catch runtime errors' section would stop catching errors after the default error limit was reached.
- #8199 Fixes an issue where functions could not use Expression Sections.
- #8232 Fixes an issue where Expression Sections did not work properly with Effect Sections (used as an Effect).
API Changes
Pre-Release 2.13.0-pre1
Skript 2.13.0-pre1
Hi all, we've got a new feature pre-release for you all. Thankfully, this one's a bit more reasonable in size than the massive releases of 2.10, 2.11, and 2.12. We have some great features and a bunch of behind-the-scenes API improvements for you this go around. Addon developers should pay special attention to the Type Properties section below.
Please also note our changes to the supported versions. 2.13 is 1.20.4+, and Paper only.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Per our release model, we plan to release 2.13.0 on October 15th. We may release additional pre-releases before then should the need arise.
Happy Skripting!
Changes to Supported Versions and Platforms
As announced with 2.12, we have updated our policy for supported versions. Going forward, Skript will guarantee support for the last 18 months of Minecraft releases. This means 2.13 is 1.20.4+, while 2.14 will be 1.21+.
Additionally, with Paper forking itself from Spigot, it has become increasingly difficult to support both platforms. As a result, this version of Skript is dropping support for Spigot. Skript now requires Paper or a downstream fork of Paper, such as Purpur or Pufferfish.
Major Changes
- #7194 Adds support for equippable components and all correlating data. Smurfy put in a lot of work into the backing API for components, so look forward to a lot more component support in the next few releases!
set the allowed entities of {_item} to a zombie and a skeleton
make {_item} lose durability when hurt
if {_item} can be dispensed:
add "Dispensable" to lore of {_item}
- #7464 Adds a structure that allows a script to be automatically reloaded when it is saved, if async loading is enabled in
config.sk
:
automatically reload this script:
recipients: "Sahvde" # The names or uuids of players who, apart from console, will see the success/error messages in chat.
OR
auto reload:
permission: myserver.see_auto_reloads # all players with this permission will see the messages.
- #8165 Adds Type Property API. See below.
- #8207 Adds a
debug info
expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!
set {my_list::*} to 1, "2", and vector(1, 2, 3)
broadcast debug info of {my_list::*}
# prints:
# 1 (integer)
# "2" (text)
# x: 1, y: 2, z: 3 (vector)
Type Properties (For Addon Devs)
Included in 2.13 is an experimental opt-in API for what we're tenatively calling 'type properties'. These are a way for addons to be able to use the same generic name of x
or x contains y
syntaxes that Skript does without causing syntax conflicts. You can register your type (ClassInfo
) as having a property, such as Property#NAME
for name of x
, and Skript will automatically allow it to be used in the name of
expression. For more details on how to do this and what else you can do with type properties, see the PR. We plan on making a more comprehensive API spec/tutorial once the implementation is solidified, but for now the PR description should be more than sufficient to try it out.
However, since this is still experimental and not well tested, it requires a secret config option to enable. To activate property syntaxes, add the line use type properties: true
somewhere in your config.sk
. Without it, Skript will still use the old syntaxes for things like name of
. We hope you try out this new API and give us feedback on what works, what doesn't, and what you'd like to see for its full release in 2.14. The number of property-driven syntaxes is rather small, but we plan on adding many more in the coming months!
⚠ Breaking Changes
- #7985 Changes the method signature for the abstract
EntityData#init
. Adds parametermatchedCodeName
and refactorsmatchedPattern
. - #8072 Enforces using
physics
instead ofphysic
in the block update effect.
Changelog
Additions
- #7194 Adds support for equippable components and all correlating data.
- #7275 Adds elements for brewing stands such as brewing stand slots, fuel, time, and events.
- #7464 Adds a structure that allows a script to be automatically reloaded when it is saved, if async loading is enabled in config.sk.
- #7888 Adds an expression to get the midpoint between two locations or vectors.
- #7985 Adds a condition to check if an entity is spawnable in a world.
- #8008 Adds literals for the maximum and minimum numerical values, such as longs, doubles, or ints.
- #8101 Adds an expression to get and modify the players listed in the tab menu for a given player.
- #8113 Adds the ability to enchant an item at as a specific level, as if an enchanting table was used.
- #8134 Adds an expression to get the duration an entity has been alive for.
- #8207 Adds a
debug info
expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!
Changes
- #7797 Uses
project.testEnv
inbuild.gradle
instead of updating the latest version for both. - #7878 Allows specifying the amount of damage in the
force entity to attack entity
effect. - #8072 Enforces using
physics
instead ofphysic
in the block update effect. - #8092 Allows using
vehicle
alone in the mount event. - #8196 Adds a runtime error when attempting to get the distance between locations in different worlds.
- #8197 Adds support for changing the
event-location
foron portal
. - #8206 Adds a runtime error when using the sort effect and mapping the input to a null value, which cannot be sorted.
Bug Fixes
- #7985 Fixes being unable to spawn certain entities in certain states, such as
red fox
andsnow fox
. - #8064 Fixes an issue where it was not possible to spawn a
minecart
. - #8177 Fixes the 'cannot reset' and 'cannot delete' error messages being swapped around.
- #8182 Fixes the order of which queued variable changes are processed.
- #8185 Fixes
at %time% [in] real time
by triggering the code on the main thread. - #8189 Fixes functions with 0 required parameters.
- #8195 Fixes an issue where the runtime error catching section would not catch errors after the default error limit is reached.
- #8199 Fixes issues with expression sections not claiming sections when used as function parameters.
API Changes
- #7985 Changes
Pattern
to allow providingnull
as the object for generic usage. - #8011 Exposes the script loader executor via the
Task
api. - #8035 Adds support for using an
EntryData
multiple times. - #8065 Adds support for custom operators.
- #8116 Makes
JSONGenerator
available for addons and updates thedocs.json
format. - #8120 Adds a method to get a
Color
as an ARGB integer. - #8138 Adds getting pattern combinations from
PatternElement
and tests to catch possible pattern conflicts. - #8150 Adds
SimplifiedCondition
for constant conditions.Condition
implementsSimplifiable
. - #8165 Adds the Type Property API.
- #8180 Changes the parameter name for
Expression
class fromexpressionType
toexpressionClass
inSkript#registerExpression
. - #8195 Improves runtime error filtering with the introduction of
RuntimeErrorFilter
, which allows different consumers to apply different levels of filtering to the errors they print. - #8201 Adds support for excluding packages from being loaded in
ClassLoader
. - #8211 Improves the classes
ExpressionList
returns foracceptChange
to more accurately reflect the changers of the expressions within the list. - #8213 Fixes
Functions#getJavaFunctions
to only returnJavaFunction
s.
Click here to view the full list of commits made since 2.12.2
Notices
Experimental Features
Experimental features can be used to enable syntax and other behavior on a per-script basis. Some of these features are new proposals that we are testing while others may have unsafe or complex elements that regular users may not need.
While we have tested the available experiments to the best of our ability, they are they are still in development. As a result, they are subject to change and may contain bugs. Experiments should be used at your own discretion.
Additionally, example scripts demonstrating usage of the available experiments can be found here.
Click to reveal the experiments available in this release
For-Each Loop
Enable by adding using for loops
to your script.
A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
All existing loop features are also available in this section.
Queue
Enable by adding using queues
to your script.
A collection that removes elements whenever they are requested.
This is useful for processing tasks or keeping track of things that need to happen only once.
set {queue} to a new queue of "hello" and "w...
Patch Release 2.12.2
Skript 2.12.2
Today, we are releasing Skript 2.12.2 to continue resolving issues reported with 2.12.
As always, you can report any issues on our issue tracker.
Happy Skripting!
Changelog
Bug Fixes
- #8077 Fixes an issue where using entities with the second 'play effect' pattern was not possible.
- #8098 Implements type-aware function parsing to fix issues where function calls could not be parsed as the correct functions.
- #8109 Fixes an issue where the 'loop value' expression sometimes failed to evaluate when used with other expressions.
- #8135 Fixes issues with function parsing related to loading and having singular default values.
- #8151 Removes an errant colon in the examples for the fire resistance effect.
- #8164 Fixes an exception being thrown for some uses of the
%classinfo% input
expression. - #8147 Fixes a bug where an
else
section was considered delayed due to a delay in itsif
section. - #8171 Fixes parsing order issue with
reversed 2 times
by only allowing plural inputs toreversed %objects%
.
API/Development
- #8041 Exposes
BukkitUtils#getRegistryClassInfo()
to assist with creating types backed by Bukkit or Paper registries. - #8121 Allows null inputs to
Direction.combine()
. - #8132 Loosens generics for
EntryDataExpression
fromT
to? extends T
to allow for subtypes for the default values. - #8145 Prioritizes Skript syntaxes before addon-provided syntaxes when ordering syntaxes of the same priority.
- #8154 Ensures the possible return types for
ExpressionList
are accurate after use ofgetConvertedExpression()
. - #8158 Makes
SectionContext
andSectionContext#modify()
public for addon use.
Click here to view the full list of commits made since 2.12.1
Notices
Experimental Features
Experimental features can be used to enable syntax and other behavior on a per-script basis. Some of these features are new proposals that we are testing while others may have unsafe or complex elements that regular users may not need.
While we have tested the available experiments to the best of our ability, they are they are still in development. As a result, they are subject to change and may contain bugs. Experiments should be used at your own discretion.
Additionally, example scripts demonstrating usage of the available experiments can be found here.
Click to reveal the experiments available in this release
For-Each Loop
Enable by adding using for loops
to your script.
A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
All existing loop features are also available in this section.
Queue
Enable by adding using queues
to your script.
A collection that removes elements whenever they are requested.
This is useful for processing tasks or keeping track of things that need to happen only once.
set {queue} to a new queue of "hello" and "world"
broadcast the first element of {queue}
# "hello" is now removed
broadcast the first element of {queue}
# "world" is now removed
# queue is empty
set {queue} to a new queue of all players
set {player 1} to a random element out of {queue}
set {player 2} to a random element out of {queue}
# players 1 and 2 are guaranteed to be distinct
Queues can be looped over like a regular list.
Script Reflection
Enable by adding using script reflection
to your script.
This feature includes:
- The ability to reference a script in code.
- Finding and running functions by name.
- Reading configuration files and values.
Local Variable Type Hints
Enable by adding using type hints
to your script.
Local variable type hints enable Skript to understand what kind of values your local variables will hold at parse time. Consider the following example:
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
Previously, the code above would parse without issue. However, Skript now understands that when it is used, {_a}
could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
Please note that this feature is currently only supported by simple local variables. A simple local variable is one whose name does not contain any expressions:
{_var} # can use type hints
{_var::%player's name%} # can't use type hints
Runtime Error Catching
Enable by adding using error catching
to your script.
A new catch [run[ ]time] error[s]
section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors
.
catch runtime errors:
...
set worldborder center of {_border} to {_my unsafe location}
...
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
Damage Sources
Enable by adding using damage sources
to your script.
Note that
type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.
Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
damage all players by 5 using a custom damage source:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
Join us on Discord
We have an official Discord community where we share announcements and and perform testing for upcoming features.
Thank You
Special thanks to the contributors whose work was included in this version:
- @Absolutionism
- @APickledWalrus
- @arpita2525 ⭐ First contribution! ⭐
- @JakeGBLP
- @sovdeeth
- @TheLimeGlass
As always, if you encounter any issues or have some minor suggestions, please report them at https://github.com/SkriptLang/Skript/issues.
If you have any bigger ideas or input for the future of Skript, you can share those too at https://github.com/SkriptLang/Skript/discussions.
Patch Release 2.12.1
Skript 2.12.1
Today, we are releasing Skript 2.12.1 to resolve some of the most common issues reported with Skript 2.12.0. This release includes support for Minecraft 1.21.8.
As always, you can report any issues on our issue tracker.
Happy Skripting!
Changelog
Additions / Changes
- #8009 Adds
launch
as an alternative keyword for the 'shoot' event. - #8010 Adds support for checking whether an entity has any potion effects using the 'has potion' condition.
- #8054 Adds support for Minecraft 1.21.8
- #8076 Further tweaks the default syntax ordering to improve performance and error messages.
Bug Fixes
- #8043 Fixes being able to wait for an indefinite amount of time.
- #8046 Fixes an issue where attempting to register overloaded functions with an argument type of one function being convertable to an argument type of another failed.
- #8068 Fixes an issue where literal specification could be too eager and fail with function parameters.
- #8069 Fixes an issue where looping over
all item types
could result in an error on newer versions. - #8071 Fixes an issue where valid arguments for a single list parameter function sometimes failed to resolve to that function.
- #8081 Fixes an issue where seemingly non-literal inputs for the 'x of item/entity type' expression caused the syntax to fail to parse.
- #8082 Fixes an issue where valid statements including a section expression could fail to parse.
- #8086 Fixes an issue where harnesses could not be equipped onto happy ghasts.
- #8087 Fixes edge-case errors that could occur from rounding.
- #8088 Fixes a few minor typographical errors in the configuration.
- #8089 Fixes an issue where default expressions could fail to be used.
- #8090 Fixes an issue where the 'loop value' expression was too accepting of
loop-X
inputs for specific types. - #8096 Fixes an issue where single list parameter functions were always chosen over functions with a specific number of parameters of the same type.
API/Development
- #8000 Improves the testing assertion output for the 'contains' condition.
- #8066 Fixes an issue where the project's checkstyle configuration incorrectly treated tab width.
Click here to view the full list of commits made since 2.12.0
Notices
Experimental Features
Experimental features can be used to enable syntax and other behavior on a per-script basis. Some of these features are new proposals that we are testing while others may have unsafe or complex elements that regular users may not need.
While we have tested the available experiments to the best of our ability, they are they are still in development. As a result, they are subject to change and may contain bugs. Experiments should be used at your own discretion.
Additionally, example scripts demonstrating usage of the available experiments can be found here.
Click to reveal the experiments available in this release
For-Each Loop
Enable by adding using for loops
to your script.
A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
All existing loop features are also available in this section.
Queue
Enable by adding using queues
to your script.
A collection that removes elements whenever they are requested.
This is useful for processing tasks or keeping track of things that need to happen only once.
set {queue} to a new queue of "hello" and "world"
broadcast the first element of {queue}
# "hello" is now removed
broadcast the first element of {queue}
# "world" is now removed
# queue is empty
set {queue} to a new queue of all players
set {player 1} to a random element out of {queue}
set {player 2} to a random element out of {queue}
# players 1 and 2 are guaranteed to be distinct
Queues can be looped over like a regular list.
Script Reflection
Enable by adding using script reflection
to your script.
This feature includes:
- The ability to reference a script in code.
- Finding and running functions by name.
- Reading configuration files and values.
Local Variable Type Hints
Enable by adding using type hints
to your script.
Local variable type hints enable Skript to understand what kind of values your local variables will hold at parse time. Consider the following example:
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
Previously, the code above would parse without issue. However, Skript now understands that when it is used, {_a}
could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
Please note that this feature is currently only supported by simple local variables. A simple local variable is one whose name does not contain any expressions:
{_var} # can use type hints
{_var::%player's name%} # can't use type hints
Runtime Error Catching
Enable by adding using error catching
to your script.
A new catch [run[ ]time] error[s]
section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors
.
catch runtime errors:
...
set worldborder center of {_border} to {_my unsafe location}
...
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
Damage Sources
Enable by adding using damage sources
to your script.
Note that
type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.
Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
damage all players by 5 using a custom damage source:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
Join us on Discord
We have an official Discord community where we share announcements and and perform testing for upcoming features.
Thank You
Special thanks to the contributors whose work was included in this version:
- @Absolutionism
- @APickledWalrus
- @Efnilite
- @Pesekjak
- @sovdeeth
- @sweetestpiper ⭐ First contribution! ⭐
- @TheLimeGlass
As always, if you encounter any issues or have some minor suggestions, please report them at https://github.com/SkriptLang/Skript/issues.
If you have any bigger ideas or input for the future of Skript, you can share those too at https://github.com/SkriptLang/Skript/discussions.
Feature Release 2.12.0
Skript 2.12.0
2.12.0 is here! Please excuse the later release time, Pickle's on vacation! We've got a bounty of new features, changes, and bug fixes for you in Skript 2.12, along with early support for 1.21.6/7.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Per our release model, we plan to release 2.12.1 on August 1st. We may release emergency patches before then should the need arise.
We would also like to welcome a new addition to the team, @Absolutionism!
Happy Skripting!
Changes to Supported Versions and Platforms
Back in 2.10, we switched to supporting the last three major versions. While reasonable at the time, Mojang has continued to make significant changes between minor versions and seems to have shyed away from incrementing the major version counter. In order to reduce the development burden of supporting so many versions with different features, as of 2.13 (next release) we have decided to switch to supporting the last 18 months of Minecraft releases. This means as of 2.13, Skript will support 1.20.4 and newer. 2.14 will be 1.21.0 and newer. We hope this change will allow us to modernize Skript more quickly and more fully support new systems like item components going forward. To clarify, 2.12 still supports 1.19.4+. These changes will affect 2.13 and later.
In the same vein, Paper has recently completed its fork away from Spigot. We have aimed to maintain support for both versions so far, but we are running into issues where the API differences between Paper and Spigot are becoming too great. It is not feasible for us to develop two parallel versions of Skript, and as a result, we will be dropping support for Spigot starting with 2.13. We encourage the small portion of our users who are still using Spigot to upgrade to Paper if possible.
Major Changes
Ephemeral Variables
Ephemeral variables (or ram vars, or memory vars) are now fully implemented by default for all users. These are global variables that are not saved between restarts. To make a variable ephemeral, add a hyphen (-
) to the start of its name: {-var}
. These variables are about 2.5x faster to change compared to normal global variables. You do not need to do anything to enable them.
Function Overloading
Note
The script reflection
experiment, which includes syntax for dynamically referencing and executing functions, does not yet support working with overloaded functions.
Function overloading enables creating functions that have the same name but different parameters types/parameter counts.
function send_welcome(p: player):
send_welcome({_p}, false)
function send_welcome(p: player, first_time: boolean):
if {_first_time} is true:
send "Welcome to our server for the first time, %name of {_p}%!" to {_p}
else:
send "Welcome back to our server, %name of {_p}%!" to {_p}
Local Variable Type Hints (Experimental)
Note
This feature is currently experimental and can be used by enabling the type hints
experiment.
Local variable type hints enable Skript to understand what kind of values your local variables will hold at parse time. Consider the following example:
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
Previously, the code above would parse without issue. However, Skript now understands that when it is used, {_a}
could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
Please note that this feature is currently only supported by simple local variables. A simple local variable is one whose name does not contain any expressions:
{_var} # can use type hints
{_var::%player's name%} # can't use type hints
Runtime Error Catching (Experimental)
Note
This feature is currently experimental and can be used by enabling the error catching
experiment.
A new catch [run[ ]time] error[s]
section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors
.
catch runtime errors:
...
set worldborder center of {_border} to {_my unsafe location}
...
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
Damage Sources (Experimental)
Note
This feature is currently experimental and can be used by enabling the damage sources
experiment.
Caution
Note that type
has been removed as an option for the 'damage cause' expression as damage cause
and damage type
now refer to different things.
Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
damage all players by 5 using a custom damage source:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
Contributing Updates
We are now allowing contributors to release their code contributions under the more-permissive MIT License. For more information, please review our LICENSING.md file.
⚠ Breaking Changes
- When using
index of "a" in "b"
, values that do not appear in the second string will now returnnone
instead of the previous-1
. - The
is enchanted with
condition now looks for exact levels instead of the specified level or better. Old behavior can be replicated withif {_item} is enchanted with sharpness 2 or better
. Some examples:
if {_item} is enchanted with sharpness 2 # only passes for sharpness 2. Previous behavior allowed sharpness of 2 or greater to pass.
if {_item} is enchanted with sharpness 2 or better # sharpness 2+
if {_item} is enchanted with sharpness 2 or worse # sharpness 2 or 1
if {_item} is enchanted with sharpness # sharpness of any level
- An infinite timespan literal was added, meaning Timespan math operations can now result in an infinite timespan value (just like numbers).
- The parsing behavior of the 'amount' expression has changed. Given an expression like
amount of {a::*}, "b"
, it was before parsed as(amount of {a::*}), "b"
, but it is now parsed asamount of ({a::*}, "b")
. Use parentheses as necessary to clarify your intent. - For the old 'beacon values' expression,
beacon
is now a required keyword for therange
andtier
expressions. - The
remove all
changer for the 'custom model data' expression has been removed. It functioned the same asremove
. head
has been removed as an option for the 'player skull' expression ashead of player
conflicts with the 'head location' expression.type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.- The 'load world' effect now requires
world
. - The API method
RegistryParser#getAllNames
has been removed in favor ofRegistryParser#getCombinedPatterns
(from thePatternedParser
interface). - API methods for the
since
documentation field have changed on SkriptEventInfo:SkriptEventInfo#getSince() (String) -> SkriptEventInfo#getSince() (String[])
BukkitSyntaxInfos.Event.since() (String) -> BukkitSyntaxInfos.Event.since() (Collection<String>)
BukkitSyntaxInfos.Event.Builder.since(String) -> BukkitSyntaxInfos.Event.Builder.addSince(String)
- (API) Syntax ordering is no longer based on registration order when a priority is shared. This may expose syntax conflicts if this behavior was depended on.
Changelog
Additions
- #4154 Adds support for boolean values to the 'toggle' effect and an 'inverse boolean' expression to obtain the inverse of a boolean (at long last).
- #6902 Adds a 'buried item' expression and a 'dusted stage' expression for working with brushable blocks.
- #7495 Adds ephemeral variables (starting with
-
) which are cleared when the server restarts. - #7561 Adds an '[except](https://docs.skriptlang.org/docs.html?search=#Ex...
Pre-Release 2.12.0-pre2
Skript 2.12.0-pre2
Today, we are releasing Skript 2.12.0-pre2. This pre-release includes additional bug fixes, including some for issues that were reported with the first pre-release. Skript 2.12 includes dozens of new features and bug fixes, along with early support for 1.21.6/7.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Per our release model, we plan to release 2.12.0 on July 15th. We may release additional pre-releases before then should the need arise.
We would also like to welcome a new addition to the team, @Absolutionism!
Happy Skripting!
Changes to Supported Versions and Platforms
Back in 2.10, we switched to supporting the last three major versions. While reasonable at the time, Mojang has continued to make significant changes between minor versions and seems to have shyed away from incrementing the major version counter. In order to reduce the development burden of supporting so many versions with different features, as of 2.13 (next release) we have decided to switch to supporting the last 18 months of Minecraft releases. This means as of 2.13, Skript will support 1.20.4 and newer. 2.14 will be 1.21.0 and newer. We hope this change will allow us to modernize Skript more quickly and more fully support new systems like item components going forward. To clarify, 2.12 still supports 1.19.4+. These changes will affect 2.13 and later.
In the same vein, Paper has recently completed its fork away from Spigot. We have aimed to maintain support for both versions so far, but we are running into issues where the API differences between Paper and Spigot are becoming too great. It is not feasible for us to develop two parallel versions of Skript, and as a result, we will be dropping support for Spigot starting with 2.13. We encourage the small portion of our users who are still using Spigot to upgrade to Paper if possible.
Major Changes
Ephemeral Variables
Ephemeral variables (or ram vars, or memory vars) are now fully implemented by default for all users. These are global variables that are not saved between restarts. To make a variable ephemeral, add a hyphen (-
) to the start of its name: {-var}
. These variables are about 2.5x faster to change compared to normal global variables. You do not need to do anything to enable them.
Function Overloading
Note
The script reflection
experiment, which includes syntax for dynamically referencing and executing functions, does not yet support working with overloaded functions.
Function overloading enables creating functions that have the same name but different parameters types/parameter counts.
function send_welcome(p: player):
send_welcome({_p}, false)
function send_welcome(p: player, first_time: boolean):
if {_first_time} is true:
send "Welcome to our server for the first time, %name of {_p}%!" to {_p}
else:
send "Welcome back to our server, %name of {_p}%!" to {_p}
Local Variable Type Hints (Experimental)
Note
This feature is currently experimental and can be used by enabling the type hints
experiment.
Local variable type hints enable Skript to understand what kind of values your local variables will hold at parse time. Consider the following example:
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
Previously, the code above would parse without issue. However, Skript now understands that when it is used, {_a}
could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
Please note that this feature is currently only supported by simple local variables. A simple local variable is one whose name does not contain any expressions:
{_var} # can use type hints
{_var::%player's name%} # can't use type hints
Runtime Error Catching (Experimental)
Note
This feature is currently experimental and can be used by enabling the error catching
experiment.
A new catch [run[ ]time] error[s]
section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors
.
catch runtime errors:
...
set worldborder center of {_border} to {_my unsafe location}
...
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
Damage Sources (Experimental)
Note
This feature is currently experimental and can be used by enabling the damage sources
experiment.
Caution
Note that type
has been removed as an option for the 'damage cause' expression as damage cause
and damage type
now refer to different things.
Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
damage all players by 5 using a custom damage source:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
Contributing Updates
We are now allowing contributors to release their code contributions under the more-permissive MIT License. For more information, please review our LICENSING.md file.
⚠ Breaking Changes
- When using
index of "a" in "b"
, values that do not appear in the second string will now returnnone
instead of the previous-1
. - The
is enchanted with
condition now looks for exact levels instead of the specified level or better. Old behavior can be replicated withif {_item} is enchanted with sharpness 2 or better
. Some examples:
if {_item} is enchanted with sharpness 2 # only passes for sharpness 2. Previous behavior allowed sharpness of 2 or greater to pass.
if {_item} is enchanted with sharpness 2 or better # sharpness 2+
if {_item} is enchanted with sharpness 2 or worse # sharpness 2 or 1
if {_item} is enchanted with sharpness # sharpness of any level
- An infinite timespan literal was added, meaning Timespan math operations can now result in an infinite timespan value (just like numbers).
- The parsing behavior of the 'amount' expression has changed. Given an expression like
amount of {a::*}, "b"
, it was before parsed as(amount of {a::*}), "b"
, but it is now parsed asamount of ({a::*}, "b")
. Use parentheses as necessary to clarify your intent. - For the old 'beacon values' expression,
beacon
is now a required keyword for therange
andtier
expressions. - The
remove all
changer for the 'custom model data' expression has been removed. It functioned the same asremove
. head
has been removed as an option for the 'player skull' expression ashead of player
conflicts with the 'head location' expression.type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.- The 'load world' effect now requires
world
. - The API method
RegistryParser#getAllNames
has been removed in favor ofRegistryParser#getCombinedPatterns
(from thePatternedParser
interface). - API methods for the
since
documentation field have changed on SkriptEventInfo:SkriptEventInfo#getSince() (String) -> SkriptEventInfo#getSince() (String[])
BukkitSyntaxInfos.Event.since() (String) -> BukkitSyntaxInfos.Event.since() (Collection<String>)
BukkitSyntaxInfos.Event.Builder.since(String) -> BukkitSyntaxInfos.Event.Builder.addSince(String)
- (API) Syntax ordering is no longer based on registration order when a priority is shared. This may expose syntax conflicts if this behavior was depended on.
Changelog
Pre-Release 2 Changes
- #7943 Fixes numerous issues with the 'gamerule value' expression.
- #7992 Fixes an issue where some examples diplayed incorrectly on the documentation site.
- #7993 Adds
SyntaxInfo
builder methods to the "property" type syntax classes, in favor of the existingregister
methods. - #7996 Fixes an error that would occur when using experimental syntax in effect commands.
- #7997 Fixes an issue where the 'indices of value' expression failed to respect the c...
Pre-Release 2.12.0-pre1
Skript 2.12.0-pre1
Today, we are excited to celebrate the beginning of the second half of the year with a new Skript pre-release! Skript 2.12.0-pre1 is now available! This release includes dozens of new features and bug fixes, along with early support for 1.21.6/7.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Per our release model, we plan to release 2.12.0 on July 15th. We may release additional pre-releases before then should the need arise.
We would also like to welcome a new addition to the team, @Absolutionism!
Happy Skripting!
Major Changes
Ephemeral Variables
Ephemeral variables (or ram vars, or memory vars) are now fully implemented by default for all users. These are global variables that are not saved between restarts. To make a variable ephemeral, add a hyphen (-
) to the start of its name: {-var}
. These variables are about 2.5x faster to change compared to normal global variables. You do not need to do anything to enable them.
Function Overloading
Note
The script reflection
experiment, which includes syntax for dynamically referencing and executing functions, does not yet support working with overloaded functions.
Function overloading enables creating functions that have the same name but different parameters types/parameter counts.
function send_welcome(p: player):
send_welcome({_p}, false)
function send_welcome(p: player, first_time: boolean):
if {_first_time} is true:
send "Welcome to our server for the first time, %name of {_p}%!" to {_p}
else:
send "Welcome back to our server, %name of {_p}%!" to {_p}
Local Variable Type Hints (Experimental)
Note
This feature is currently experimental and can be used by enabling the type hints
experiment.
Local variable type hints enable Skript to understand what kind of values your local variables will hold at parse time. Consider the following example:
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
Previously, the code above would parse without issue. However, Skript now understands that when it is used, {_a}
could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
Please note that this feature is currently only supported by simple local variables. A simple local variable is one whose name does not contain any expressions:
{_var} # can use type hints
{_var::%player's name%} # can't use type hints
Runtime Error Catching (Experimental)
Note
This feature is currently experimental and can be used by enabling the error catching
experiment.
A new catch [run[ ]time] error[s]
section allows you to catch and suppress runtime errors within it and access them later with [the] last caught [run[ ]time] errors
.
catch runtime errors:
...
set worldborder center of {_border} to {_my unsafe location}
...
if last caught runtime errors contains "Your location can't have a NaN value as one of its components":
set worldborder center of {_border} to location(0, 0, 0)
Damage Sources (Experimental)
Note
This feature is currently experimental and can be used by enabling the damage sources
experiment.
Caution
Note that type
has been removed as an option for the 'damage cause' expression as damage cause
and damage type
now refer to different things.
Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
damage all players by 5 using a custom damage source:
set the damage type to magic
set the causing entity to {_player}
set the direct entity to {_arrow}
set the damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
Contributing Updates
We are now allowing contributors to release their code contributions under the more-permissive MIT License. For more information, please review our LICENSING.md file.
⚠ Breaking Changes
- When using
index of "a" in "b"
, values that do not appear in the second string will now returnnone
instead of the previous-1
. - The
is enchanted with
condition now looks for exact levels instead of the specified level or better. Old behavior can be replicated withif {_item} is enchanted with sharpness 2 or better
. Some examples:
if {_item} is enchanted with sharpness 2 # only passes for sharpness 2. Previous behavior allowed sharpness of 2 or greater to pass.
if {_item} is enchanted with sharpness 2 or better # sharpness 2+
if {_item} is enchanted with sharpness 2 or worse # sharpness 2 or 1
if {_item} is enchanted with sharpness # sharpness of any level
- An infinite timespan literal was added, meaning Timespan math operations can now result in an infinite timespan value (just like numbers).
- The parsing behavior of the 'amount' expression has changed. Given an expression like
amount of {a::*}, "b"
, it was before parsed as(amount of {a::*}), "b"
, but it is now parsed asamount of ({a::*}, "b")
. Use parentheses as necessary to clarify your intent. - For the old 'beacon values' expression,
beacon
is now a required keyword for therange
andtier
expressions. - The
remove all
changer for the 'custom model data' expression has been removed. It functioned the same asremove
. head
has been removed as an option for the 'player skull' expression ashead of player
conflicts with the 'head location' expression.type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.- The 'load world' effect now requires
world
. - The API method
RegistryParser#getAllNames
has been removed in favor ofRegistryParser#getCombinedPatterns
(from thePatternedParser
interface). - API methods for the
since
documentation field have changed on SkriptEventInfo:SkriptEventInfo#getSince() (String) -> SkriptEventInfo#getSince() (String[])
BukkitSyntaxInfos.Event.since() (String) -> BukkitSyntaxInfos.Event.since() (Collection<String>)
BukkitSyntaxInfos.Event.Builder.since(String) -> BukkitSyntaxInfos.Event.Builder.addSince(String)
- (API) Syntax ordering is no longer based on registration order when a priority is shared. This may expose syntax conflicts if this behavior was depended on.
Changelog
Additions
- #4154 Adds support for boolean values to the 'toggle' effect and an 'inverse boolean' expression to obtain the inverse of a boolean (at long last).
- #6902 Adds a 'buried item' expression and a 'dusted stage' expression for working with brushable blocks.
- #7495 Adds ephemeral variables (starting with
-
) which are cleared when the server restarts. - #7561 Adds an 'except' expression which provides a simple way to filter values from a list.
- #7658 Adds an 'On-screen kick message' expression to get and change the on-screen message that appears when a user is kicked, usable in the kick event.
- #7685 Adds support for the Catalan language (thanks to @TwistedWar3713, @Lukarius11, and @ItzDuck364 for their language insights).
- #7707 Adds support for the 'item cooldown' syntax to respect cooldown groups (cooldown components) defined on items.
- #7738 Adds an 'exact item' expression that acts like creative-mode middle-click, copying the block's data exactly.
- #7745 Add...
Patch Release 2.11.2
Skript 2.11.2
As we prepare for Skript 2.12 in July, Skript 2.11.2 is here to resolve some additional bugs.
As always, you can report any issues on our issue tracker.
Skript 2.11.2 supports Spigot or Paper servers on versions 1.19.4 to 1.21.4, with tentative support for 1.21.5.
Happy Skripting!
Changelog
Bug Fixes
- #7845 Fixes types marked as
a
instead ofan
in the default language file. - #7850 Fixes an issue where LiteralUtils#hasUnparsedLiteral() would not check recursively and therefore could miss some UnparsedLiterals.
- #7886 Fixes an exception/crash that could occur when using blockdata in a click event.
- #7889 Fixes an issue where the 'stop trigger' effect used the incorrect ExecutionIntent.
- #7890 Fixes an issue where the 'no damage ticks' expression printed an improper (non-suppressable) deprecation warning.
- #7895 Fixes the
player
event value not working in a 'flight toggle' event. - #7907 Fixes an issue with the 'arithmetic' expression that could result in valid operations failing or exceptions.
API Changes
- #7826 Cleans up tests and removes outdated checks for unsupported versions.
- #7883 Adds safe arithmetic methods for Timespans.
Click here to view the full list of commits made since 2.11.1
Notices
Experimental Features
Experimental features can be used to enable syntax and other behavior on a per-script basis. Some of these features are new proposals that we are testing while others may have unsafe or complex elements that regular users may not need.
While we have tested the available experiments to the best of our ability, they are they are still in development. As a result, they are subject to change and may contain bugs. Experiments should be used at your own discretion.
Additionally, example scripts demonstrating usage of the available experiments can be found here.
Click to reveal the experiments available in this release
For-Each Loop
Enable by adding using for loops
to your script.
A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
All existing loop features are also available in this section.
Queue
Enable by adding using queues
to your script.
A collection that removes elements whenever they are requested.
This is useful for processing tasks or keeping track of things that need to happen only once.
set {queue} to a new queue of "hello" and "world"
broadcast the first element of {queue}
# "hello" is now removed
broadcast the first element of {queue}
# "world" is now removed
# queue is empty
set {queue} to a new queue of all players
set {player 1} to a random element out of {queue}
set {player 2} to a random element out of {queue}
# players 1 and 2 are guaranteed to be distinct
Queues can be looped over like a regular list.
Script Reflection
Enable by adding using script reflection
to your script.
This feature includes:
- The ability to reference a script in code.
- Finding and running functions by name.
- Reading configuration files and values.
Help Us Test
We have an official Discord community for beta testing Skript's new features and releases.
Thank You
Special thanks to the contributors whose work was included in this version:
As always, if you encounter any issues or have some minor suggestions, please report them at https://github.com/SkriptLang/Skript/issues.
If you have any bigger ideas or input for the future of Skript, you can share those too at https://github.com/SkriptLang/Skript/discussions.
Patch Release 2.11.1
Skript 2.11.1
What better than a new Skript release to celebrate the beginning of May? Today, we are releasing Skript 2.11.1 which brings with it a handful of bug fixes.
As always, you can report any issues on our issue tracker.
Skript 2.11.1 supports Spigot or Paper servers on versions 1.19.4 to 1.21.4, with tentative support for 1.21.5.
Happy Skripting!
Changelog
Changes
- #7806 Tweaked the documentation of the 'using experimental feature' structure.
- #7827 Corrects the documentation examples to reflect the usage of minimized aliases.
- #7838 Improves the documentation of the 'create worldborder' expression section.
Bug Fixes
- #7698 Fixes an issue with plural type representation when generating a JSON documentation file.
- #7775 Fixes an issue where the 'broadcast' effect could evaluate its expressions multiple times.
- #7795 Fixes a crash that could occur when loading invalid BlockData.
- #7796 Fixes some issues that could occur when running Skript on 1.21.5.
- #7809 Fixes an error that could occur in variable loading from slow name parsing
- #7814 Fixes an issue where the 'any of' expression would mistakenly allow itself to be changed using add, set, remove, and other changers.
- #7827 Fixes an issue where per-player usages of the 'create worldborder' expression section shared state.
- #7829 Fixes an issue where using the 'shoot' effect section as a section would reset the velocity (from the head statement).
API Changes
- #7817 Formalized deprecation processes and updated removal dates of deprecated content. If you are using any deprecated methods or classes, check to see if they will be removed in 2.12.
- #7821 Moves the inventory event-value to InventoryEvent.class, rather than having to implement it on each child event individually.
Click here to view the full list of commits made since 2.11.0
Notices
Experimental Features
Experimental features can be used to enable syntax and other behavior on a per-script basis. Some of these features are new proposals that we are testing while others may have unsafe or complex elements that regular users may not need.
While we have tested the available experiments to the best of our ability, they are they are still in development. As a result, they are subject to change and may contain bugs. Experiments should be used at your own discretion.
Additionally, example scripts demonstrating usage of the available experiments can be found here.
Click to reveal the experiments avaiable in this release
For-Each Loop
Enable by adding using for loops
to your script.
A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
All existing loop features are also available in this section.
Queue
Enable by adding using queues
to your script.
A collection that removes elements whenever they are requested.
This is useful for processing tasks or keeping track of things that need to happen only once.
set {queue} to a new queue of "hello" and "world"
broadcast the first element of {queue}
# "hello" is now removed
broadcast the first element of {queue}
# "world" is now removed
# queue is empty
set {queue} to a new queue of all players
set {player 1} to a random element out of {queue}
set {player 2} to a random element out of {queue}
# players 1 and 2 are guaranteed to be distinct
Queues can be looped over like a regular list.
Script Reflection
Enable by adding using script reflection
to your script.
This feature includes:
- The ability to reference a script in code.
- Finding and running functions by name.
- Reading configuration files and values.
Help Us Test
We have an official Discord community for beta testing Skript's new features and releases.
Thank You
Special thanks to the contributors whose work was included in this version:
- @Absolutionism
- @ahmadmsaleem
- @cRxPtiCz (first time)
- @Efnilite
- @erenkarakal
- @sovdeeth
As always, if you encounter any issues or have some minor suggestions, please report them at https://github.com/SkriptLang/Skript/issues.
If you have any bigger ideas or input for the future of Skript, you can share those too at https://github.com/SkriptLang/Skript/discussions.
Feature Release 2.11.0
Skript 2.11.0
Skript 2.11.0 is now available! This release is of a much more manageable size compared to 2.10, but includes a significant amount of new syntaxes to play around with, as well as a major fix for some item variables. Please read the Major Changes section closely.
Below, you can familiarize yourself with the changes. Additionally, by clicking here, you can view the list of new syntax on our documentation site. As always, report any issues to our issues page!
Skript 2.11.0 supports Spigot or Paper servers on versions 1.19.4 to 1.21.4.
Per our release model, we plan to release 2.11.1 on May 1st to address any immediate issues that are spotted with this release. Should it be necessary, an emergency patch release may come before then.
Happy Skripting!
Major Changes
- Adds the ability to clarify the type of a literal, allowing e.g.
black (wolf color)
orblack (color)
. - A large number of additional syntaxes for various entities, like wardens, allays, and endermen.
- Allows the use of minecraft ids to refer to items: minecraft:oak_log.
- Adds a spanish language option.
- Fixes bug where stored items in variables could change types between Minecraft versions.
Caution
Updating your Minecraft version before switching to 2.11 can cause some item variables to change materials!
To avoid issues, please ensure you start your server normally with 2.11 active, shut it down normally, and only then proceed to updating your Minecraft version.
If you are still on 2.10, have updated your Minecraft version, and are experiencing item variable issues, you may find success by downgrading Minecraft to before the issues began and updating to 2.11 on that version (Or by copying your variables.csv file to a server running on an older version). Be warned that downgrading generally is not supported by Paper or Spigot, and you may encounter other unrelated issues attempting this.
Be warned that downgrading from 2.11 may cause Skript to be unable to load some item variables. Keep this in mind when testing 2.11.
⚠ Breaking Changes
- The
last colour of %string%
expression has been reworked, adding additional support. This necessitated a pattern change, so existing code using this expression should now uselast string colour code of %string%
. - The
potion type
type has been renamed topotion effect type
. Usages of the previous name will need to be updated in scripts. - The
chiseled bookshelf
anddecorated pot
inventory types have been renamed to[chiseled] bookshelf inventory
anddecorated pot inventory
respectively. Usages of the previous names will need to be updated in scripts. event-item
in the 'armor change event' has been removed in favor of 'old armor item' and 'new armor item'- UUIDs are no longer represented by strings in Skript and are instead proper UUID objects. This should cause no changes for normal Skript users, but may cause issues if you are relying on them being strings in contexts like using Skript-Reflect methods.
Changelog
Additions
- #7006 Adds full support for modifying players' world borders.
- #7270 Adds additional syntax for interacting with dropped items.
- #7314 Adds Warden related syntaxes:
- Make a Warden investigate an area.
- Get the entity a Warden is most angry at.
- Get the anger level of a Warden.
- #7316 Adds support for dealing with the entities in 'entity storage' blocks like beehives, as well as other beehive related syntax.
- #7332 Adds an event that is triggered at certain real-life times of day.
- #7351 Adds an effect to zombify/dezombify villagers.
- #7358 Adds Allay related syntaxes:
- Get or change whether allays can duplicate and their duplication cooldown.
- Get the target jukebox of an Allay.
- Force an Allay to duplicate or dance.
- #7361 Adds an effect and condition for whether axolotls are playing dead.
- #7362 Updates sleeping related syntaxes to support bats, foxes and villagers.
- #7365 Adds effect to make a player sprint, adds a condition to check if a camel is using its dash ability.
- #7386 Adds ability to check if an entity is riding a specific other entity. Prevents error when trying to make an entity ride itself.
- #7415 Adds ability to get and change the simulation and view distances on Paper servers.
- #7453 Adds support for specifying slots in the armor change event like
on helmet change
. - #7479 Adds syntax related to goats.
- #7480 Adds Enderman related syntaxes:
- Check or change the block an Enderman is carrying.
- Make Enderman randomly teleport or towards an entity.
- Check if an Enderman is being stared at.
- #7532 Adds a config option for the number of variable changes required to trigger a save.
- #7550 Adds various math functions:
- mean(numbers)
- median(numbers)
- factorial(number)
- root(number, number)
- permutation(number, number)
- combination(number, number)
- #7554 Moves the "invulnerability time" expression to support timespans and deprecates the tick-based version.
- #7564 Allows modifying the persistence of entities and blocks, and allows modifying whether entities should despawn when the player is far away.
- #7586 Adds spanish language option.
- #7597 Adds checking for whether a ghast is charging its fireball and adds getting and changing the explosive power of a ghast's fireball.
- #7683 Added support for fishing states and generic fishing state change event.
- #7701 Adds an expression to treat a list as if it is of the form
a, b, or c
rather thana, b, and c
:if {_X} is any of {_possibilities::*}
. - #7702 Adds an expression to change phantom and slime entity sizes.
- #7709 Adds
past event-item
,future event-item
, andevent-slot
to the armor change event. - #7714 Adds the entity shoot bow event, as well as some expressions for it.
- #7722 Adds the ability to clarify the type of a literal, allowing e.g.
black (wolf color)
orblack (color)
. - #7747 Adds support for interacting with pandas.
- #7750 Adds support for obtaining items with/without their tooltip.
Changes
- #7276 Changes the pattern of
last colour of %string%
, adds support for returning colour objects, the first colour, and all colours. - #7287 Improves the check for what types Skript attempts to compare by comparing super classinfos.
- #7317 Adds examples to the location type.
- #7440 Enforces the use of
effect
when using the typepotion effect type
. - #7442 Merges ExprWeather and ExprPlayerWeather to resolve syntax conflicts.
- #7492 Allows the use of minecraft ids to refer to items:
minecraft:oak_log
. - #7547 Allows checking whether something is within multiple objects, e.g.
if player is in world "world" or world "world_nether"
. - #7549 Allows using
skript tag
as an alternative forcustom tag
. - #7552 Allows using multiple numbers in the rounding expression.
- #7602 Adds support for using experience as a regular number, allowing for arithmetic like
5 xp + 10
. - #7622 Adds syntax that allows the user to improve the clarity of
using experiment
. - #7694 Allows
itemstack
as another way to reference theitem
type. - #7704 Adds support for
with all item flags
. - #7708 Adds support for using
armour
instead ofarmor
. - #7716 Improves the errors for when a single value is passed, where multiple are expected.
- #7762 Improves the registration and internal organization of the '[bell events](https://docs.skriptlang.org/...