Mojira Archive
MCPE-189484

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

Duplicate

kostamax27

2024-12-28, 10:57 AM

2024-12-28, 11:16 AM

2024-12-28, 11:16 AM

0

0

Unconfirmed

1.21.51 Hotfix

-