Skript/Server Version
[17:20:37 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:20:37 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:20:37 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:20:37 INFO]: [Skript] Server Version: 1.21.11-111-302c47c (MC: 1.21.11)
[17:20:37 INFO]: [Skript] Skript Version: 2.14.1 (skriptlang-github)
[17:20:37 INFO]: [Skript] Installed Skript Addons:
[17:20:37 INFO]: [Skript] - skript-yaml v1.7.2
[17:20:37 INFO]: [Skript] - skript-reflect v2.6.2 (https://github.com/SkriptLang/skript-reflect)
[17:20:37 INFO]: [Skript] - SkBee v3.17.1 (https://github.com/ShaneBeee/SkBee)
[17:20:37 INFO]: [Skript] - SkBriggy v1.5.8 (https://github.com/ShaneBeee/SkBriggy)
[17:20:37 INFO]: [Skript] Installed dependencies:
[17:20:37 INFO]: [Skript] - Vault v1.7.3-b131
[17:20:37 INFO]: [Skript] - WorldGuard v7.0.15+2347-5fafea6
Bug Description
Functions that do not have a return type (whether or not they return any value in the function's code is irrelevant) cause an exception when used specifically in a command structure and in itemstack-related effects such as give (%players% %itemtypes%|%itemtypes% to %players%).
Expected Behavior
The function should return a null value that Skript ignores, and the command should be registered as normal.
Steps to Reproduce
Put the following script in a file and reload it:
# Compiles without Skript errors, but errors in console and does not allow the command to be registered.
function foo():
set {_} to "something"
# Compiles and allows the command to be registered, even though it does not return anything.
function foo2() :: item:
set {_} to "something"
command /bar:
trigger:
# Causes the command to not register
give player foo()
set slot 0 of player to foo()
# Command registers just fine.
send foo()
teleport player to foo()
# Registers function and is executable via effect commands. Gives the player cobblestone since foo() does not return anything.
function bar(p: player):
give {_p} (foo() ? cobblestone)
Testing Procedure:
- Notice that the
/bar command is not registered.
- Comment out lines 12 and 13. Reload the script and observe that the command now registers.
- Un-comment lines 12 and 13, but replace all instances of
foo() in the command to foo2(). Reload the script and observe that the command now registers.
- Run the effect command
!bar(me). Observe how the function is registered, and the player receives a single cobblestone item. This is despite bar() utilizing the foo() function that would otherwise break a command structure.
Errors or Screenshots
https://gist.github.com/2clist/18a2e7d114a7ff03111644e6b1c4f856
Other
No response
Agreement
Skript/Server Version
Bug Description
Functions that do not have a return type (whether or not they return any value in the function's code is irrelevant) cause an exception when used specifically in a command structure and in itemstack-related effects such as
give (%players% %itemtypes%|%itemtypes% to %players%).Expected Behavior
The function should return a null value that Skript ignores, and the command should be registered as normal.
Steps to Reproduce
Put the following script in a file and reload it:
Testing Procedure:
/barcommand is not registered.foo()in the command tofoo2(). Reload the script and observe that the command now registers.!bar(me). Observe how the function is registered, and the player receives a single cobblestone item. This is despitebar()utilizing thefoo()function that would otherwise break a command structure.Errors or Screenshots
https://gist.github.com/2clist/18a2e7d114a7ff03111644e6b1c4f856
Other
No response
Agreement