Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-189404

Cancel "world.beforeEvents.itemUse" does not prevent player boost when using firework

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.51 Hotfix
    • None
    • Unconfirmed
    • Multiple

      Using ScriptAPI, attempting to prohibit the use of "minecraft:firework_rocket", the number of fireworks does not change and the player flies further

       

      code:

      import { world } from "@minecraft/server";
      
      world.beforeEvents.itemUse.subscribe((data) => {
          if(data.itemStack.typeId === "minecraft:firework_rocket"){
              data.cancel = true;
          }
      }); 

      //Event is canceled and the fireworks are not used, but the boost is still there

            kostamax27 kostamax27
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: