#Any one know why this is happening

1 messages · Page 1 of 1 (latest)

misty berry
#
world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
    let { block,player } = event
    let { location } = block 
    let { x, y, z } = location
    if ( x === 9993 && y === 100 && z === 9993 && 
        block.typeId === "minecraft:barrel" &&
        player.hasTag(player.name, "vaulttp")) {
            
        event.cancel();
        system.run(() => {
            plots(player);
        });
    }
});```
limpid lily
#
world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
    let { block,player } = event
    let { location } = block 
    let { x, y, z } = location
    if ( x === 9993 && y === 100 && z === 9993 && 
        block.typeId === "minecraft:barrel" &&
        player.hasTag("vaulttp")) {
            
        event.cancel();
        system.run(() => {
            plots(player);
        });
    }
});```
valid slate
#

hasTag method takes only the tag you're looking for. The player name/id/etc. is given by the Player Object/Class.

misty berry
coral goblet
#

event.cancel = true

flat beacon
# coral goblet event.cancel = true

they should really just make it event.cancel() though right?? because if u dont want to cancel it whats the point in adding event.cancel = false