Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-185180

Some animations still play with canceled playerInteractWithBlock events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.30.22 Preview, 1.21.2 Hotfix
    • None
    • Community Consensus
    • Multiple

      If an add-on sets event.cancel to true of a playerInteractWithBlock event, and the block interacted with is a door, the door will still open for a split second on the client, allowing them to glitch through to the other side. Other players still see a closed door.

      EDIT: I have renamed the bug because I suspect that this is related due to the animation controllers still being triggered, and some other blocks still play their animations. I have attached a video of my character interacting with a bunch of blocks with the example add-on enabled, and while nothing else happens, they still have their animations triggered. Since the door's animation includes a change in the hitbox, the door's animation also causes you to be able to glitch through.

      Expected Result:

      No animation plays on the block.

      Doors stay closed for both client and server and player cant pass through if the playerIneractWithBlock event is canceled.

      Observed Result:

      Some blocks have their animations played.

      Doors stay closed on server but open momentarily on client, allowing client to pass through.

      Steps to Reproduce:

      1. Open a new world.
      2. Place blocks.
      3. Add to that world an add-on that cancels playerInteractWithBlock Before Event signals, like this (attached is an add-on that does this):
      main.js:

      import * as server from '@minecraft/server'
      server.world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
          event.cancel = true;
      });
      

      4. Interact with the blocks you placed down.

        1. MCPE-185180 Example.mcaddon
          47 kB
          BattyBest
        2. output.mp4
          5.36 MB
          BattyBest

            BattyBest BattyBest
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: