#event not cancel event

1 messages · Page 1 of 1 (latest)

scenic prawn
#

wrap sendMessage with system.run()

#
world.beforeEvents.playerInteractWithBlock.subscribe(({ player, block, cancel }) => {
  if (restrictedBlocks.includes(block.type.id) && !player.hasTag("admin")) {
    cancel = true;
    system.run(() => {
    player.sendMessage("§cYou do not have permission to use this.");
    });
  }
});
frank sparrow
#

still not canceling

scenic prawn
#

odd

marsh cloud
#

destructuring is not valid here

#
world.beforeEvents.playerInteractWithBlock.subscribe(event) => {
  event.cancel = true;
});
scenic prawn
#

oh ye that could be the case