#Why do my itemStack setCanDestroy don't work ?
1 messages · Page 1 of 1 (latest)
hooo we can't do this that way
but i don't resolve my setCanDestroy problem
const specialHoe = new ItemStack("minecraft:wooden_hoe")
specialHoe.setCanDestroy = [
"wheat_seeds",
"carrot",
"potato",
"beetroot_seeds",
"melon_seeds",
"sweet_berries",
"torchflower_seeds",
"pitcher_pod"
]
specialHoe.keepOnDeath = true
specialHoe.lockMode = "inventory"
specialHoe.nameTag = "§r§bSpecial Hoe Of The Garden"
specialHoe.amount = 1
what's the error in the content log
hello, the first setCanDestroy you provided was correct but you changed it in the 2nd one, this should work:
const specialHoe = new ItemStack('minecraft:wooden_hoe', 1) // You can put amount in here instead of using specialHoe.amount -- Not necessary ;)
specialHoe.nameTag = "§r§bSpecial Hoe Of The Garden"
specialHoe.lockMode = "inventory"
specialHoe.keepOnDeath = true
specialHoe.setCanDestroy([ // setCanDestroy(string[])
"wheat_seeds",
"carrot",
"potato",
"beetroot_seeds",
"melon_seeds",
"sweet_berries",
"torchflower_seeds",
"pitcher_pod"
])
it dosn't work :')
i think i did it right
const specialHoe = new ItemStack("minecraft:wooden_hoe", 1)
specialHoe.keepOnDeath = true
specialHoe.lockMode = "inventory"
specialHoe.nameTag = "§r§bSpecial Hoe Of The Garden"
specialHoe.setCanDestroy = [
"wheat_seeds",
"carrot",
"potato",
"beetroot_seeds",
"melon_seeds",
"sweet_berries",
"torchflower_seeds",
"pitcher_pod"
]
but
setCanDestroy is a function
specialHoe.setCanDestroy([
"wheat_seeds",
"carrot",
"potato",
"beetroot_seeds",
"melon_seeds",
"sweet_berries",
"torchflower_seeds",
"pitcher_pod"
])
i didn't see that thanks :')
i got this error
[Scripting][error]-Error: Function setCanDestroy failed. Invalid block identifier provided. at <anonymous> (default_tools.js:21)
at forEach (native)
at <anonymous> (default_tools.js:37)
i verified all my items and they're right
thx