#check if the block has a tag

14 messages · Page 1 of 1 (latest)

glad plover
#

I tried like this and it didn't work and it didn't return any errors

onEvent('block.place', event => {
    if ('#degerado:building_blocks' in event.block.tags) {
        event.cancel();
    }
})
naive templeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

real crown
#
onEvent('block.place', event => {
    if (event.block.hasTag('degerado:building_blocks')) event.cancel()
})
glad plover
#

dont woerk too

real crown
#

did you fix the typo with the bracket

glad plover
#

yes

real crown
#

then the block probably doesnt have the tag

glad plover
#

it have

coarse jewel
#

depends on if that's a block tag or an item tag

real crown
coarse jewel
#

you'd have to do event.block.item.hasTag()

real crown
#

or if put the tag on manually, put it on the block (too)

glad plover
#

ok

glad plover
#

work, tnks