Skript 2.15.3
Supports: Paper 1.21.1 - 26.1.2
Today, we are releasing Skript 2.15.3 to continue ironing out bugs reported with the recent 2.15 releases.
As always, you can report any issues on our issue tracker.
Happy Skripting!
Changelog
Changes
- #8598 Removes mentions of SQL variable storage in the configuration file as they do not currently work.
- #8671 Adds missing language definitions for certain 26.1 features.
Bug Fixes
- #8562 Fixes an issue where queue behavior was inconsistent.
- #8596 Corrects some invalid examples in the documentation of several loot table-related syntaxes.
- #8608 Fixes an issue where the 'rgb'' function did not validate the range of its parameters.
- #8609 Fixes an issue where an error could occur when 'hashing' a string using
MD5in an effect command. - #8623 Fixes an issue where formatting did not work in the
usageentry of 'commands'. - #8627 Fixes an issue where uppercase characters no longer worked for legacy formatting.
- #8627 Fixes an issue where the 'contains' condition did not work as expected with text components stored in variables.
- #8628 Fixes text component (formatting) supported in the 'ban' and 'kick' effects.
- #8647 Fixes incorrect event value cache results.
- #8650 Improves the accuracy of some Turkish language translations.
- #8653 Fixes some items being stringified using legacy formatting.
- #8662 Fixes an error that could occur when indentation errors were encountered during Skript's testing process.
- #8664 Fixes an issue where using a location without a world as a variable index would cause an error.
- #8667 Fixes an issue where when reloading a script with a function, usages of that function in other scripts would not always be updated to use the latest version of the function.
Click here to view the full list of commits made since 2.15.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.
Enable by adding 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 This feature includes:
Enable by adding 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, 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 A new Enable by adding 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.
Click to reveal the experiments available in this release
Queue
using queues to your script.
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
Script Reflection
using script reflection to your script.
Local Variable Type Hints
using type hints to your script.
set {_a} to 5
set {_b} to "some string"
... do stuff ...
set {_c} to {_a} in lowercase # oops i used the wrong variable
{_a} could only be a number (and not a text). Thus, the code above would now error with a message about mismatched types.
{_var} # can use type hints
{_var::%player's name%} # can't use type hintsRuntime Error Catching
using error catching to your script.
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)Equippable Components
using equippable components to your script.
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}
set the equipment slot of {_item} to helmet slot
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment
New Documentation Site
Over the past few months, we have been working hard to build our new documentation site. Not only do we have a new-and-improved syntaxes page, we are also finally launching a proper platform for official tutorials on using Skript, from writing scripts to building addons.
As we continue to prepare the site for launch later this year, the beta is available for viewing at https://beta-docs.skriptlang.org.
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:
- @APickledWalrus
- @Dev-Xeiji ⭐ First contribution! ⭐
- @Efnilite
- @erenkarakal
- @kayerajava ⭐ First contribution! ⭐
- @mvanhorn ⭐ First contribution! ⭐
- @ShaneBeee
- @sovdeeth
- @UnderscoreTud
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.