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

Scripting event "minecraft:player_destroyed_block" does not fire in creative mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.13.3, 1.13.1, 1.13.0.6 Beta, 1.13.0.5 Beta, 1.12.0.3 Beta, 1.12.0.4 Beta, 1.13.0.4 Beta, 1.13.0.2 Beta, 1.12.0, 1.14.1.2 Beta, 1.14.0
    • Creative
    • Unconfirmed
    • Windows

      The "minecraft:player_destroyed_block" fires only whenever a player breaks a block in survival mode. This should also fire when a player breaks a block in creative mode.

      What was expected to happen:
      The event should have fired normally even if the player who destroyed the block was in creative mode

      What happens:
      The event doesn't get fired for players breaking blocks in creative mode

      Steps to Reproduce:

      1. Get the behavior pack attached or use the following script:

      const system = server.registerSystem(0, 0);
      
      system.initialize = function() {
          system.listenForEvent("minecraft:player_destroyed_block", (eventData) => breakBlock(eventData))
      }
      
      function breakBlock(eventData) {
          let chatEventData = system.createEventData("minecraft:display_chat_event");
          chatEventData.data.message = "Player destroyed block!";
          system.broadcastEvent("minecraft:display_chat_event", chatEventData)
      }
      

      2. Enter a world with the aforementioned script (don't forget to enable Experimental Gameplay!)
      3. Break a block in survival and later in creative
      4. A chat message will get sent if we are in survival mode. This is however not the case if we are in creative mode.

            _Wither31_ Wither
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: