Skip to content

Patch Release 2.17.2

Latest

Choose a tag to compare

@APickledWalrus APickledWalrus released this 02 Dec 01:04
6980c79

Skript 2.17.2

Supports: Paper 1.21.5 - 26.3

Today, we are releasing Skript 2.17.2 which brings dozens of bug fixes and performance improvements.

Per our release model, we plan to begin releasing pre-releases for 2.18.0 on January 1st. Until then, happy holidays!

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

Additions

  • #8950 Introduces a new configuration option enable lenient text arguments (default false). When enabled, regular text arguments are not required to be quoted when non-alphanumeric characters are used (only when using spaces if it is not the last argument).
    • Please note that this option negatively affects real-time validation and highlighting for subsequent arguments.
    • We are planning further improvements in this space. The upcoming 26.4 release introduces technical changes that should enable us to support this behavor without any negative impacts.

Changes

  • #8783 Improves variable loading speed by up to 80%.
  • #8903 Improves event dispatch by up to 60%.
  • #8917 Improves entity data lookup speeds for real entities by up to 60% in typical cases. For entities represented by simple data, matching performance is up to 700% faster. String conversion has also been sped up by up to 70%.
  • #8918 Improves text-component related work by up to 150%.
  • #8921 Improves function call performance by around 10-20%.
  • #8925 Improves loop performance by around 20%.

Bug Fixes

  • #8921 Fixes an issue where a function's return value used with the 'keyed' expression would return 0-indexed keys if the function returned a regular list.
  • #8937 Fixes an issue where when removing health from multiple entities at once, some of those entities would instead have health added.
  • #8938 Fixes an issue where the 'indices of value' expression was 0-indexed when obtaining the last position.
  • #8939 Fixes an issue where the 'minecart derailed velocity' and 'minecart flying velocity' expressions did not handle arithmetic operations for changing correctly.
  • #8940 Fixes multiple issues with changing the max durability of an item.
  • #8941 Fixes an issue the 'time lived of entity' did not correctly calculate the ticks lived when used for changing.
  • #8942 Fixes an issue where the 'sea pickles' expression would fully abort when encountering an invalid block type.
  • #8943 Fixes an issue where the 'with fire resistance' expression would fail to copy the original item, causing it to be changed.
  • #8944 Fixes an issue where the 'is evenly divisible by' condition treat all negative divisors as 0.
  • #8945 (API) Fixes an issue where the WXYZ property was not registered.
  • #8946 (API) Fixes an issue where the DefaultFunction.Builder#requires method checked the nullness of the wrong field.
  • #8947 Fixes exceptions that could occur with the 'wake and sleep' effect when attempting to wake up an entity that was not sleeping or attempting to force an entity to sleep at a location in a different world.
  • #8948 Fixes an exception that occurs when making an allay dance at a specific location that is not a jukebox.
  • #8949 Fixes an exception that occurs when knocking back an entity with a negative or zero strength.
  • #8950 Fixes multiple command issues related to argument parsing and validation.
  • #8951 Fixes an exception that could occur when spawning an entity fails.
  • #8955 Fixes an issue where it was not possible to directly use rgba values (i.e., there was no parser).
  • #8959 Fixes an issue where the 'damaged item' expression would fail to copy the original item, causing it to be changed.
  • #8960 Fixes an issue where the rabbit entity data pattern was missing the keyword rabbit for the baby pattern.
  • #8961 Fixes issues causing incorrect display names for cold striders and zombified piglins.
  • #8963 Fixes an error that would occur when checking whether an enderman (that is not holding a block) is holding a block.
  • #8970 Fixes an issue where boss bar progress subtraction was calculated incorrectly.
  • #8971 (API) Fixes an issue where addon attribution was flawed for legacy event registration.
  • #8974 Fixes an issue where size of %entity% was not registered as expected. This should be preferred over the existing 'entity size' expression.

Click here to view the full list of commits made since 2.17.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

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)

Equippable Components

Enable by adding using equippable components to 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:

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}

Changes can be made directly on to the existing equippable component of an item whether using the item itself or the retrieved equippable component

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

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.

We are preparing to launch the site next month, so please take a look and share any feedback: 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:

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.