beforeOnPlayerPlace custom component doesn't fire if "replace_block_item" is true
The new stable release brings the "replace_block_item" option to "minecraft:block_placer" but it still doens't fix the following bug:
-When "replace_block_item" is set to true and the block has "beforeOnPlayerPlace" as a custom component event, it doesn't fire the event.
Steps to Reproduce:
Install the addon attached in this report. The addon has 2 blocks and 2 items, one item ("working_double_block") has "replace_block_item" set to true and the other one ("not_working_double_block") has "replace_block_item" set to false. Both blocks also have the same custom component that has "beforeOnPlayerPlace".
Observed Results:
When the "not_working_double_block" custom block is placed, the "beforeOnPlayerPlace" event is not fired unlike the other custom block "working_double_block".
Expected Results:
Both custom blocks should fire the "beforeOnPlayerPlace" event.
Linked Issues
Created Issue:
beforeOnPlayerPlace custom component doesn't fire if "replace_block_item" is true
The new stable release brings the "replace_block_item" option to "minecraft:block_placer" but it still doens't fix the following bug:
-When "replace_block_item" is set to true and the block has "beforeOnPlayerPlace" as a custom component event, it doesn't fire the event.
The new stable release brings the "replace_block_item" option to "minecraft:block_placer" but it still doens't fix the following bug:
-When "replace_block_item" is set to true and the block has "beforeOnPlayerPlace" as a custom component event, it doesn't fire the event.Steps to Reproduce:
Install the addon attached in this report. The addon has 2 blocks and 2 items, one item ("working_double_block") has "replace_block_item" set to true and the other one ("not_working_double_block") has "replace_block_item" set to false. Both blocks also have the same custom component that has "beforeOnPlayerPlace".Observed Results:
When the "not_working_double_block" custom block is placed, the "beforeOnPlayerPlace" event is not fired unlike the other custom block "working_double_block".Expected Results:
Both custom blocks should fire the "beforeOnPlayerPlace" event.
is duplicated by
Thank you for your report!
We're tracking this issue in MCPE-187726, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Please attach a BP that demonstrates this issue.
We do not have enough information to reproduce this issue.
Please include the following information to help us understand your problem:
Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
For now there is a workaround
you can add a custom component to the item with the onUseOn event
(you would have to get the block using a method like this however)
onUseOn: e => { const block = e.blockFace == 'North' ? e.block.north(1) : e.blockFace == 'East' ? e.block.east(1) : e.blockFace == 'South' ? e.block.south(1) : e.blockFace == 'West' ? e.block.west(1) : e.blockFace == 'Up' ? e.block.above(1) : e.block.below(1) }Note that this event triggers after the block is placed, but before the itemStack is updated