event playerInteractWithBlock being emitted more than once
When the event playerInteractWithBlock is emitted, it emits more than once for only one subscription
I wrote the following code
import {world} from "@minecraft/server";
let i = 0;
world.afterEvents.playerInteractWithBlock.subscribe(ev=>{
world.sendMessage(`Hello ${i++}`);
});
When triggering the event, it emits about 4~5 times in a row(i had causes that it emitted 10 times in a row), which causes unexpected behavior and possibly lag. I don't understand exactly what happens cause when I have a holdeable item in hand it emits once, but if not, on average, it emits 4 times

2023-10-21, 06:11 PM
2024-01-24, 01:54 PM
2024-01-24, 01:54 PM
0
0
-