2.7.0
🚀 Skript 2.7.0
📢 We are proud to finally say that 2.7.0 is here!
Our last stable release was 2.6.4 nearly a year ago, and a lot has happened since then. In this release, we have implemented over 80 new features along with nearly 70 bug fixes. Beyond that, a significant portion of this time has been spent on overhauling Skript's codebase. This update includes some of the biggest internal enhancements in years. Almost every part of Skript should run faster, and as we continue to build upon these improvements, the benefits will only grow.
We realize that this update has taken much longer than expected. Our development cycle has been rather flawed, and we are committed to making changes that will result in a clearer release schedule. We will have more to share about that soon when we finalize a new process.
🎉 We are also very excited to welcome a new member, @sovdeeth to our team.
Thank you all again for your continued support. Happy Skripting! ⚡
📢 End of 1.12.2 Support
As mentioned in the previous releases, we have decided to drop support for 1.12 and lower (legacy versions).
This means that this version will only work on versions 1.13 and higher.
Only critical fixes will be backported to 2.6.X.
⚠ Compatibility Warning
Due to the major internal changes within this update, some addons may no longer work properly.
Please be patient as addon developers work to update their addons.
We have published a new release of our AddonPatcher, but be aware that it cannot fix all issues.
⚠ Breaking Changes
- Scripts in subdirectories will now load before those in the main directory.
- List parsing order has changed to function in a clearer manner:
# Here is an example list declaration
set {_l::*} to "abc", length of "def", "ghi"
# Previous Behavior
Interpretation: "abc", length of ("def", "ghi")
Result: "abc", 3, 3
# New Behavior
Interpretation: "abc", length of ("def"), "ghi"
Result: "abc", 3, "ghi"
- Removed the expression for obtaining the numerical ID of an item
- The durability expression has changed. Durability now works counter to damage. That is, as the damage of an item increases, its durability decreases. Here is an example:
set {_item} to <some item with 1000 durability>
add 5 to the damage of {_item} # durability is now 995/1000
add 5 to the durability of {_item} # durability is now 1000/1000 again
⭐️ 2.7.0 Changelog
Click here to view the full list of commits made since 2.6.4
Click below to view the entire changelog for this release (all changes since 2.6.4).
Full changelog
Notable Additions
📃 All new syntax can be viewed on docs.skriptlang.org.
-
Language support for French, Polish, Simplified Chinese, and Japanese has been added.
-
We have significantly overhauled the default examples. The goal of these new examples is to display most of Skript's feature set with a better range of difficulties.
-
Multiline conditionals has been added. These work on an if-then based structure.
Multiline Conditional Example
# all conditions must pass
if:
condition 1
condition 2
then:
do stuff
# at least one condition must pass
if any:
condition 1
condition 2
then:
do stuff
# it can also be used in else-if statements
if 1 + 1 = 3:
do stuff that will never actually be done
else if:
condition 1
condition 2
then:
do stuff
else:
do stuff
- Local Functions that can only be used in the script that they are declared have been added.
Local Function Example
# in script1.sk
local function welcome():
broadcast "Welcome!"
# in script2.sk
on script load:
welcome() # this will error as `welcome()` is only available in script1.sk
- The Options section has been expanded to support nesting.
Nested Options Example
options:
price:
apple: 1000
orange: 100
# {@price.apple} and {@price.orange} are now valid options
Additions
- Added syntax support for obtaining and modifying the age of blocks (e.g. crops) and entities (closes #3068, #4534)
- Added support for providing multiple players in the played before condition
- Added syntax support for the freezing mechanics introduced in 1.18
- Added support for
the last struck lightning
(this only applies to lighting strikes created by Skript) (closes #3872) - Added syntax for forcing entities to pathfind to a location (closes #2334)
- Added syntax for obtaining a list of the names of all loaded plugins (closes #4189)
- Added syntax for obtaining the bed location of offline players (closes #4659)
- Added syntax for modifying the unsafe bed location of players, meaning they will respawn there even if the location is obstructed
- Added events and event values for when an anvil is damaged (requires Paper) and when an item is placed in an anvil (e.g. preparing for a repair) (closes #4456)
- Added additional event values for the player and entity move events (closes #4890)
- Added a new configuration option for printing warnings for script lines that take too long to parse (closes #4759)
Look for
long parse time warning threshold
in yourconfig.sk
!
- Added an expression for obtaining the raw content of a string (no parsing or stripping of formatting) (closes #4102)
- Added support for spawning a wolf with a specific collar color (closes #1760)
- Added support for obtaining the amplifier of an entity's potion effect (thanks @Ankoki)
- Added complete support for the "player egg throw event"
- Added French language support (thanks @Romitou)
- Added support for multiple entities in the equip syntax (closes #5083)
- Added the player trade event with support for obtaining the involved entity (thanks @AbeTGT)
- Added case sensitivty support for the join and split syntax
Note that these expressions will now take into account the case sensitivity config option (closes #4886)
- Added support for lang files to automatically update when changes are detected
Note that when a change is detected, existing lang files will be moved into a backups folder
- Added the ability for creating sectioned options (closes #4032)
- Added support for obtaining and modifying the pickup delay of a dropped item
- Added Polish language support
- Added support for
the last launched firework
(this only applies to fireworks launched by Skript) (closes #4942) - Added syntax for obtaining the environment (overworld, nether, end) of a world (closes #3673)
- Added a condition for checking whether an entity is gliding (thanks @Ankoki) (closes #5145)
- Added syntax for modifying and checking whether an entity is invisible (thanks @D4isDAVID)
- Added an event for when an entity jumps (thanks @AbeTGT)
- Added syntax for obtaining and modifying the duration of an entity burning (closes #923)
- Added support for creating local functions (closes #2188, #5167)
- Added syntax for obtaining the nearest entity relative to another entity or location (closes #4674)
- Added syntax for checking whether a location is within a certain radius of another location (closes #5201)
- Added syntax for obtaining the list of all banned players or IP addresses
- Added syntax for checking if a location is within two other locations
- Added syntax for obtaining the current moon phase of a world (closes #746)
- Added past, present, and future event values for the block place event
- Added block data support to the
type of
expression - Added syntax for obtaining the text input of an anvil
- Added the ability to set a block to a specific skull (e.g. the player's skull) (closes #1789)
- Added syntax for obtaining, modifying, and checking for server operators (closes #4910)
- Added support for multiline conditions (closes #5152)
- Added syntax for forcing an entity to look at another entity
- Added syntax for allowing modification of the actual maximum player count (thanks @kiip1)
- Added events for when a player starts/stops/swaps spectating another entity
- Added modification support to the book pages expression
- Added support for using
a
/an
in inventory types
That is, you can now write
set {_var} to a shulker box inventory
.
- Added syntax for respawn anchors (thanks @hotpocket184) (closes #4726)
- Added a literal representing pi (thanks @kiip1) (closes #5288)
- Added a new command entry for changing the command prefix
The command prefix is used when there may be command name conflicts with another plugin (this is the
skript:
part ofskript:mycustomcommand
).
- Added support for worlds in the
name of
syntax (thanks @DelayedGaming) - Added support for determining whether an entity is valid
An entity will be considered invalid if it has died or despawned.
- Added an event for when an entity drops an item (thanks @ShaneBeee)
- Added support for determining whether an entity is an enemy (thanks @ShaneBeee)
Note that this is only available on Minecraft 1.19.3 and newer.
- Added support for obtaining the source block in a block spread event (thanks @GodModed) (closes #5346)
- Added the loot generate event and support for modifying the loot
- Added syntax for obtaining and modifying the number of sea pickles at a block
- Added support for unequipping items from an entity (thanks @colton-boi) (closes #5360)
- Added Simplified Chinese language support (thanks @CJYKK)
- Added Japanese language support (thanks @faketuna and @rilyhugu)
- Added a chat component tag for copying to the clipboard (closes #5351)
Example: `send "<copy:text to copy>text to display"
- Added syntax for determining whether a tool is the preferred tool for harvesting a block
- Added syntax for determining whether an item is stackable (max stack size > 1) (thanks @cooffeeRequired)
- Re-enabled support for the the player view distance on newer versions where it functions (thanks @ShaneBeee)
- Added syntax for obtaining all values of a specific type (closes #5065, #5082, #5235)
Examples include
all colors
,all potion effect types
, etc.
- Added syntax for obtaining how fast a player can break block at a given moment
- Alias names can now be used for parsing block data (previously only Minecraft IDs were valid)
- Added a
value within
syntax for modifying the values of a variable rather than the variable itself
Example:
delete the entity within {_entity}
# deletes the entity rather than the variable
- Added syntax for applying knockback to an entity
- Added support for rounding to a specific decimal point in the round function (closes #3579)
- Added an event and event values for when a change occurs in a player's inventory slot
- Added an event for when a player has slept long enough to count as passing the night/storm (thanks @DelayedGaming)
- Added an event for when a player enters a chunk (thanks @DelayedGaming) (closes #5441)
- Added an event for when a player's experience changes (closes #2858)
- Added syntax for checking if a location is within an entity, chunk, world, or block
- Added support for modifying the Skript prefix in the language files (thanks @Fusezion) (closes #5424)
- Added a chat component tag for translating game strings based on the player's locale (closes #4875)
Example:
send "<translate:block.minecraft.diamond_block>"
printsBlock of Diamond
- Added support for reseting the target of an entity
- Added an event for when a falling block starts falling (thanks @DelayedGaming)
- Added support for serial (Oxford) commas in lists (thanks @Mr-Darth)
- Added support for the inventory drag event (closes #3744)
- Added support for using formatting in the book pages syntax
- Added InventoryDragEvent (closes #3744)
Tweaks and Removals
- Countless internal optimizations and improvements
- Many minor syntax tweaks
- Updated the random vector expression to return positive and negative components (closes #3135)
- Removed support for WorldGuard 6
- Fixed and improved some errors and exceptions (closes #4234)
- Enhanced support for obtaining the target location of additional mobs
- Scripts in subdirectories will now load before those in the main directory (closes #466)
- The date formatting expression now supports the usage of variables in custom formats
- Significantly improved asynchronous script loading
- Significantly improved the tab completion of the
/skript
command (specifically for enabling/reloading/disabling scripts) (closes #4666) - Enhanced the "command already defined" error message to include the source of the error (closes #1329)
- Improved modification of the spawn point (greater accuracy) (closes #4955)
- Events listeners will now be unregistered when the last occurence of that event is removed from loaded scripts (closes #5141)
- Renamed the
subtext
expression tosubstring
(thanks @Kanvi1) (closes #5196) - Removed the operator entity data (syntax was added to replace this)
- Completely rewrote the default example scripts to better represent best practices of Skript (closes #2252)
- Reworked the event values for the edit book event (now includes a future event value)
- Completely rewrote the Comparator system (closes #4928)
- Completely rewrote the Converter system (closes #1747, #5045, #5302)
- Improved parsing speeds, especially for larger scripts (closes #1117, #1783, #4905)
- Optimized and reworked list parsing (closes #4025, #5122, #5243)
- Overhauled the quality of code in the variables package (closes #5398)
- Removed the expression for obtaining the numerical ID of an item
- The durability expression no longer functions the same as damage (now, as damage increases, durability decreases) (closes #4692)
- Rewrote internal math functions to improve their performance (thanks @kiip1)
- Improved the error message for when a left click event on an entity is used (thanks @oskarkk)
- Improved the performance of aliases (thanks @bluelhf)
- Prevents Skript from enabling Timings support for Paper versions 1.19.4 or greater (closes #5726)
Bug Fixes
- Fixed an issue where variables are loaded after Skript loads which breaks the usage of variables in
on skript start
(closes #5882) - Fixed an issue where some syntax could be used in unintended events causing an exception (closes #4872)
- Fixed an issue where the same error may be printed multiple times for incorrect function definitions (closes #4771)
- Fixed an issue with function return values failed to properly convert to the expected type (closes #4524)
- Fixed an issue where plural arguments could be passed in singular function parameters (closes #4859)
- Fixed an exception that could occur when formatting a date
- Fixed an exception that could occur if a location did not contain a world for the teleport effect
- Fixed an exception that could occur when spawning a falling block without specifying the type (closes #5042)
- Fixed an issue that could occur where some events would not register if related events were already registered (thanks @TFSMads) (closes #4705)
- Fixed an issue where options did not work in function declarations (closes #2492)
- Addressed mutliple exceptions that could occur when using parallel (multithreaded) script loading (closes #4579)
Please understand that for the moment, parallel loading is not performed for most script loading, and therefore will have little effect. Significant improvements are expected for the future.
- Fixed numerous issues that could occur when trying to reload script files using different cases on operating systems where file names are case insensitive (e.g. Windows) (closes #4459)
- Fixed an issue where adding aliases to commands would not properly sync with clients (meaning it appeared as if the alias was not registered in game) (closes #4307)
- Fixed an issue where function (re)loading would often incorrectly error if asynchrounous script reloading is enabled (closes #4246)
- Fixed an issue where an exception could occur when disabling a script that disables another one (using
on stop
) (closes #4916) - Fixed an issue where the replace syntax would erroneously modify all used variables (closes #5232)
- Fixed an issue where
target falling block
did not work (closes #5223) - Fixed an issue where block data could not be compared (closes #5251)
- Fixed an issue where the parse expression would have the incorrect return type when used with a pattern (closes #5274)
- Fixed an exception that could occur when setting the time of a SimpleExpression and providing a null default expression
Note that a SkriptAPIException will now occur instead as this in incorrect API usage.
- Improved rounding accuracy (closes #4235)
- Fixed an issue where the event values for the block spread event returned the same value (thanks @ShaneBeee)
- Fixed a few cases where some syntax could be used in unintended events
- Fixed an issue where obtaining a random element out of a list of literals would only randomize during parse time (rather than during runtime) (closes #5345)
- Fixed an issue where ghost items may remain in the inventory after cancelling an inventory interaction event (closes #5342)
- Fixed a few issues with integer division and multiplication (closes #4445)
- Fixed an issue where some expressions could erroneously modify the values of another (closes #5322)
- Fixed an issue where the uncolored expression failed to handle nested tags (closes #5224)
- Fixed an issue where goat horn variants did not work (closes #4882)
- Fixed an issue where negated conditions could erroneously fail on lists
- Fixed several issues with default variables, including them not working for any expression type that wasn't an object (closes #2174, #4567)
- Fixed an issue where the drop syntax would overwrite the experience amount for merged experience orbs (closes #5490)
- Fixed an exception that occured when getting a random number between two numbers that only differ by decimal
- Fixed several bugs that could occur when using the
all blocks
syntax (closes #5565) - Fixed an issue where random vectors were not unit and not true random generations (thanks @DelayedGaming)
- Fixed an issue where deleting the target of a player would not function as expected (closes #4221)
- Fixed an issue where the falling block land event was also called when a block started falling (thanks @DelayedGaming)
- Fixed an issue where the color of some messages (e.g. warnings, errors) was missing
- Fixed an exception that could occur when attempting to serialize a location with an unloaded world
- Fixed an issue where entity data was not properly applied before running the spawn effect section (closes #5711)
- Fixed many issues where comparisons could fail when using literals that match multiple types (closes #2711, #4773, #5497, #5556, #5675)
- Fixed an exception that could occur when using an invalid message for the action bar syntax (closes #5776)
- Fixed an exception that could occur when executing certain syntax in asynchronous events (closes #5689)
- Fixed an issue where book pages can't be set (closes #5709)
- Fixed
target of
expression throwing an exception in some cases when deleting an entity (closes #5761) - Fixed an issue with
all blocks
expression throwing an exception when used with directions only (closes #5787) - Fixed an issue with ExprRawString using a Java 9 feature instead of Java 8 (closes #5794)
- Fixed an issue where an exception is thrown when using
stop all sounds
effect (closes #5756) - Fixed an issue where chained multiline else-ifs errors when first if is not multiline (closes #5866)
- Fixed an issue where you can't enchant multiple players tools (closes #5530)
API Changes
- We want to bring attention to the usage of ParserInstance#isCurrentEvent. When using this method to restrict your syntax to a specific event during init, you should also be performing a runtime instanceof check on the Event object. For further details, review PR #4884.
- Parse tags can now also be expanded onto optional pattern elements. That is,
:[abc|def]
is now equivalent to[:abc|:def]
(this was already the case for:(abc|def)
and(:abc|:def)
) - Added a utility class for easily creating Enum-based ClassInfos (see #5129)
- Added a utility method or deleting a variable in the Variables class (see #5217)
- Added support for registering plural event values (see #5168)
- The Comparator system has been completely rewritten. Please review the javadoc as many classes and methods have been deprecated. These will continue to function for now
- The Converter system has been completely rewritten. Please review the javadoc as many classes and methods have been deprecated. These will continue to function for now
- SelfRegisteringSkriptEvent has been deprecated (see #5140)
- Added support for registering a property expression with default expressions (see #5272)
- The
final
modifier on PropertyExpression has been removed, allowing them to return multiple items per element if overriden (see #5455) (closes #5521) - Added support for registering custom VariableStorage implementations (see #4873)
Credit to the team on this release: @APickledWalrus @TheLimeGlass @TPGamesNL @AyhamAl-Ali @sovdeeth @Pikachu920 @UnderscoreTud @Moderocky
📝 Help Us Test
We have an official Discord community for beta testing Skript's new features and releases.
⭐️ Thank You
We saw a large increase in new contributors recently, and we just wanted to thank all who have contributed to this version of Skript. Lots of issues and suggestions arise and we could not have made it here without the help of the community.
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.