You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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} istrue:
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} to5set {_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}
...
iflast 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 by5 using a custom damage source:
setthe damage type to magic
setthe causing entity to {_player}
setthe direct entity to {_arrow}
setthe 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 return none 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 with if {_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 2or better # sharpness 2+if {_item} is enchanted with sharpness 2or worse # sharpness 2 or 1if {_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 as amount of ({a::*}, "b"). Use parentheses as necessary to clarify your intent.
For the old 'beacon values' expression, beacon is now a required keyword for the range and tier expressions.
The remove all changer for the 'custom model data' expression has been removed. It functioned the same as remove.
head has been removed as an option for the 'player skull' expression as head of player conflicts with the 'head location' expression.
type has been removed as an option for the 'damage cause' expression as damage cause and damage type now refer to different things.
(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.
RuntimeErrorCatcher + Runtime Elements #7823 Adds experimental syntax for catching and suppressing runtime errors. See the available experiments section below for more information.
Syntax Simplification #7841 Adds support for syntax simplification, which enables parse time pre-computation of some syntax that will always have the same result.
Literal Multiple Infos Warning #7851 Adds a warning for when literals that can be interpeted as multiple types are used and Skript cannot determine the intended type.
Local Variable Type Hints #7892 Adds experimental support for local variable type hints. This allows Skript to determine what kind of values your local variables may hold at parse time. See the available experiments section below for more information.
ExprAttachedBlock Plural Support #7897 Expands the 'arrow attached block' expression to support multiple blocks, as arrows may be attached to multiple blocks. The existing single expression has been deprecated on versions where the plural expression is available, as it is unreliable.
Expand Keyed Expression API #7909 Adds a 'keyed' expression which allows explicitly passing/including the keys of an expression alongside its values. For example, you can preserve/include keys (indices) when setting a list variable to another list variable or when providing a list variable as the argument of a function.
Add infinite timespans #7956 Adds support for an 'infinite' timespan. Note that now, just like numbers, math operations for Timespans can now result in an infinite timespan value.
Allow Literals in 'Size of' #7961 Adds support for literals in the 'amount' expression. Note that, as a result, the parsing behavior has now changed. Given an expression like amount of {a::*}, "b", it was before parsed as (amount of {a::*}), "b", but it is now parsed as amount of ({a::*}, "b"). Use parentheses as necessary to clarify your intent.
Changes
gradle.properties - update testEnv #7325 Improves the 'indices of value' expression to allow accessing the index/position of a specific value in a list. Note that values that are not found in a list or a string now return none instead of -1.
Fix custom lang files #8028 Fixes an issue where custom lang files were not loaded due to Skript looking for them in Skriptlang/ instead of Skript/lang/.
Registration API Integration #7551 Integrates the Registration API into SkriptParser and syntax class parse methods. Addons using SkriptParser methods directly may need to be recompiled, though there should be no breaking changes.
Add Time states for ArmorChangeEvent (and add event-slot) #7709 Updates SkriptEventInfo (and its Registration API equivalent) to support passing an array for the since documentation field. Some methods have had their signatures changed and addons using them will need to be updated.
Adds a preinit() method to SyntaxElement #7778 Adds a preInit() method intended to help with doing common init work for families of syntaxes, rather than having to hijack init() and create a different signature for the children to implement.
Syntax Simplification #7841 The syntax simplification API is now used by the parser. For more information, review the pull request's description.
Literal Multiple Infos Warning #7851 Adds a PatternedParser utility interface and replaces the RegistryParser#getAllNames method with RegistryParser#getCombinedPatterns (from the PatternedParser interface).
ExperimentalSyntax Error Messages #7858 Adds ExperimentData utility class and SimpleExperimentalSyntax utility interface to simplify the work needed by syntax to restrict based on the set experiments.
Fix Syntax Removal #7879 Registered syntax are no longer ordered by when they were registered. Priorities should be used if precise registration order is required.
Local Variable Type Hints #7892 Adds experimental support for local variable type hints. If you have syntax that modifies variables (and may result in their type being changed), you you may need to support this feature. For more information, review the pull request's description (see "API Support").
Expand Keyed Expression API #7909 Significantly expands (and reworked to some extent) the Keyed Expression API. For more information about the changes, review the pull request's description.
preInit Follow Up + SectionExpression#isSectionOnly #7929 Implements preInit() for Effect, Condition, and Section, allowing runtime errors to be used more easily. Adds a #isSectionOnly() method in SectionExpression allowing the ability to check if it requires a Section.
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} to5set {_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}
...
iflast 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 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 by5 using a custom damage source:
setthe damage type to magic
setthe causing entity to {_player}
setthe direct entity to {_arrow}
setthe damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
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.
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:
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:
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
.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 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:
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
index of "a" in "b"
, values that do not appear in the second string will now returnnone
instead of the previous-1
.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: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.beacon
is now a required keyword for therange
andtier
expressions.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.world
.RegistryParser#getAllNames
has been removed in favor ofRegistryParser#getCombinedPatterns
(from thePatternedParser
interface).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)
Changelog
Additions
-
prefix variable names when saving. (Ephemeral variables) #7495 Adds ephemeral variables (starting with-
) which are cleared when the server restarts.along
as an option in the 'push' effect:push player along vector(1,1,1) at speed 3
.remove all
changer support has been removed.arg-1
could be misinterpreted as(arg) - 1
.event-entity type
event value for entity related events.1.23E4
,10e-10
) to numbers.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.Changes
none
instead of-1
.range
andtier
expressions now requirebeacon
in their syntax.or better
andor worse
added as newly available comparison options.aliases
folder will now be created automatically so that users know where to place custom aliases.Bug Fixes
>
with > #7654 Fixes Skript's documentation using incorrect pages and formatting.event-item
in a 'craft' event often returnedair
due to the recipe being complex.raid omen
effect was incorrectly given the aliasbad omen
.or
lists.if sharpness 1, efficiency 3, and knockback 2 contains sharpness
.next
/previous
'loop-value' could fail to reset in-between loops.pig
entity data could not be saved in a variable.Skriptlang/
instead ofSkript/lang/
.API Changes
since
documentation field. Some methods have had their signatures changed and addons using them will need to be updated.RegistryParser#getAllNames
method withRegistryParser#getCombinedPatterns
(from thePatternedParser
interface).Expression#possibleReturnTypes()
andExpression#canReturn()
.head
has been removed as an option for theplayer skull
expression.Type
generic parameter in theAnyContains
interface.PropertyCondition
.#isSectionOnly()
method in SectionExpression allowing the ability to check if it requires a Section.SyntaxInfo
builder methods to the "property" type syntax classes, in favor of the existingregister
methods.Click here to view the full list of commits made since 2.11.2
Click here to view the full list of commits made since 2.12.0-pre1
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.
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.
Queues can be looped over like a regular list.
Script Reflection
Enable by adding
using script reflection
to your script.This feature includes:
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:
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:
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
.Damage Sources
Enable by adding
using damage sources
to your script.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:
For more details about the syntax, visit damage source on our documentation website.
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.
This discussion was created from the release Feature Release 2.12.0.
Beta Was this translation helpful? Give feedback.
All reactions