Skip to content

Releases: SkriptLang/Skript

Pre-Release 2.15.0-pre1

01 Apr 21:38
d731208

Choose a tag to compare

Pre-release

Skript 2.15.0-pre1

Today, we are excited to release the first pre-release for Skript 2.15.0. This release includes a few new major features and enhancements as we lay the groundwork for some exciting things coming later this year. It's no joke either, these features are real and available now!

In accordance with supporting the last 18 months of Minecraft updates, Skript 2.15.0 supports Minecraft 1.21.1 to 1.21.11. 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, report any issues to our issues page!

Per our release model, we plan to release 2.15.0 on April 15th. We may release additional pre-releases before then should the need arise.

Happy Skripting!

Major Changes

Adventure and MiniMessage Integration

After several months of testing, we are excited to share that Skript is now using Adventure and MiniMessage!

What is Adventure and/or MiniMessage?

Adventure is Paper's approach for supporting Minecraft's user interface elements. This includes chat messages, titles, player tablists, and more. These elements support all kinds of features, the most notable being colors and text decorations (e.g., bold, italic, etc.). Adventure is used throughout Paper, so by making this change, Skript is better aligned to support Paper's current and upcoming features.

MiniMessage is a way of representing these features in a text-based format. Skript has long used its own similar system, which most skripters are familiar with:

send "<red>Hello there <bold>%player%!"

MiniMessage is a much more developed system, resolving many of the issues that became apparent in Skript's existing system. Further, it has better support for all sorts of features:

send "<rainbow>Wow this text is super colorful!"
# this will show a stone block in the message
send "Look at my <sprite:blocks:block/stone>!"

You can read more on Paper's documentation website about using MiniMessage and the features it offers: https://docs.papermc.io/adventure/minimessage/format

What does this mean for scripters?
We have put in significant effort to ensure this transition is smooth. We expect all scripts to continue working without issue. Legacy formatting codes are still supported. However, there are a few edge cases to be aware of.

In some cases, Skript's color tags went directly against their formal definition in Minecraft. As a result, you may notice some color tags appear differently than before.

For addons expecting legacy formatted strings, this formatting is no longer processed automatically. For cases where formatting is not being processed, you can attempt process the string using the colored expression: colored "This is my &4legacy &rtext!"

Persistent Data Tags

Persistent data tags, also known as persistent data containers (PDC), are a way to store custom data directly on players, entities, items, blocks, chunks, and worlds. Unlike variables, which are stored separately from the rest of the game world, persistent data tags are a direct part of the thing they are attached to.

They serve a similar role to metadata, but they persist through server restarts and attach directly to things.

Here is a simple example of storing a damage bonus on a sword:

command /enchant-sword:
    trigger:
        set data tag "myserver:damage_bonus" of player's tool to 10
        send "Your sword has been enchanted with a damage bonus!"

on damage:
    set {_bonus} to data tag "myserver:damage_bonus" of attacker's tool
    if {_bonus} is set:
        add {_bonus} to damage

You can read more about Persistent Data in the new tutorial available on our new documentation site (in beta).

Region Hook Deprecation

With this release, we are deprecating Skript's region hooks for future removal. They have been unmaintained for some time and are full of difficult to resolve issues.

As an alternative, we have developed skript-worldguard, an official addon providing far more extensive support for WorldGuard.
You can read more about skript-worldguard on its repository: https://github.com/SkriptLang/skript-worldguard

We do not currently have any plans to offer addons for other region plugins.

(API) Event Value Registry

Following our efforts to modernize syntax registration, we are introducing a new, registry-based approach for event values. This system features new benefits such as custom identifiers (event-X), enhanced event validation, and support for changers (other than SET).

Here is an example of the full process:

// Obtaining the event value registry
EventValueRegistry registry = addon.registry(EventValueRegistry.class);

// Registering a simple event value
registry.register(EventValue.simple(WorldEvent.class, World.class, WorldEvent::getWorld));

// Builder option for more complex values (changers, time state)
registry.register(EventValue.builder(PlayerItemConsumeEvent.class, ItemStack.class)
    .getter(PlayerItemConsumeEvent::getItem)
    .registerChanger(ChangeMode.SET, PlayerItemConsumeEvent::setItem)
    .time(Time.NOW)
    .build());

For more information, you can consult the relevant pull request: #8326

⚠ Breaking Changes

  • Some message formatting may appear differently than before (see "Adventure and MiniMessage Integration" above).
  • (API) Long-deprecated registration methods in the EventValues class using Getters have been removed.

Changelog

Additions

  • #8327 Add a 'persistent data value' expression for working with persistent data tags (see "Persistent Data Tags" above).
  • #8329 Adds an 'attempt attack' event for when a player attempts to attack an entity. This occurs before regular damage events, and cancelling it prevents those events from triggering and prevents any sounds from playing.
  • #8331 Adds a 'player pick item' event for when a player uses the pick key (default middle mouse button) and 'picked item/block/entity' expression to obtain the thing "picked".
  • #8351 Adds a 'location with yaw/pitch' for obtaining a copy of a location with a modified yaw and/or pitch.
  • #8353 Adds a 'reduce' expression for reducing a list of elements into a single value.
  • #8396 Adds a configuration option to compress configuration, language, and variables file backups. This is enabled by default.
  • #8415 Adds failure caches to the parsing system to further improve parse times.
  • #8412 Adds a 'vector(n)' function, which is a shortcut for 'vector(n, n, n)'.
  • #8483 Adds a fast path for integer indices in variables, improving comparison speeds.
  • #8514 Adds missing definitions for certain Mounts of Mayhem features.

Changes

  • #8402 Unifies the behavior of the 'type of' and 'plain' expressions for items. Both expressions now return a base item representative of the original item. For example, potions now retain their potion effect(s) rather than becoming an "uncraftable potion". This change is more significant for the type of expression, which previously only cleared the name and durability of an item.
  • #8414 Makes the damage source experiment mainstream, no longer requiring using damage sources to enable.
  • #8433 Improves the code quality of the 'brushing stage' expression.
  • #8516 Further improves internal code quality and organization.
  • #8517 Adds a warning regarding the deprecation of region hooks.

Bug Fixes

  • #8435 Fixes an issue where Skript would fail to properly cancel some click events.
  • #8463 Fixes an issue where the 'inventory close expression' failed to return a value.
  • #8495 Fixes an issue where 'game effects' appeared incorrectly in the documentation.
  • #8498 Fixes an issue where some syntax errors could be improperly overriden by a more generic error.
  • #8502 Fixes an issue where internal syntax definitions were improperly compared.
  • #8512 Fixes an error that could occur when using the 'tags of x' expression.
  • #8518 Fixes an issue where a delay in a section that results in the termination of execution would propagate beyond that section.

API Changes

  • #8326 Overhauls the event value system with a new registration process that enables support for custom identifiers, event validation and any combination of changers.
  • #8346 Adds a HierarchicalAddonModule, a way for modules to easily nest within other modules for better addon organization. Refactored much of the skriptlang package to utilise this.
  • #8376...
Read more

Emergency Patch 2.14.3

05 Mar 18:26
e6ec744

Choose a tag to compare

Skript 2.14.3

Supports: Paper 1.21.0 - 1.21.11

Today, we are releasing 2.14.3 as a reupload of 2.14.2 due to it being uploaded as a selfbuilt jar. Whoops!

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

  • Mark the jar as a GitHub release.

Click here to view the change log for 2.14.2
Click here to view the full list of commits made since 2.14.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 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} to 5
set {_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}
    ...
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)

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 by 5 using a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the 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

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

New Documentation Site

Over the past few months, we have been working hard to build our new documentation site. Not only do we have a new-and-improved syntaxes page, we are also finally launching a proper platform for official tutorials on using Skript, from writing scripts to building addons.

While this site is still under heavy development, the beta is available for viewing at https://beta-docs.skriptlang.org.

Join us on Discord

We have an official Discord community where we share announcements and and perform testing for upcoming features.

Thank You

Special thanks to the contributors whose work was included in this version:

  • No one :p

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.

Patch Release 2.14.2

02 Mar 04:14
e1a3603

Choose a tag to compare

Skript 2.14.2

Supports: Paper 1.21.0 - 1.21.11

Today, we are releasing Skript 2.14.2 to clean up some API issues, fix up some docs oversights, and generally squash a few bugs.

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

Bug Fixes

  • #8432 Fixed delete name of tool not working and ensured all the name of properties support set/reset/delete where appropriate.
  • #8438 Fixed the name of event-inventory returning incorrect values for the inventory open event.
  • #8439 Fixed inventory of vehicle not returning the proper inventory.
  • #8442 Fixed missing "Since" version on the draw effect.
  • #8445 Fixed issue when creating BlockStateBlocks for unplaced BlockStates

API Fixes

  • #8425 Removed some left-over experimental annotations from registration api classes.
  • #8426 Fixed docs actions for archives.
  • #8429 Opened up EntryContainer and EntryValidator methods for better extensibility.
  • #8438 Added events to the convert method for type properties to allow event-specific overrides.
  • #8446 Added missing documentation to the property WXYZ expression.
  • #8456 Fixed mistaken return type assumptions in ExprArithmetic

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

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 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} to 5
set {_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}
    ...
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)

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 by 5 using a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the 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

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

New Documentation Site

Over the past few months, we have been working hard to build our new documentation site. Not only do we have a new-and-improved syntaxes page, we are also finally launching a proper platform for official tutorials on using Skript, from writing scripts to building addons.

While this site is still under heavy development, the beta is available for viewing at https://beta-docs.skriptlang.org.

Join us on Discord

We have an official Discord community where we share announcements and and perform testing for upcoming features.

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.

Patch Release 2.14.1

01 Feb 22:19
719fe7d

Choose a tag to compare

Skript 2.14.1

Supports: Paper 1.21.0 - 1.21.11

Today, we are releasing Skript 2.14.1 to resolve some of the issues found with Skript 2.14, and a significant number of older bugs too!

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

Additions

  • #8400 Adds the ability to suppress the warning when using a single ':' in a variable name.
  • #8407 Allows setting the item of an arrow projectile, which can change the item picked up when retrieving the arrow and can change the applied potion effects if the arrow is not a spectral arrow.

Bug Fixes

  • #8375 Fixes the function argument error displaying a 'null' value for the parameter name.
  • #8381 Fixes an issue where display name of <entity> returned the incorrect value.
  • #8382 Fixes an issue where apostrophes (') could not be used in literal specification (e.g. dragon's breath (damage cause)).
  • #8384 Refactors the open inventory effect to use Paper's Menu API, which fixes issues with anvils and smithing tables not functioning correctly.
  • #8390 Fixes an issue where the documentation for the 'any of' expression is missing version information.
  • #8395 Fixes issues where some expression sections would be erroneously parsed as sections when they clearly should not be.
  • #8401 Fixes an issue where using past/future world of x expressions wasn't returning the correct world in some scenarios.
  • #8403 Fixes an issue where parsing a region in a world where region data isn't loaded yet/is disabled would cause an exception.
  • #8404 Fixes incorrect example for the particle with speed expression.
  • #8405 Prevents the 'variables cannot be used here' warning from being used when it is not relevant.
  • #8408 Fixes an issue where function calls would not call the most recent version of a function.
  • #8416 Fixes an unintentional block on using x of y when both inputs were literal: 5 of flame particles.

API Fixes

  • #8392 Fixes an issues where the Expression and Structure syntax infos would incorrectly produce warnings about being internal.
  • #8394 Fixes an issue where test servers on GitHub Actions would randomly crash during shutdown.
  • #8399 Fixes an issue with comparing version strings that include postfixes like 'nightly' or 'pre1'.

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

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 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} to 5
set {_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}
    ...
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)

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 by 5 using a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the 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

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

New Documentation Site

Over the past few months, we have been working hard to build our new documentation site. Not only do we have a new-and-improved syntaxes page, we are also finally launching a proper platform for official tutorials on using Skript, from writing scripts to building addons.

While this site is still under heavy development, the beta is available for viewing at https://beta-docs.skriptlang.org.

Join us on Discord

We have an official Discord community where we share announcements and and perform testing for upcoming features.

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.

Feature Release 2.14.0

15 Jan 18:44
94d9924

Choose a tag to compare

Skript 2.14.0

Today, we are excited to be starting the year off strong with the formal release of Skript 2.14.0! This release includes dozens of major contributions to enhance Skript's existing features, along with a handful of exciting new features. With all of this early spring cleaning, there are some important breaking changes to be aware of, specifically around visual effects and potions. Be sure to look through the Breaking Changes section below to see whether your scripts are impacted.

In accordance with supporting the last 18 months of Minecraft updates, Skript 2.14.0 supports Minecraft 1.21.0 to 1.21.11. 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, report any issues to our issues page!

Per our release model, we plan to release 2.14.1 on February 1st. We may release additional pre-releases before then should the need arise.

Happy Skripting!

Major Changes

Potions Rework

Potion syntax has seen a major rework in order to modernize the syntax and make working with potions a breeze.

Obtaining Potion Effects

Just as before, potion effects can be obtained through syntax like:

set {_potions::*} to the potion effects of the player

However, it is now also possible to obtain specific potion effects:

set {_speed} to the player's speed effect

Potion Creation

Potion creation has been united into a single expression that may optionally be used as a section:

apply an ambient potion effect of speed of tier 5 to the player for 15 seconds:
	hide the particles
	hide the icon

The current effect has been replaced with one for applying potion effects.

Potion Modification

The six primary properties of potion effects are supported: type, duration, amplifier, ambient, particles, and icon.
All of these properties may be modified in the builder (see above).

It is also now possible to modify existing potion effects:

set the amplifier of {_potion} to 5
apply {_potion} to {_entity}

Even better, it is now possible to modify potion effects that are actively applied to entities and items:

set the duration of the player's active speed effect to 5 minutes
set the amplifier of the player's slowness effect to 10
make the potion effects of the player's tool infinite

Hidden Effects

Full support for hidden effects has been implemented too. Hidden effects allow a player to have multiple effects of the same type. For example, if a player has speed 1 for 30 seconds, and is then affected by speed 2 for 15 seconds, after those 15 seconds, the player will have 15 seconds of speed 1 remaining.

Support for obtaining these effects has been implemented:

set {_effects::*} to the player's potion effects # only active effects
set {_effects::*} to the player's active potion effects # only active effects
set {_effects::*} to the player's hidden potion effects # only hidden effects
set {_effects::*} to the player's active and hidden potion effects # all effects

Just as with active effects, hidden effects support being changed too! Note that modifying a hidden effect may result in it taking precedence over the active effect.

Comparisons

Support for more lenient comparisons has been implemented too:

player has speed 10 # checks type, amplifier
player has a potion effect of speed for 30 seconds # checks type, duration

The 'comparison' condition (as in, x is y), can be used for exact comparisons.

These comparisons are also used for removals:

remove speed 10 from the player's potion effects # removed effects must match type, amplifier
remove potion effect of speed for 30 seconds from the player's potion effects # removed effects must match type, duration

Complete Visual Effect Rework

Skript's visual effect system has been in dire need of repair, with limited to no documentation and multiple errors and outdated syntaxes. We've tackled this with a full rework of visual effects, meaning likely all code using visual effects will suffer breaking changes, but it was sadly necessary to get to a better state.

Visual effects are now split into 3 different types: particle effects, game effects, and entity effects. Entity effects are generally animations that can be played on specific entities, like the ravager attack animation effect. Game effects compose a variety of built-in game sounds and/or particle effects, like the combined sound+particles of the composter, or the footstep sound for a specific block. Particle effects are the standard particles you all know and love from /particle. We've overhauled the system to provide easier access to data-driven particles like dust; you can now draw red dust particle at player!

We've also added some syntax to help users better understand and use the admittedly labyrinthine particle api in the form of scale, distribution, and velocity support, rather than simply offset (though you can still set offset manually!).

# sets the random distribution of the particle
set particle distribution of {_flame particle} to vector(1,2,1) 

# set the velocity of the flame particle. 
# Note this only works for 'directional particles' and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the velocity of {_flame particle} to vector(1,2,1) 

# set the scale of the explostion particle. 
# Note this only works for 'scalable particles' (explosion, sweeping edge) and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the scale of {_explosion particle} to 2.5 

Drawing a particle should look more like this, now:

draw 8 red dust particles at player
draw 3 blue trail particles moving to player's target over 3 seconds at player
draw an electric spark particle with velocity vector(1,1,1) at player
draw 10 flame particles with offset vector(1,0,1) with an extra value of 0

set {_particle} to a flame particle
set velocity of {_particle} to vector(0,1,0)
draw 10 of {_particle} at player

Please note that users of SkBee and skript-particles and any other addon dealing with particles will likely need to wait for these addons to be updated to use Skript's particle system instead.

Named Function Arguments

Arguments for functions can now be specified by the name of the argument. This improves clarity with regard to the passed arguments for functions with many parameters.

function multiply(a: number, b: number) returns number:
    return {_a} * {_b}
  
on load:
    assert multiply(1, 2) is 2
    assert multiply(a: 1, b: 2) is 2
    assert multiply(1, b: 2) is 2
    assert multiply(a: 1, 2) is 2
    assert multiply(b: 2, a: 1) is 2

Mixing named and unnamed function arguments is allowed, as long as the order of the function parameters is followed, as specified in the function definition.

function add(a: number, b: number) returns number:
    return {_a} + {_b}
    
on load:
    assert multiply(a: 1, 2) is 2 # allowed! 
    assert multiply(1, b: 2) is 2 # allowed!
    assert multiply(b: 2, 2) is 2 # not allowed!
    assert multiply(2, a: 2) is 2 # not allowed!

For-Each Loop

For loops are now available by default for all users and no longer require opting into the for loops experiment. As a reminder, for loops are a 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.

Interaction Entities

Syntax has been added for working with interaction entities. There is support for responsiveness and dimensions, along with obtaining the last date an interaction was clicked and the last player to interact.

The syntax is available on our documentation site.

Recursive Expression

Expressions may now return values recursively using recursive %objects%, or combined with the keyed %objects% expression to return its keys recursively as well. This allows Skript to pass entire structures (i.e. lists) around different contexts, like passing a list to a function while retaining indices and sublists, freely.

Note: To avoid cumbersome wording, passing a keyed expression to a function will implicitly pass it recursively as well. For example:

set {_list::a} to "Hello"
set {_list::b} to "World!"
set {_list::sublist::c} to "I'm nested!"

# This behaves the same as the same as 'print_list(recursive keyed {_list::*})'.
# This is only true for function parameter.
print_list(keyed {_list::*})
# Prints:
# a -> Hello
# b -> World!
# sublist::c -> I'm nested!

function print_list(list: objects):
    loop {_list::*}:
        broadcast "%loop-index% -> %loop-value%"

For more information, you can review the pull request.

...

Read more

Pre-Release 2.14.0-pre2

11 Jan 00:20
098521a

Choose a tag to compare

Pre-release

Skript 2.14.0-pre2

We are starting the weekend with the second pre-release for Skript 2.14.0, now with more bug fixes! This release includes dozens of major contributions to enhance Skript's existing features, along with a handful of exciting new features. Major changes means some breaking changes though, so we hope you all forgive us for doing some early spring cleaning (especially with visual effects). Please remember to look through the Breaking Changes section to see if anything impacts you!

In accordance with supporting the last 18 months of Minecraft updates, Skript 2.14.0 supports Minecraft 1.21.0 to 1.21.11. 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, report any issues to our issues page!

Per our release model, we plan to release 2.14.0 on January 15th. We may release additional pre-releases before then should the need arise.

Happy Skripting!

Major Changes

Potions Rework

Potion syntax has seen a major rework in order to modernize the syntax and make working with potions a breeze.

Obtaining Potion Effects

Just as before, potion effects can be obtained through syntax like:

set {_potions::*} to the potion effects of the player

However, it is now also possible to obtain specific potion effects:

set {_speed} to the player's speed effect

Potion Creation

Potion creation has been united into a single expression that may optionally be used as a section:

apply an ambient potion effect of speed of tier 5 to the player for 15 seconds:
	hide the particles
	hide the icon

The current effect has been replaced with one for applying potion effects.

Potion Modification

The six primary properties of potion effects are supported: type, duration, amplifier, ambient, particles, and icon.
All of these properties may be modified in the builder (see above).

It is also now possible to modify existing potion effects:

set the amplifier of {_potion} to 5
apply {_potion} to {_entity}

Even better, it is now possible to modify potion effects that are actively applied to entities and items:

set the duration of the player's active speed effect to 5 minutes
set the amplifier of the player's slowness effect to 10
make the potion effects of the player's tool infinite

Hidden Effects

Full support for hidden effects has been implemented too. Hidden effects allow a player to have multiple effects of the same type. For example, if a player has speed 1 for 30 seconds, and is then affected by speed 2 for 15 seconds, after those 15 seconds, the player will have 15 seconds of speed 1 remaining.

Support for obtaining these effects has been implemented:

set {_effects::*} to the player's potion effects # only active effects
set {_effects::*} to the player's active effects # only active effects
set {_effects::*} to the player's hidden effects # only hidden effects
set {_effects::*} to the player's active and hidden effects # all effects

Just as with active effects, hidden effects support being changed too! Note that modifying a hidden effect may result in it taking precedence over the active effect.

Comparisons

Support for more lenient comparisons has been implemented too:

player has speed 10 # checks type, amplifier
player has a potion effect of speed for 30 seconds # checks type, duration

The 'comparison' condition (as in, x is y), can be used for exact comparisons.

These comparisons are also used for removals:

remove speed 10 from the player's potion effects # removed effects must match type, amplifier
remove potion effect of speed for 30 seconds from the player's potion effects # removed effects must match type, duration

Complete Visual Effect Rework

Skript's visual effect system has been in dire need of repair, with limited to no documentation and multiple errors and outdated syntaxes. We've tackled this with a full rework of visual effects, meaning likely all code using visual effects will suffer breaking changes, but it was sadly necessary to get to a better state.

Visual effects are now split into 3 different types: particle effects, game effects, and entity effects. Entity effects are generally animations that can be played on specific entities, like the ravager attack animation effect. Game effects compose a variety of built-in game sounds and/or particle effects, like the combined sound+particles of the composter, or the footstep sound for a specific block. Particle effects are the standard particles you all know and love from /particle. We've overhauled the system to provide easier access to data-driven particles like dust; you can now draw red dust particle at player!

We've also added some syntax to help users better understand and use the admittedly labyrinthine particle api in the form of scale, distribution, and velocity support, rather than simply offset (though you can still set offset manually!).

# sets the random distribution of the particle
set particle distribution of {_flame particle} to vector(1,2,1) 

# set the velocity of the flame particle. 
# Note this only works for 'directional particles' and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the velocity of {_flame particle} to vector(1,2,1) 

# set the scale of the explostion particle. 
# Note this only works for 'scalable particles' (explosion, sweeping edge) and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the scale of {_explosion particle} to 2.5 

Drawing a particle should look more like this, now:

draw 8 red dust particles at player
draw 3 blue trail particles moving to player's target over 3 seconds at player
draw an electric spark particle with velocity vector(1,1,1) at player
draw 10 flame particles with offset vector(1,0,1) with an extra value of 0

set {_particle} to a flame particle
set velocity of {_particle} to vector(0,1,0)
draw 10 of {_particle} at player

Please note that users of SkBee and skript-particles and any other addon dealing with particles will likely need to wait for these addons to be updated to use Skript's particle system instead.

Named Function Arguments

Arguments for functions can now be specified by the name of the argument. This improves clarity with regard to the passed arguments for functions with many parameters.

function multiply(a: number, b: number) returns number:
    return {_a} * {_b}
  
on load:
    assert multiply(1, 2) is 2
    assert multiply(a: 1, b: 2) is 2
    assert multiply(1, b: 2) is 2
    assert multiply(a: 1, 2) is 2
    assert multiply(b: 2, a: 1) is 2

Mixing named and unnamed function arguments is allowed, as long as the order of the function parameters is followed, as specified in the function definition.

function add(a: number, b: number) returns number:
    return {_a} + {_b}
    
on load:
    assert multiply(a: 1, 2) is 2 # allowed! 
    assert multiply(1, b: 2) is 2 # allowed!
    assert multiply(b: 2, 2) is 2 # not allowed!
    assert multiply(2, a: 2) is 2 # not allowed!

For-Each Loop

For loops are now available by default for all users and no longer require opting into the for loops experiment. As a reminder, for loops are a 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.

Interaction Entities

Syntax has been added for working with interaction entities. There is support for responsiveness and dimensions, along with obtaining the last date an interaction was clicked and the last player to interact.

The syntax is available on our documentation site.

Recursive Expression

Expressions may now return values recursively using recursive %objects%, or combined with the keyed %objects% expression to return its keys recursively as well. This allows Skript to pass entire structures (i.e. lists) around different contexts, like passing a list to a function while retaining indices and sublists, freely.

Note: To avoid cumbersome wording, passing a keyed expression to a function will implicitly pass it recursively as well. For example:

set {_list::a} to "Hello"
set {_list::b} to "World!"
set {_list::sublist::c} to "I'm nested!"

# This behaves the same as the same as 'print_list(recursive keyed {_list::*})'.
# This is only true for function parameter.
print_list(keyed {_list::*})
# Prints:
# a -> Hello
# b -> World!
# sublist::c -> I'm nested!

function print_list(list: objects):
    loop {_list::*}:
        broadcast "%loop-index% -> %loop-value%"

For more information, you can review the pull request.

(API) Registratio...

Read more

Pre-Release 2.14.0-pre1

02 Jan 02:00
25dd291

Choose a tag to compare

Pre-release

Skript 2.14.0-pre1

We are kicking off the new year with the first pre-release for Skript 2.14.0. This release includes dozens of major contributions to enhance Skript's existing features, along with a handful of exciting new features. Major changes means some breaking changes though, so we hope you all forgive us for doing some early spring cleaning (especially with visual effects). Please remember to look through the Breaking Changes section to see if anything impacts you!

In accordance with supporting the last 18 months of Minecraft updates, Skript 2.14.0 supports Minecraft 1.21.0 to 1.21.11. 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, report any issues to our issues page!

Per our release model, we plan to release 2.14.0 on January 15th. We may release additional pre-releases before then should the need arise.

Happy Skripting!

Major Changes

Potions Rework

Potion syntax has seen a major rework in order to modernize the syntax and make working with potions a breeze.

Obtaining Potion Effects

Just as before, potion effects can be obtained through syntax like:

set {_potions::*} to the potion effects of the player

However, it is now also possible to obtain specific potion effects:

set {_speed} to the player's speed effect

Potion Creation

Potion creation has been united into a single expression that may optionally be used as a section:

apply an ambient potion effect of speed of tier 5 to the player for 15 seconds:
	hide the particles
	hide the icon

The current effect has been replaced with one for applying potion effects.

Potion Modification

The six primary properties of potion effects are supported: type, duration, amplifier, ambient, particles, and icon.
All of these properties may be modified in the builder (see above).

It is also now possible to modify existing potion effects:

set the amplifier of {_potion} to 5
apply {_potion} to {_entity}

Even better, it is now possible to modify potion effects that are actively applied to entities and items:

set the duration of the player's active speed effect to 5 minutes
set the amplifier of the player's slowness effect to 10
make the potion effects of the player's tool infinite

Hidden Effects

Full support for hidden effects has been implemented too. Hidden effects allow a player to have multiple effects of the same type. For example, if a player has speed 1 for 30 seconds, and is then affected by speed 2 for 15 seconds, after those 15 seconds, the player will have 15 seconds of speed 1 remaining.

Support for obtaining these effects has been implemented:

set {_effects::*} to the player's potion effects # only active effects
set {_effects::*} to the player's active effects # only active effects
set {_effects::*} to the player's hidden effects # only hidden effects
set {_effects::*} to the player's active and hidden effects # all effects

Just as with active effects, hidden effects support being changed too! Note that modifying a hidden effect may result in it taking precedence over the active effect.

Comparisons

Support for more lenient comparisons has been implemented too:

player has speed 10 # checks type, amplifier
player has a potion effect of speed for 30 seconds # checks type, duration

The 'comparison' condition (as in, x is y), can be used for exact comparisons.

These comparisons are also used for removals:

remove speed 10 from the player's potion effects # removed effects must match type, amplifier
remove potion effect of speed for 30 seconds from the player's potion effects # removed effects must match type, duration

Complete Visual Effect Rework

Skript's visual effect system has been in dire need of repair, with limited to no documentation and multiple errors and outdated syntaxes. We've tackled this with a full rework of visual effects, meaning likely all code using visual effects will suffer breaking changes, but it was sadly necessary to get to a better state.

Visual effects are now split into 3 different types: particle effects, game effects, and entity effects. Entity effects are generally animations that can be played on specific entities, like the ravager attack animation effect. Game effects compose a variety of built-in game sounds and/or particle effects, like the combined sound+particles of the composter, or the footstep sound for a specific block. Particle effects are the standard particles you all know and love from /particle. We've overhauled the system to provide easier access to data-driven particles like dust; you can now draw red dust particle at player!

We've also added some syntax to help users better understand and use the admittedly labyrinthine particle api in the form of scale, distribution, and velocity support, rather than simply offset (though you can still set offset manually!).

# sets the random distribution of the particle
set particle distribution of {_flame particle} to vector(1,2,1) 

# set the velocity of the flame particle. 
# Note this only works for 'directional particles' and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the velocity of {_flame particle} to vector(1,2,1) 

# set the scale of the explostion particle. 
# Note this only works for 'scalable particles' (explosion, sweeping edge) and it will override the random distribution 
# (distribution and special effects like scale/velocity are mutually exclusive)
set the scale of {_explosion particle} to 2.5 

Drawing a particle should look more like this, now:

draw 8 red dust particles at player
draw 3 blue trail particles moving to player's target over 3 seconds at player
draw an electric spark particle with velocity vector(1,1,1) at player
draw 10 flame particles with offset vector(1,0,1) with an extra value of 0

set {_particle} to a flame particle
set velocity of {_particle} to vector(0,1,0)
draw 10 of {_particle} at player

Please note that users of SkBee and skript-particles and any other addon dealing with particles will likely need to wait for these addons to be updated to use Skript's particle system instead.

Named Function Arguments

Arguments for functions can now be specified by the name of the argument. This improves clarity with regard to the passed arguments for functions with many parameters.

function multiply(a: number, b: number) returns number:
    return {_a} * {_b}
  
on load:
    assert multiply(1, 2) is 2
    assert multiply(a: 1, b: 2) is 2
    assert multiply(1, b: 2) is 2
    assert multiply(a: 1, 2) is 2
    assert multiply(b: 2, a: 1) is 2

Mixing named and unnamed function arguments is allowed, as long as the order of the function parameters is followed, as specified in the function definition.

function add(a: number, b: number) returns number:
    return {_a} + {_b}
    
on load:
    assert multiply(a: 1, 2) is 2 # allowed! 
    assert multiply(1, b: 2) is 2 # allowed!
    assert multiply(b: 2, 2) is 2 # not allowed!
    assert multiply(2, a: 2) is 2 # not allowed!

For-Each Loop

For loops are now available by default for all users and no longer require opting into the for loops experiment. As a reminder, for loops are a 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.

Interaction Entities

Syntax has been added for working with interaction entities. There is support for responsiveness and dimensions, along with obtaining the last date an interaction was clicked and the last player to interact.

The syntax is available on our documentation site.

Recursive Expression

Expressions may now return values recursively using recursive %objects%, or combined with the keyed %objects% expression to return its keys recursively as well. This allows Skript to pass entire structures (i.e. lists) around different contexts, like passing a list to a function while retaining indices and sublists, freely.

Note: To avoid cumbersome wording, passing a keyed expression to a function will implicitly pass it recursively as well. For example:

set {_list::a} to "Hello"
set {_list::b} to "World!"
set {_list::sublist::c} to "I'm nested!"

# This behaves the same as the same as 'print_list(recursive keyed {_list::*})'.
# This is only true for function parameter.
print_list(keyed {_list::*})
# Prints:
# a -> Hello
# b -> World!
# sublist::c -> I'm nested!

function print_list(list: objects):
    loop {_list::*}:
        broadcast "%loop-index% -> %loop-value%"

For more information, you can review the pull request.

(API) Registration API Stabilization

T...

Read more

Patch Release 2.13.2

02 Dec 02:07
8209445

Choose a tag to compare

Skript 2.13.2

Supports: Paper 1.20.4 - 1.21.10

Today, we are releasing Skript 2.13.2 to resolve some various issues found with Skript 2.13, as well as solving a few older bugs.

We have also revamped our contributor guide to be much more beginner-friendly, so now's a great time to try making your first PR! For existing contributors, please note the addition of the AI usage disclosure requirement for PRs:

If you relied on AI assistance to make a pull request, you must disclose it in the
pull request, together with the extent of the usage.

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

Additions / Changes

  • #8285 Improves variable thread safety, preventing race conditions and conflicts when accessing variables on parallel threads.
  • #8286 Adds 'child' as an option for the 'make adult/baby' effect.
  • #8294 Updates contribution guidelines and adds AI disclosure requirement

Bug Fixes

  • #8250 Fixes an issue where functions could be unloaded prior to the 'on unload' event firing, leading to Skript being unable to resolve function calls.
  • #8263 Fixes issues with do-whiles not running properly in concurrent scenarios.
  • #8271 Ensures legacy syntax infos have reference to their modern counterparts to support modern features like suppliers.
  • #8278 Fixes vague and unclear errors when attempting to parse regions that do not exist or are ambiguous.
  • #8284 Fixes an issue where on brew complete was not a valid pattern, but on brew complet was.
  • #8293 Makes the auto-reload player name input case-insensitive.
  • #8295 Fix an issue that prevented the use of past and future when using the level of player in the level change event.
  • #8299 Fixes a bug where a delay in one event trigger could affect the behavior of another trigger of the same event that was parsed later on.
  • #8304 Fixes an issue where a warning would be displayed when using an empty variable for cooldown storage.

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

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.

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} to 5
set {_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}
    ...
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)

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 by 5 using a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the 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

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

Join us on Discord

We have an official Discord community where we share announcements and and perform testing for upcoming features.

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.

Patch Release 2.13.1

02 Nov 00:27
eae1f09

Choose a tag to compare

Skript 2.13.1

Today, we are releasing Skript 2.13.1 to resolve some of the most common issues reported with Skript 2.13.0.

As always, you can report any issues on our issue tracker.

Happy Skripting!

Changelog

Additions / Changes

  • #8225 Added support for using a list of strings in the text of expression.
  • #8226 Adds support for using closest as an alias in the 'nearest entity' expression.

Bug Fixes

  • #8221 Fixes an issue where functions with one plural parameter that has default values would cause an exception when the default values were used.
  • #8240 Removes legacy code used in the bucket events, preventing Skript from loading legacy material support and causing a temporary server freeze.
  • #8242 Fixes an extraneous the in the 'tablisted players' expression.
  • #8245 Fixes an issue with matching functions that have a single list parameter.
  • #8248 Fixes an issue with how the 'has scoreboard tag' condition handled OR inputs.
  • #8249 Fixes an issue where the name of blocks (such as chests) would not carry over when those blocks were placed.

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

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.

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} to 5
set {_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}
    ...
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)

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 by 5 using a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the 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

set the equipment slot of {_item} to helmet slot
    
set {_component} to the equippable component of {_item}
allow {_component} to swap equipment

For more details about the syntax, visit equippable component on our documentation website.

Join us on Discord

We have an official Discord community where we share announcements and and perform testing for upcoming features.

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.

Feature Release 2.13.0

15 Oct 17:41
70c8862

Choose a tag to compare

Skript 2.13.0

Today, we are excited to release Skript 2.13.0. This release includes a handful of new features, bug fixes, and behind-the-scenes API improvements to play with. For addon developers, we strongly recommend reviewing the Type Properties section below.

Please also note our changes to the supported versions. 2.13 will be 1.20.4+, and 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, report any issues to our issues page!

Per our release model, we plan to release 2.13.1 on November 1st. We may release emergency patches 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 will be 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 has dropped support for Spigot. Skript now requires Paper or a downstream fork of Paper, such as Purpur or Pufferfish.

Major Changes

Equippable Components (Experimental)

Added in #7194

Note

This feature is currently experimental and can be used by enabling the equippable components experiment.

Equippable components allow 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:
	set the camera overlay to "custom_overlay"
	set the allowed entities to a zombie and a skeleton
	set the equip sound to "block.note_block.pling"
	set the equipped model id to "custom_model"
	set the shear sound to "ui.toast.in"
	set the 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
set the equippable component of {_item} to {_component}

Automatic Reloading

Added in #7464

A new Structure has been added that enables automatic reloading of a script when it is updated (e.g. the file is saved). This feature is only supported if asynchronous loading is enabled in Skript's configuration file (config.sk).

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.

Debug Information Expression

Added in #8207

A new expression that returns additional information about a value has been added. Currently, this consists of the value itself and its class, though this is subject to change in the future.

set {my_list::*} to 1, "2", and vector(1, 2, 3)
broadcast debug info of {my_list::*}
# prints:
# 1 (integer)
# "2" (text)
# x: 1, y: 2, z: 3 (vector)

Type Properties (Experimental)

Added in #8165

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

  • #7985 Changes the method signature for the abstract EntityData#init. Adds parameter matchedCodeName and refactors matchedPattern.
  • #8072 Enforces using physics instead of physic in the block update effect.

Changelog

Additions

Changes

  • #8072 Enforces using physics instead of physic in the block update effect.

Bug Fixes

  • #7985 Fixes being unable to spawn certain entities in certain states, such as red fox and snow fox.
  • #8064 Fixes an issue where it was not possible to spawn a minecart.
  • #8177 Fixes the 'cannot reset' and 'cannot delete' error messages of the 'change' effect being swapped around.
  • #8182 Fixes an issue where variable changes across multiple threads could be processed in the wrong order, resulting in data loss.
  • #8185 Fixes the 'system time' event not triggering on the main thread.
  • #8189 Fixes an issue where function calls with a single parameter to functions with 0 required parameters would fail to parse.
  • #8195 Fixes an issue where the 'catch runtime errors' section would stop catching errors after the default error limit was reached.
  • #8199 Fixes an issue where functions could not use Expression Sections.
  • #8232 Fixes an issue where Expression Sections did not work properly with Effect Sections (used as an Effect).

API Changes

  • #7797 Uses project.testEnv in build.gradle instead of updating the latest version for both.
  • #7985 Changes Pattern to allow providing null as the o...
Read more