Mojira Archive
MCPE-189404

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

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

Unresolved

kostamax27

2024-12-23, 05:30 PM

2024-12-29, 11:48 AM

1

2

Unconfirmed

1.21.51 Hotfix

-