Skip to content

Pre-Release 2.9.0-pre2

Pre-release
Pre-release
Compare
Choose a tag to compare
@APickledWalrus APickledWalrus released this 12 Jul 18:40
· 173 commits to dev/feature since this release
c8e5457

Skript 2.9.0-pre2

Skript 2.9.0 Pre-Release 2 is here to fix some issues that came with the first pre-release. As with any other pre-release, be warned that there may be bugs! We do not recommend running this version on your production servers. This release contains many new features and bug fixes, including support for Minecraft 1.21.

We especially want to thank the recent influx of new contributors, many of whom are included in this update. Every contributor means a little less work for the team and a little more progress for Skript, so please, if you want a feature in Skript, go ahead and try to make a pull request! New contributors are very welcome! You can review our contributing guide by clicking here.

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 new release model, we plan to release 2.9.0 on July 15th. We may release additional pre-releases before then should the need arise.

Happy Skripting!

Major Changes

Important

Skript now requires Java 11 to run. While most users are running Java 11 or newer, some may be required to update for this version. Java 11 is supported on all versions Skript supports.

  • Skript can now listen to events cancelled by other plugins! Your current scripts will behave the same as they always have, but there's now the option to listen to cancelled, uncancelled, or both kinds at once:
on break of stone:
    # Normal behavior, only listens to uncancelled break events.

on uncancelled break of stone:
    # Same as `on break of stone`, only uncancelled.
    
on cancelled break of stone:
    # Will only listen to cancelled events. For example, 
    # when Worldguard prevents a block break in a protected region.

on any break of stone:
    # Will listen to both cancelled and uncancelled events.
    # Finally, `event is cancelled` will be useful!
    
on all break of stone:
    # Same as `on any break of stone`.
  • Alternatively, you can set the new listen to cancelled events by default config option to true to allow events to listen to both uncancelled and cancelled events by default:
on break of stone:
    # Now listens to both cancelled and uncancelled events
    # if the config option is set to true.
  • Added a config option to allow case-insensitive commands, so your accidental capslock won't mess you up as much!
# default: only /test
# insensitive: /test, /TEST, /tEsT...
command /test:
    trigger:
        broadcast "test!"
  • Adds multi-line comments. Comments are opened and closed with three hashtags ### alone on a line.
    This is code
    ###
    |
    This is a comment
    |
    ###
    This is code (again)
    • Triple-hashtags in the middle of a line (e.g. hello ### there) will not start or end a comment.
  • Support for string 'concatenation'!
    • Text can be appended to other text (e.g. set {text} to "hello" + "there") with the addition operator.
    • The concat(...) function joins any text or objects together into a single text.
  • We have exposed the load default aliases option in config.sk, which allows you to tell Skript to only load aliases in the plugins/Skript/aliases folder. You can provide as many or as few (even none, if you want!) aliases as you like. We will provide the default folder in the GitHub release for your convenience.

⚠ Breaking Changes

  • # characters in strings no longer need to be doubled! Skript can now tell that you are writing a string and will not start a comment in the middle of it. This change means all your ## will now appear as two # instead of one! This won't break hex colours, those support either one or two #'s, but it may break other text!
# before:
"<##aabbcc>I'm ##1, baby!" -> "I'm #1, baby!"

# after
"<##aabbcc>I'm ##1, baby!" -> "I'm ##1, baby!"
"<#aabbcc>I'm #1, baby!" -> "I'm #1, baby!"
  • Timespans will now show the weeks and years instead of stopping at days:
broadcast "%{_timespan}%"
- "378 days and 20 minutes"
+ "1 year and 1 week and 6 days and 20 minutes"
  • The names of function parameters can no longer include the following characters: (){}\",.
  • newl and nline are no longer valid syntaxes for the newline expression, but new line is now valid.
  • As mentioned above, # characters in strings no longer need to be doubled. This will mean existing doubled #s will appear as two, rather than one.
  • The option to use non-air instead of solid in the highest solid block expression has been removed.
  • Using on teleport will now trigger for non-player entities. To detect only player teleports, use on player teleport.

Changelog

Pre-Release 2 Changes

  • #6846 Fixed an issue where obtaining the slot index of the player's tool did not work.
  • #6865 Fixed an issue with saving certain types of data in global variables.
  • #6870 Fixed an error that could occur when attempting to set the damage of an item to a negative number.
  • #6871 Fixed an issue where the text forms of enchantments displayed incorrectly.
  • #6874 Fixed an error that would occur when attempting to use several inventory-related expressions on versions older than 1.21.
  • #6876 Fixed an issue with plain item comparisons not working as expected.
  • #6886 Fixed several item-related issues that could occur due to 1.21 changes.
  • #6888 Fixed an issue where some internal item comparisons unexpectedly failed, causing issues with syntax such as the equip effect.

Click here to view the full list of commits made since 2.9.0-pre1

Additions

  • #4661 Added support for using weeks, months, and years in timespans. They are treated as 7 days, 30 days, and 365 days respectively. Additionally, an expression to obtain a timespan as a specific unit of time (e.g. as hours, days, etc.).
  • #5284 Added a lowest solid block expression for obtaining the lowest solid block at a location.
  • #5691 Added documentation details for whether an event can be cancelled.
  • #5698 Added support for obtaining the player represented by a player head block.
  • #6105 Added an expression to determine whether a player is connected rather than online. Specifically, is online may continue to return true for players that have disconnected and then reconnected.
  • #6164 Added more internal tests for item-related syntaxes.
  • #6272 Added Russian translations.
  • #6334 Added an expression for obtaining the codepoint of a character and the character reresented by a codepoint.
  • #6422 Added a distinction when using the actual part of the target block expression. When actual is used, the hitboxes of blocks will be considered.
  • #6530 Expanded the teleport event to trigger when non-player entities are teleported. NOTE: This means on teleport will now trigger for entities other than players. Use on player teleport for detecting only player teleports.
  • #6549 Added support for suppressing deprecated syntax warnings.
  • #6558 Added multi-line comments using ###.
This is code
###
|
This is a comment
|
###
This is code (again)
  • #6576 Added support for combining strings using the addition (+) symbol.
  • #6596 Added an event for when endermen become enraged.
  • #6639 Added a condition, effect, and expression for managing the fire resistance property of an item.
  • #6680 Added a configuration option to allow all events by default to trigger even when the event is already cancelled.
  • #6712 Added an effect to show/hide item tooltips and a condition to check whether an item's tooltip is visible.
  • #6748 Added a whether <condition> expression to get the boolean (true/false) representation of a condition (example: send "Flying: %whether player is flying%").
  • #6791 Added support for numerous 1.21 attributes.
  • #6687 Added support for using (not creating) custom enchantments and referencing enchantments by namespace/key.

Bug Fixes

  • #5422 Fixes bugs with the whitelist condition.
  • #6573 Fixes is connected pattern to support only Paper server.
  • #6737 Adds an effect to sort a list by an arbitrary mapping expression. (ex: sort {_list-of-players::*} by {hide-and-seek::%input%::score})
  • #6797 Fixes issues with the last damage expression.
  • #6803 Fixes an issue where custom maximum durability did not work for items with a custom durability.
  • #6821 Fixes block datas not being cloned upon use.
  • #6823 Fixes inability to get the location of a double chest via the inventory.
  • #6832 Fixes a bug where potion types could not be compared.
  • #6836 Fixes an issue when trying to remove air from an empty slot.

Removals

  • #5606 Removes the warnings in the default variable test.
  • #6505 Removes Player name/UUID in variables warning.
  • #6673 Removes old deprecated vector arithmetic syntax in favour of regular arithmetic.

Changes

  • #4661 Adds timespan details expression & Improvements.
  • #5676 Changes uuid default.
  • #5298 Adds the ability to directly set entity and player pitch/yaw.
  • #6131 Adds the ability to play sounds from entities, as well as specify a seed instead of the sound being random each time.
  • #6160 Adds the option of 'breakable' to the existing unbreakable syntaxes.
  • #6207 Adds ability to listen to cancelled events.
  • #6275 Ignore cleanup lang in git blame.
  • #6306 Adds a more flexible static parse method.
  • #6307 Throw an exception when attempting to register an abstract class.
  • #6339 Adds the ability to filter a heal event by entity data and by heal reason.
  • #6349 Creates SectionExitHandler interface.
  • #6361 Make function parameter name rules stricter.
  • #6389 Allows element-wise comparision when checking if two "and" lists are equal.
  • #6393 Adds "invincible" as a synonym of "invulnerable" in related syntaxes.
  • #6456 Adds syntax for bells and bell events.
  • #6506 Adds pathfinding condition.
  • #6550 and #6694 enhance pattern keywords to improve parsing speeds.
  • #6577 Adds a config option to allow case-insensitive Skript commands.
  • #6583 Changes comment parsing to allow single # characters within strings.
  • #6627 Allows usage messages to contain expressions.
  • #6659 Supports logging with warning and error severities.
  • #6733 Cleans up the new line expression.
  • #6749 Supports dividing timespans by timespans to get numbers. (1 second / 5 ticks = 4)
  • #6828 Adds the ability to delete the message expression in join/death/quit events.
  • #6831 Adds the ability to prevent lookups when using the offlineplayer function.
  • #6834 Exposes the load default aliases config option.
  • #6835 Adds the ability to also kick a player when using the ban effect.

API Changes

  • #5979 The broadcast effect now calls BroadcastMessageEvent.
  • #6118 Adds a way to create returnable triggers (a trigger that can return a value using the return effect)
  • #6276 Fixes JUnit before and after methods being called on cleanup regardless of override.
  • #6291 Adds parse result structure for testing scripts.
  • #6531 Adds ClassInfoReference system.
  • #6551 Allows simple root-level structures.
  • #6556 Allows look-behind for headless effect sections during init.
  • #6568 Adds function contracts, allowing functions to modify their return type/plurality based on their arguments.
  • #6718 Added support for using strings as literals (e.g. %*string% in syntax)
  • #6798 Adds 1.21 support and modifies ItemType#getRandom() to be nullable as not all Materials can be represented as an ItemStack.
  • #6806 Switches more types over to registries when possible.

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

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.