Scripting event "minecraft:player_destroyed_block" only fires on certain blocks
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.
2019-05-01, 10:41 PM
2020-04-17, 07:16 PM
2020-04-17, 07:16 PM
0
0
-