mojira.dev
MCPE-182172

Event playerInteractWithBlock called multiple times

Following on from MCPE-176244 I am experiencing a similar issue.

The event playerInteractWithBlock is called multiple times when a player interacts with a block. This applies to both world's BeforeEvents and AfterEvents.

I have used this script to show the problem:

 

import { world, system, BlockPermutation } from "@minecraft/server";
let i = 0;
world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
    world.sendMessage("Before Event " + (i++));
});
world.afterEvents.playerInteractWithBlock.subscribe((event) => {
    world.sendMessage("After Event " + (i++));
});

 

Steps to Recreate

  1. Create a world with the attached Behavior Pack and Beta APIs enabled.

  2. Interact with any block.

  3. The Before Event message appears a few times (between 3-7)

    • Not as expected - expectation is this message appears only once.

  4. The After Event message appears a few times (between 3-7)

    • Not as expected - expectation is this message appears only once.

  5. Point at at any block and hold down the interact button - I was using the right-mouse button to observe this.

  6. The Before and After Event messages appear multiple times, in batches of 3 or 4 each. They do not stop until the button is released.

    • Not as expected - expectation is one Before message followed by one After message, and no more.

  7. Place an object that has an interaction, for example a Door.

  8. Interact with the object.

  9. One Before message appears, followed by one After message.

    • Working as expected.

 

Attachments

Comments 3

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryFeature Requests and Suggestions

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Quaival

(Unassigned)

1246351

Confirmed

Multiple

Windows 10

Script-API

1.21.10.21 Preview

Retrieved