Feature Release 2.13.0 #8238
APickledWalrus
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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 componentsexperiment.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:
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).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.
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 xorx contains ysyntaxes that Skript does without causing syntax conflicts. You can register your type (ClassInfo) as having a property, such asProperty#NAMEforname of x, and Skript will automatically allow it to be used in thename ofexpression. 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: truesomewhere in yourconfig.sk. Without it, Skript will still use the old syntaxes for things likename 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
EntityData#init. Adds parametermatchedCodeNameand refactorsmatchedPattern.physicsinstead ofphysicin the block update effect.Changelog
Additions
event-locationfor 'portal' event.playtimeas an alias to the 'time played' expression.pullas an alias to the 'push' effect.Changes
physicsinstead ofphysicin the block update effect.Bug Fixes
red foxandsnow fox.minecart.API Changes
project.testEnvinbuild.gradleinstead of updating the latest version for both.Patternto allow providingnullas the object for generic usage.Taskapi.EntryDatamultiple times.docs.jsonimprovements #8116 MakesJSONGeneratoravailable for addons and updates thedocs.jsonformat.Coloras an ARGB integer.PatternElementand tests to catch possible pattern conflicts.SimplifiedConditionfor constant conditions.ConditionimplementsSimplifiable.Expressionclass fromexpressionTypetoexpressionClassinSkript#registerExpression.RuntimeErrorFilter, which allows different consumers to apply different levels of filtering to the errors they print.ClassLoader.ExpressionListreturns foracceptChangeto more accurately reflect the changers of the expressions within the list.Functions#getJavaFunctionsto only returnJavaFunctions.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 loopsto 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 queuesto 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 reflectionto your script.This feature includes:
Local Variable Type Hints
Enable by adding
using type hintsto 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:
{_var} # can use type hints {_var::%player's name%} # can't use type hintsRuntime Error Catching
Enable by adding
using error catchingto 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 sourcesto 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.
Equippable Components
Enable by adding
using equippable componentsto your script.Equippable components allows 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:
Changes can be made directly on to the existing equippable component of an item whether using the item itself or the retrieved equippable component
For more details about the syntax, visit equippable component 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.13.0.
Beta Was this translation helpful? Give feedback.
All reactions