You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, we've got a new feature pre-release for you all. Thankfully, this one's a bit more reasonable in size than the massive releases of 2.10, 2.11, and 2.12. We have some great features and a bunch of behind-the-scenes API improvements for you this go around. Addon developers should pay special attention to the Type Properties section below.
Please also note our changes to the supported versions. 2.13 is 1.20.4+, and Paper only.
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.13.0 on October 15th. We may release additional pre-releases before then should the need arise.
Happy Skripting!
Changes to Supported Versions and Platforms
As announced with 2.12, we have updated our policy for supported versions. Going forward, Skript will guarantee support for the last 18 months of Minecraft releases. This means 2.13 is 1.20.4+, while 2.14 will be 1.21+.
Additionally, with Paper forking itself from Spigot, it has become increasingly difficult to support both platforms. As a result, this version of Skript is dropping support for Spigot. Skript now requires Paper or a downstream fork of Paper, such as Purpur or Pufferfish.
Major Changes
Equippable components #7194 Adds support for equippable components and all correlating data. Smurfy put in a lot of work into the backing API for components, so look forward to a lot more component support in the next few releases!
setthe allowed entities of {_item} to a zombie and a skeleton
make {_item} lose durability when hurt
if {_item} can be dispensed:
add "Dispensable"to lore of {_item}
automatically reload this script:
recipients: "Sahvde"# The names or uuids of players who, apart from console, will see the success/error messages in chat.OR
auto reload:
permission: myserver.see_auto_reloads # all players with this permission will see the messages.
Expression to get debug string for values. #8207 Adds a debug info expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!
set {my_list::*} to1, "2", andvector(1, 2, 3)
broadcast debug info of {my_list::*}
# prints:# 1 (integer)# "2" (text)# x: 1, y: 2, z: 3 (vector)
Type Properties (For Addon Devs)
Included in 2.13 is an experimental opt-in API for what we're tenatively calling 'type properties'. These are a way for addons to be able to use the same generic name of x or x contains y syntaxes that Skript does without causing syntax conflicts. You can register your type (ClassInfo) as having a property, such as Property#NAME for name of x, and Skript will automatically allow it to be used in the name of expression. For more details on how to do this and what else you can do with type properties, see the PR. We plan on making a more comprehensive API spec/tutorial once the implementation is solidified, but for now the PR description should be more than sufficient to try it out.
However, since this is still experimental and not well tested, it requires a secret config option to enable. To activate property syntaxes, add the line use type properties: true somewhere in your config.sk. Without it, Skript will still use the old syntaxes for things like name of. We hope you try out this new API and give us feedback on what works, what doesn't, and what you'd like to see for its full release in 2.14. The number of property-driven syntaxes is rather small, but we plan on adding many more in the coming months!
⚠ Breaking Changes
EntityData Overhaul #7985 Changes the method signature for the abstract EntityData#init. Adds parameter matchedCodeName and refactors matchedPattern.
Add ExprTimeLived #8134 Adds an expression to get the duration an entity has been alive for.
Expression to get debug string for values. #8207 Adds a debug info expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!
Better runtime error filtering #8195 Fixes an issue where the runtime error catching section would not catch errors after the default error limit is reached.
Better runtime error filtering #8195 Improves runtime error filtering with the introduction of RuntimeErrorFilter, which allows different consumers to apply different levels of filtering to the errors they print.
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.
for {_index}, {_value} in {my list::*}:
broadcast "%{_index}%: %{_value}%"
for each {_player} in all players:
send "Hello %{_player}%!" to {_player}
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.
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} to5set {_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}
...
iflast 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)
Damage Sources
Enable by adding using damage sources to your script.
Note that type has been removed as an option for the 'damage cause' expression as damage cause and damage 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:
damage all players by5 using a custom damage source:
setthe damage type to magic
setthe causing entity to {_player}
setthe direct entity to {_arrow}
setthe damage location to location(0, 0, 10)
For more details about the syntax, visit damage source on our documentation website.
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:
setthe camera overlay to"custom_overlay"setthe allowed entities to a zombie and a skeleton
setthe equip soundto"block.note_block.pling"setthe equipped model idto"custom_model"setthe shear soundto"ui.toast.in"setthe 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
setthe 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
setthe equipment slot of {_item} to helmet slot
set {_component} tothe equippable component of {_item}
allow {_component} to swap equipment
For more details about the syntax, visit damage source on our documentation website.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Skript 2.13.0-pre1
Hi all, we've got a new feature pre-release for you all. Thankfully, this one's a bit more reasonable in size than the massive releases of 2.10, 2.11, and 2.12. We have some great features and a bunch of behind-the-scenes API improvements for you this go around. Addon developers should pay special attention to the Type Properties section below.
Please also note our changes to the supported versions. 2.13 is 1.20.4+, and Paper only.
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.13.0 on October 15th. We may release additional pre-releases before then should the need arise.
Happy Skripting!
Changes to Supported Versions and Platforms
As announced with 2.12, we have updated our policy for supported versions. Going forward, Skript will guarantee support for the last 18 months of Minecraft releases. This means 2.13 is 1.20.4+, while 2.14 will be 1.21+.
Additionally, with Paper forking itself from Spigot, it has become increasingly difficult to support both platforms. As a result, this version of Skript is dropping support for Spigot. Skript now requires Paper or a downstream fork of Paper, such as Purpur or Pufferfish.
Major Changes
config.sk
:debug info
expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!Type Properties (For Addon Devs)
Included in 2.13 is an experimental opt-in API for what we're tenatively calling 'type properties'. These are a way for addons to be able to use the same generic
name of x
orx contains y
syntaxes that Skript does without causing syntax conflicts. You can register your type (ClassInfo
) as having a property, such asProperty#NAME
forname of x
, and Skript will automatically allow it to be used in thename of
expression. For more details on how to do this and what else you can do with type properties, see the PR. We plan on making a more comprehensive API spec/tutorial once the implementation is solidified, but for now the PR description should be more than sufficient to try it out.However, since this is still experimental and not well tested, it requires a secret config option to enable. To activate property syntaxes, add the line
use type properties: true
somewhere in yourconfig.sk
. Without it, Skript will still use the old syntaxes for things likename of
. We hope you try out this new API and give us feedback on what works, what doesn't, and what you'd like to see for its full release in 2.14. The number of property-driven syntaxes is rather small, but we plan on adding many more in the coming months!⚠ Breaking Changes
EntityData#init
. Adds parametermatchedCodeName
and refactorsmatchedPattern
.physics
instead ofphysic
in the block update effect.Changelog
Additions
debug info
expression that prints out extra information about a value. Currently this consists of the value itself and its class, though this is subject to expansion in the future!Changes
project.testEnv
inbuild.gradle
instead of updating the latest version for both.force entity to attack entity
effect.physics
instead ofphysic
in the block update effect.vehicle
alone in the mount event.event-location
foron portal
.Bug Fixes
red fox
andsnow fox
.minecart
.at %time% [in] real time
by triggering the code on the main thread.API Changes
Pattern
to allow providingnull
as the object for generic usage.Task
api.EntryData
multiple times.docs.json
improvements #8116 MakesJSONGenerator
available for addons and updates thedocs.json
format.Color
as an ARGB integer.PatternElement
and tests to catch possible pattern conflicts.SimplifiedCondition
for constant conditions.Condition
implementsSimplifiable
.Expression
class fromexpressionType
toexpressionClass
inSkript#registerExpression
.RuntimeErrorFilter
, which allows different consumers to apply different levels of filtering to the errors they print.ClassLoader
.ExpressionList
returns foracceptChange
to more accurately reflect the changers of the expressions within the list.Functions#getJavaFunctions
to only returnJavaFunction
s.Click here to view the full list of commits made since 2.12.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.
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:
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 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.13.0-pre1.
Beta Was this translation helpful? Give feedback.
All reactions