ContentTweaker

ContentTweaker

27M Downloads

Bad local variable type with IItemOnUse

QuantumBlink1337 opened this issue ยท 3 comments

commented

Hello, I'm currently working on a script to allow for a custom item to be clicked on a custom block, and to randomly give a new item to them.

However, I'm experiencing a bad local variable type error, around line 126 (I think).

https://gist.github.com/QuantumBlink1337/b9f7b896426a48b1b4d49c8b90283808

Here's my crafttweaker log: https://gist.github.com/QuantumBlink1337/d8ca079c3c8a72d83b301a67bd308694

Thank you for any assistance!

commented

https://gist.github.com/QuantumBlink1337/b9f7b896426a48b1b4d49c8b90283808#file-contenttweaker-master-zs-L139
Items don't exist at that point, check for item.definition.id == "contenttweaker:hard_drive"

You also have some errors in other files. I'm not sure what particularly is causing the "bad local variable type," but it could very well be caused by the above error

commented

I switched the check out, but now I'm getting an error with item, plus the bad local type never went away.

commented

because the item in my example was a placeholder for the player's item, whatever you need to check

and if the bad local type is indeed caused by an error in the function, then it would still happen because you have a new error