Repository navigation
Pre-Release 2.17.0-pre1 #8888
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.17.0-pre1
Supports: Paper 1.21.5 - 26.3
Today, we're excited to be releasing Skript 2.17.0-pre1! While this release may seem small, includes a handful of exciting changes that address some gaps in Skript's content coverage. From sign-side support to a full-blown command overhaul, there is still a lot to check out! This release also includes support for Minecraft 26.3.
In accordance with supporting the last 18 months of Minecraft updates, Skript 2.17.0 supports Minecraft 1.21.5 to 26.3. Newer versions may also work but were not tested at time of release. 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, but especially with this release, please report any issues or unexpected behavior to our issues page!
Per our release model, we plan to release 2.17.0 on October 15th. We may release additional pre-releases before then should the need arise.
Happy Skripting!
Release Highlights
Command Overhaul
Our biggest feature for this release is a complete overhaul of Skript's existing system for creating custom commands. Most importantly, we expect that nearly all existing commands will continue to work. Custom commands now make use of Brigadier, Minecraft's command processing system, enabling scripters to create vanilla-like commands. This comes with numerous new features which we will briefly cover below.
Expanded
executable byEntryThe
executable byentry now supports two new types:operatorsandblocks(e.g., command blocks). As with permissions, players not covered under theexecutable byentry of a command will no longer be aware of that command.Improved Arguments
Many supported argument types are now able to make use of their vanilla equivalents, which enables real-time validation. For example,
<player>and<entity>arguments now support selectors.<integer>and<number>arguments can now be ranged:<integer between 5 and 10>.Important
By default, real-time command validation will not function.
This is a trade-off to preserve compatibility with the suggestion (tab completion) features offered by some addons.
You can disable this legacy compatibility feature, thus enabling real-time validation, by changing the
enable legacy tab completion event compatibilityconfiguration option tofalse.Choice Arguments
Command arguments provided as choices can now be identified. For example, consider the following command:
command /alert (restart|giveaway):It can be useful to restrict the possible options at the first argument position rather than accept a text argument (any input).
This behavior is still supported, and it is now also possible to determine what value was used using the new
choice argumentexpression:Just like the regular
argumentexpression, if multiple choices are present in the command tree, they can be differentiated by using a number:choice argument 1,choice argument 2, etc.Subcommands
It is now possible to build entire command trees using subcommand entries:
This allows executing
/home set main baseand/home main base- no need for two text arguments!Subcommands allow many of the entries currently supported by commands, such as
permission,executable by, andcooldown.At each level, up to one subcommand may be optional, assuming a
triggerentry is not present. This allows treating one option as the default option, reducing code duplication. For example:In this case,
/commandbehaves the exact same as executing/command help.It is also possible to use a
subcommandsentry to bulk define permissions, cooldowns, and other restrictions for a group of subcommands. For example:Custom Suggestions
You can now also define custom suggestions (tab completions). For example, expanding the home command example from above:
By default, Skript will automatically filter down the suggestions based on the current input. The default mode is a
starts withmode, meaning if a player has two homes,baseandtemple, and they are typing/home b, onlybasewill be shown. This can be customized using the filtering mode effect:Further, suggestions support hover messages (text that appears when you hover/mouse over the suggestion). This is supported through text components. Consider amending the home example from above to show the location of the home as a hover message:
Another important thing to note is that it is possible to obtain the values of arguments that have already been finished. For example, consider a message command that uses custom suggestions to give real time feedback:
Failures and Return Values
Commands can now report explicit failures and return an integer value.
These are the
successandresultvalues of the command execution, respectively. This is mainly useful for commands like/executethat can function off of these values.Here's an example of both in action:
Changeable Conditions
Many of the existing conditions have associated effects for changing the value. This approach was chosen because expressions returning booleans often require odd syntax and checks (e.g.,
player's flight mode is true). However, there is still value in boolean expressions: changing their value dynamically in a single line. We are introducing a new approach to address this problem: changeable conditions. Most conditions now support being changed through the whether expression.For example:
Sign Sides
At long last, Skript now has proper support for sign sides! All existing sign syntax will continue to work. By default, the front side of a sign is used.
Additionally, all lines of a sign can now be obtained:
Finally, it is also possible to check what side of a sign was changed in a 'sign change' event. For example, if you wanted to restrict back side editing:
Improved Warning Suppression
We have made some changes to improve the warning suppression experience.
First, it is now possible to unsuppress warnings. Consider the following example:
Now, the
constant conditionwarning will only be suppressed for thetrue is truestatement.Further, it is also now possible to suppress warnings generated by code within a section:
Please note that these sections make no changes to the flow of code. The code after the section will not execute until the code within the section runs.
Text Formatting Tweaks
We have relaxed the requirements around the usage of
formattedfor processing more advanced tags. Now,formattedis no longer required for literal strings (i.e., those without any expressions), and all tags will be processed.To provide an example:
⚠ Breaking Changes
The following breaking changes are related to commands:
permission messagecommand entry has been deprecated and no longer has functionality. If a player does not have permission to execute a command, their client will no longer be aware of it, meaning they will instead receive an "unknown command" error - the same message that players who attempt to execute regular vanilla commands without permission receive. If you wish to retain a permission message, simply manually check the permission and send an error message at the start of command execution.toand<number>):/plural 5 and 10 APickledWalrus. It must be wrapped in quotes:/plural "5 and 10" APickledWalrus. Of course, it is still possible to pass a single argument as normal:/plural 5 APickledWalrus. The quotes are only needed as the argument contains whitespace.last usage dateexpression has been removed. It was not properly implemented, and the configuration option to have it work somewhat well was only enabled by one server. If this behavior is necessary, it can be easily implemented using native syntax and variables.the executorexpression, which previously was synonymous withthe sender, now has a different functionality. It now returns theexecutorof a command, which is not necessarily the same as thesender. While the sender and executor are typically the same, it is possible to change them. For example, if using the/executecommand, it is possible to change the executor:/execute as <player>. Consider this command for how this might work:event-stringsevent value in a command execution now has different behavior. Rather than returning the result of splitting the raw input at every whitespace character, it now returns a string representation of every available argument.keep command last usage dateshas been removed.the elapsed time of the cooldown before now.case-insensitive commandshas been removed. The client will treat improperly typed commands as unknown.The following changes are related to Skript's API:
Changelog
Additions
/skript recoversubcommand that dumps all loaded scripts back into files./skript reload lastreload option for reloading the last reloaded script.spawn a red shulker).Changes
formattedfor processing more advanced tags. Now, when advanced tags are used in literal strings (i.e., the string has no expressions), all formatting is processed.Bug Fixes
skript command.help.show.skriptcommand.API Changes
.defaultExpressionafter ClassInfo creation.ch.njol.Skriptinstance as opposed to anorg.skriptlang.skript.Skriptinstance. This has been corrected (with compatibility for existing constructors).Click here to view the full list of commits made since 2.16.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
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)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 Pre-Release 2.17.0-pre1.
All reactions