2.12.0 is here! 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!
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.
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.
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.
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:
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.
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:
For more details about the syntax, visit damage source on our documentation website.
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.
index of "a" in "b", values that do not appear in the second string will now return none 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 with if {_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 as amount of ({a::*}, "b"). Use parentheses as necessary to clarify your intent.beacon is now a required keyword for the range and tier expressions.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.world.RegistryParser#getAllNames has been removed in favor of RegistryParser#getCombinedPatterns (from the PatternedParser 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)-) 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 as amount of ({a::*}, "b"). Use parentheses as necessary to clarify your intent.none instead of -1.range and tier expressions now require beacon in their syntax.or better and or worse added as newly available comparison options.aliases folder will now be created automatically so that users know where to place custom aliases.event-item in a 'craft' event often returned air due to the recipe being complex.raid omen effect was incorrectly given the alias bad 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 of Skript/lang/.since documentation field. Some methods have had their signatures changed and addons using them will need to be updated.RegistryParser#getAllNames method with RegistryParser#getCombinedPatterns (from the PatternedParser interface).Expression#possibleReturnTypes() and Expression#canReturn().head has been removed as an option for the player skull expression.Type generic parameter in the AnyContains 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 existing register methods.Click here to view the full list of commits made since 2.11.2
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.
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.
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.
Enable by adding using script reflection to your script.
This feature includes:
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:
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.
Enable by adding using damage sources to your script.
Note that
typehas been removed as an option for the 'damage cause' expression asdamage causeanddamage typenow 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.
We have an official Discord community for beta testing Skript's new features and releases.
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.