#Why do my itemStack setCanDestroy don't work ?

1 messages · Page 1 of 1 (latest)

earnest hatch
#

Why do my itemStack setCanDestroy don't work ?

#

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
wintry cloak
#

what's the error in the content log

earnest hatch
#

nothing

#

it just don't work

green jackal
#

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"
])
earnest hatch
#

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"
]
spice osprey
earnest hatch
#

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

spice osprey
#

they should be block identifiers

#

seeds are not blocks

earnest hatch