Custom blocks with custom components are always interactable
Applying script-registered block custom components to a block results in that block becoming interactable, even when the onPlayerInteract event listener is not active.
This makes placing blocks on the custom block a worse experience and means that many items, such as projectiles, are impossible to throw when looking at a custom block.
The original "fix" for this issue was for the block the player is holding to be placed when the custom block is interacted with, however this creates more issues than it solves, with a delay between block placements and signs being placed with no edit text screen.
Steps to reproduce:
- Import the provided example pack and apply it to a world
- Join the world and place the custom block (which can be found at the end of the Construction category in the creative menu)
- Right-click on the custom block to attempt to interact with it
Observed results:
- The player's arm swings, indicating that the block has been interacted with
- It is impossible to place several blocks in a line quickly by holding down the place button
- Some blocks, such as signs, are placed without certain functionality
Expected results:
- The block should not be interactable as the onPlayerInteract event listener is absent, meaning the player's arm will not swing
- When placing other blocks on the custom block, default block placement functionality should be used, allowing for fast building by holding down the place button
Linked Issues
- Unresolved
QuazChick- 20
- 7
- Confirmed
- 1304425
- Multiple
1.21.60.21 Preview - 1.21.60
1.21.60.21 Preview 1.21.50.20 Preview 1.21.40.25 Preview 1.21.40.22 Preview 1.21.40.21 Preview 1.21.22 Hotfix 1.21.23 Hotfix 1.21.30 1.21.40.23 Preview 1.21.31 Hotfix 1.21.50.28 Preview 1.21.44 Hotfix 1.21.50 1.21.60.25 Preview 1.21.60.24 Preview 1.21.60.28 Preview 1.21.70.22 Preview 1.21.70.20 Preview 1.21.51 Hotfix 1.21.60
Created Issue:
Custom blocks with custom components are always interactable
Applying script-registered block custom components to a block results in that block becoming interactable, even when the onPlayerInteract event listener is not active.
This makes placing blocks on the custom block a worse experience and means that many items, such as projectiles, are impossible to throw when looking at a custom block.The original "fix" for this issue was for the block the player is holding to be placed when the custom block is interacted with, however this creates more issues than it solves, with a delay between block placements and signs being placed with no edit text screen.
Steps to reproduce:
- Import the provided example pack and apply it to a world
- Join the world and place the custom block (which can be found at the end of the Construction category in the creative menu)
- Right-click on the custom block to attempt to interact with it
Observed results:
- The player's arm swings, indicating that the block has been interacted with
- It is impossible to place several blocks in a line quickly by holding down the place button
- Some blocks, such as signs, are placed without certain functionality
Expected results:
- The block should not be interactable as the onPlayerInteract event listener is absent, meaning the player's arm will not swing
- When placing other blocks on the custom block, default block placement functionality should be used, allowing for fast building by holding down the place button
relates to
I'm having a problem with creating a strippable log interaction. I only want the interaction to work when holding an axe, while still allowing block placement. To solve this and ensure blocks remain interactable by default, a good approach is adding a beforeOnPlayerInteract event with an interaction toggle. For example:
event.interact = true;By default, interact would be set to false, and creators could enable it in the beforeEvent based on certain conditions. Then, the interaction itself could be managed via the afterEvent (i.e., onPlayerInteract), which would only trigger if interaction was allowed through the beforeEvent.
It is an annoying bug. If i make a whole house of furniture I can't eat anymore in my house.
Can confirm, this is most likely a regression of the fix applied for
MCPE-179928I'm having a problem with creating a strippable log interaction. I only want the interaction to work when holding an axe, while still allowing block placement. To solve this and ensure blocks remain interactable by default, a good approach is adding a beforeOnPlayerInteract event with an interaction toggle. For example:
By default, interact would be set to false, and creators could enable it in the beforeEvent based on certain conditions. Then, the interaction itself could be managed via the onPlayerInteract afterEvent, which would only trigger if interaction was allowed through the beforeEvent.
I hope this bug takes priority. It almost makes using custom components unusable for gameplay, because ItemUse and ItemUseOn World AfterEvents also do not work.
Also in gameplay scenario's where a survival house is decorated by multiple blocks with custom components, it makes eating food impossible unless I find a specific block that doesn't trigger the sway animation.