-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Returning Items from a Function #1747
Comments
Your description was wrong, it is not related to multiple items, but can confirm the same with 1.13.2 # {x} = 2
# {y} = diamond
function test() :: item:
broadcast "&62 diamonds"
broadcast "&6%class of 2 diamond%" # skript-mirror addon
return 2 of diamond
function test1() :: item:
broadcast "&a%{x} of {y}%"
broadcast "&a%class of {x} of {y}%"
return {x} of {y}
function test2() :: item:
broadcast "&c%2 of {y}%"
broadcast "&c%class of 2 of {y}%"
return 2 of {y}
function test3() :: item:
broadcast "&b%{x} of diamond%"
broadcast "&b%class of {x} of diamond%"
return {x} of diamond First of all, shouldn't the X Of expression return item type instead of item stack? I see that it takes return type of the input expression, but it uses And these functions will work when you make the return type multiple (items) because Not sure about why |
Really good investigation @Blueyescat , weird bug for sure |
Huh, this one was hard to track down. In the end, it turned out this was caused by two completely different bugs. |
This override was added many years ago to fix an issue (SkriptLang#1747) with the expression that occurred when using variables. This was because Skript could not properly convert variables during parse time. The proper fixes have been made with this branch and so this method is no longer needed. I've updated the test to include code from the original issue.
Description
Functions that return multiple items (e.g. 2 diamonds) in reality return
<none>
Steps to Reproduce
Expected Behavior
The player should receive 6 diamonds
Errors / Screenshots
Note: After executing /testfunction, the player only recieves 3 diamonds (from test2())
Server Information
Additional Context
This issue didn't occur in Skript 2.2-dev37c, and only occurred when I updated the version of Skript (2.3-beta4)
The text was updated successfully, but these errors were encountered: