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

Scripting event "minecraft:player_destroyed_block" only fires on certain blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.12.0.3 Beta
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed
    • Platform:
      Windows 10 - PC

      Description

      The event "minecraft:player_destroyed_block" only works on certain blocks. So far it's been narrowed down to blocks that you destroy with their right tool - including everything that can be broken with your hand while still giving loot.

       

      What I expected to happen:

      The event fires on every block the player has destroyed.

       

      What actually happened:

      The event fires on certain blocks that match the requirements mentioned above.

       

      Steps to reproduce:
      1. Join a world that has the following server script enabled:

      const system = server.registerSystem(0, 0);
      
      system.initialize = function() {
      	this.listenForEvent("minecraft:player_destroyed_block", eventData => this.onPlayerDestroyedBlock(eventData));
      }
      
      system.onPlayerDestroyedBlock = function(eventData) {
      	let data = this.createEventData("minecraft:display_chat_event");
      	data.data.message = "Block destroyed";
      	this.broadcastEvent("minecraft:display_chat_event", data);
      }
      

      2. Destroy a block in survival mode.
      3. If you destroy the block with the right tool, a chat message should appear. If you do not destroy the block with the right tool (ex: destroy stone with your hand), a chat message will not appear.

        Attachments

          Activity

            People

            • Reporter:
              PandaCane Bram Weessies
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: