CraftTweaker

CraftTweaker

151M Downloads

Arrays / Loops not working ?

Thyriel opened this issue ยท 1 comments

commented

[1.12.2]
Somehow a string array doesn't work. This is my testscript:
`val TableArray = ["Hello","World"];

for itable in TableArray {
print(itable);
}`

Logfile errors: https://pastebin.com/5DebbmdZ
Bad type on operand stack - Type 'stanhebben/zenscript/value/IAny' (current frame, stack[3]) is not assignable to 'java/lang/String'

edit: Just tested with integer > similar error

And with your example script from "Arrays and Loops" it's the same with minecraft items:
`val IArray = [<minecraft:dirt>,<minecraft:planks>,<minecraft:diamond>];

for item in IArray {
recipes.remove(item);
}`
Error log: https://pastebin.com/K1Ach5WL

commented

I NEED your scripts in a pastebin or gist, if they aren't there, I can't see line numbers, so it makes it really difficult to help.

Also please follow the template, it is there for a reason.