Try   HackMD

Skript 2.12.0

Skript 2.12.0 is now available!

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 to address any immediate issues that are spotted with this release. Should it be necessary, an emergency patch release may come before then.

We would also like to welcome a new addition to the team, @Absolutionism!

Happy Skripting!

Major Changes

  • 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 - 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.
  • 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)

⚠ Breaking Changes

  • When using index of "a" in "b", values that do not appear in the second string wil now return none instead of the previous -1.

Changelog

Additions

  • #4154 Adds an effect to toggle boolean values and an expression to get the inverse of a boolean value. (at long last!)
  • #6902 Adds expressions to get/set the hidden item in brushable blocks and the brushing progress.
  • #7658 Adds an expression to get/set the on-screen message that appears when a user is kicked, usable in the kick event.
  • #7685 Adds support for the Catalan language (thanks to @TwistedWar3713, @Lukarius11, and @ItzDuck364 for their language insights).
  • #7738 Adds an exact item of %block% expression that acts like creative-mode middle-click, copying the block's data exactly.
  • #7745 Adds an event and expression for when a trial vault displays a possible reward item.
  • #7746 Adds an event for when villagers change professions and the ability to get the reason why.
  • #7748 Adds syntax to check/set whether a strider is shivering.
  • #7808 Adds a warning for ambiguous command arguments where expressions like arg-1 could be misinterpreted as (arg) - 1.
  • #7823 Adds a method of catching/suppressing runtime errors.
  • #7830 Adds support for printing errors when enabling/disabling/reloading scripts with code.
  • #7846 Adds support for the new 1.21.5 pig variants.
  • #7903 Adds an event for when a block is harvested (berry bushes, glowberries, etc).
  • #7905 Adds a new event-entity type event value for entity related events.
  • #7913 Adds the aliases folder to guide users on where to place their aliases.
  • #7914 Adds a [the] first empty slot in %inventories% expression to get the first empty slot in inventories.
  • #7918 Adds a Javadoc description for the Type generic parameter in the AnyContains interface.
  • #7933 Adds scientific notation (e.g. 1.23E4, 10e-10) to numbers.
  • #7957 Preliminary support for 1.21.6.

Changes

  • #7325 Improves the index of expression to allow accessing the index/position of a specific value in a list. Values that are not found in a list or a string now return none instead of -1.
  • #7495 Ephemeral variables (starting with -) are now always enabled and roughly 2.5x faster to write.
  • #7742 Cleans up the hashing expression and adds SHA-384 and SHA-512. Warns when using md5 hashing.
  • #7803 Adds the word along as an option in the push effect: push player along vector(1,1,1) at speed 3.
  • #7942 Function names can now start with an underscore.
  • #7944 Tweaks the target entity expression to make the ray size option more grammatically correct. Updates the description and since tag.

Bug Fixes

  • #7654 Fixes Skript's documentation using incorrect pages and formatting.
  • #7674 Fixes an issue where the event item in the craft item event returned air due to the recipe being complex.
  • #7917 The raid_omen effect was incorrectly given the alias bad omen in default.lang.
  • #7920 Fixes incorrect documentation for the expand world border effect.
  • #7928 Fixes an issue where sorting lists with duplicate values returned a list with only a single instance of that value.
  • #7938 Fixes an issue where AnyNamed caused mismatched hint lengths, resulting in an ArrayOutOfBoundsException.
  • #7945 Fixes a bug where the is within condition didn't handle 'or' lists properly.
  • #7947 Fixes comparisons between enchantments and enchantment types: if sharpness 1, efficiency 3, and knockback 2 contains sharpness.

Removals

API Changes

  • #7651 Add GitHub action to automatically update gradle.
  • #7710 Cleanup to the ExprTool class and EquipmentSlot conversion methods for BukkitUtils.
  • #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 chilren to implement.
  • #7791 Adds a spawnTestEntity helper method for JUnit tests.
  • #7832 Removes many unnecessary version checks for versions Skript no longer supports.
  • #7891 Improves the return types for many expressions via Expression#possibleReturnTypes() and Expression#canReturn().
  • #7927 Adds a getter method for the expression used in PropertyCondition.
  • #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.
  • #7936 Bump Paper version from 1.21.5 to 1.21.6.

Click here to view the full list of commits made since 2.11.2

Notices

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.