mojira.dev
MCPE-176244

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

[media]

Attachments

Comments 2

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach an example addon showcasing the issue?

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Cycro2636

(Unassigned)

Unconfirmed

Windows

Windows 10

1.20.50.21 Preview

Retrieved