Pre-Release 2.12.0-pre1 #7991
APickledWalrus
started this conversation in
General
Replies: 1 comment
-
Looking forward! |
Beta Was this translation helpful? Give feedback.
0 replies
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.12.0-pre1
Today, we are excited to celebrate the beginning of the second half of the year with a new Skript pre-release! Skript 2.12.0-pre1 is now available! This release includes dozens of new features and bug fixes, along with early support for 1.21.6/7.
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.0 on July 15th. We may release additional pre-releases before then should the need arise.
We would also like to welcome a new addition to the team, @Absolutionism!
Happy Skripting!
Major Changes
Ephemeral Variables
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 hyphen (
-
) 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.Function Overloading
Note
The
script reflection
experiment, which includes syntax for dynamically referencing and executing functions, does not yet support working with overloaded functions.Function overloading enables creating functions that have the same name but different parameters types/parameter counts.
Local Variable Type Hints (Experimental)
Note
This feature is currently experimental and can be used by enabling the
type hints
experiment.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:
Runtime Error Catching (Experimental)
Note
This feature is currently experimental and can be used by enabling the
error catching
experiment.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
.Damage Sources (Experimental)
Note
This feature is currently experimental and can be used by enabling the
damage sources
experiment.Caution
Note that
type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
For more details about the syntax, visit damage source on our documentation website.
Contributing Updates
We are now allowing contributors to release their code contributions under the more-permissive MIT License. For more information, please review our LICENSING.md file.
⚠ Breaking Changes
index of "a" in "b"
, values that do not appear in the second string will now returnnone
instead of the previous-1
.is enchanted with
condition now looks for exact levels instead of the specified level or better. Old behavior can be replicated withif {_item} is enchanted with sharpness 2 or better
. Some examples:amount of {a::*}, "b"
, it was before parsed as(amount of {a::*}), "b"
, but it is now parsed asamount of ({a::*}, "b")
. Use parentheses as necessary to clarify your intent.beacon
is now a required keyword for therange
andtier
expressions.remove all
changer for the 'custom model data' expression has been removed. It functioned the same asremove
.head
has been removed as an option for the 'player skull' expression ashead of player
conflicts with the 'head location' expression.type
has been removed as an option for the 'damage cause' expression asdamage cause
anddamage type
now refer to different things.world
.RegistryParser#getAllNames
has been removed in favor ofRegistryParser#getCombinedPatterns
(from thePatternedParser
interface).since
documentation field have changed on SkriptEventInfo:SkriptEventInfo#getSince() (String) -> SkriptEventInfo#getSince() (String[])
BukkitSyntaxInfos.Event.since() (String) -> BukkitSyntaxInfos.Event.since() (Collection<String>)
BukkitSyntaxInfos.Event.Builder.since(String) -> BukkitSyntaxInfos.Event.Builder.addSince(String)
Changelog
Additions
-
) which are cleared when the server restarts.along
as an option in the 'push' effect:push player along vector(1,1,1) at speed 3
.remove all
changer support has been removed.arg-1
could be misinterpreted as(arg) - 1
.event-entity type
event value for entity related events.1.23E4
,10e-10
) to numbers.amount of {a::*}, "b"
, it was before parsed as(amount of {a::*}), "b"
, but it is now parsed asamount of ({a::*}, "b")
. Use parentheses as necessary to clarify your intent.Changes
none
instead of-1
.range
andtier
expressions now requirebeacon
in their syntax.or better
andor worse
added as newly available comparison options.aliases
folder will now be created automatically so that users know where to place custom aliases.Bug Fixes
event-item
in a 'craft' event often returnedair
due to the recipe being complex.raid omen
effect was incorrectly given the aliasbad omen
.or
lists.if sharpness 1, efficiency 3, and knockback 2 contains sharpness
.next
/previous
'loop-value' could fail to reset in-between loops.API Changes
since
documentation field. Some methods have had their signatures changed and addons using them will need to be updated.RegistryParser#getAllNames
method withRegistryParser#getCombinedPatterns
(from thePatternedParser
interface).Expression#possibleReturnTypes()
andExpression#canReturn()
.head
has been removed as an option for theplayer skull
expression.Type
generic parameter in theAnyContains
interface.PropertyCondition
.#isSectionOnly()
method in SectionExpression allowing the ability to check if it requires a Section.Click here to view the full list of commits made since 2.11.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
For-Each Loop
Enable by adding
using for loops
to your script.A new kind of loop syntax that stores the loop index and value in variables for convenience.
This can be used to avoid confusion when nesting multiple loops inside each other.
All existing loop features are also available in this section.
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.
Queues can be looped over like a regular list.
Script Reflection
Enable by adding
using script reflection
to your script.This feature includes:
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:
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:
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
.Damage Sources
Enable by adding
using damage sources
to your script.Damage sources are a more advanced and detailed version of damage causes. Damage sources include information such as the type of damage, the location where the damage originated from, the entity that directly caused the damage, and more.
Below is an example of what damaging using custom damage sources looks like:
For more details about the syntax, visit damage source 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.12.0-pre1.
Beta Was this translation helpful? Give feedback.
All reactions