mojira.dev
MCPE-225746

Adding a custom component with the "onPlayerInteract" event hook to specific block permutations enables block interaction for all permutations

Custom blocks should only be able to be interacted with when a custom component with the “onPlayerInteract“ hook is applied. This means that if the component is applied to specific permutations (making use of the block JSON permutations array) the block should only become interactable when in those permutations.

Steps to reproduce:

  • Apply the attached add-on to a world

  • Place the custom crop block on Farmland using the “Custom Seeds“ item in the creative menu

  • Grow the crop fully by interacting with the block using Bone Meal

Observed results:

  • The crop can still be interacted with when fully grown, despite the custom component not being active.

Expected results:

  • The crop should only be able to be interacted with when not fully grow (when the custom component allowing for Bone Meal interaction is active).

Attachments

Comments 1

Additional Information: The issue appears to be client-side only, as placing a block against the interactable block without sneaking when its an interactable permutation fails, but placing a block against the interactable block without sneaking when its a non-interactable permutation works fine.

QuazChick

(Unassigned)

Unconfirmed

Multiple

26.0.25 Preview, 1.21.130, 1.21.110.24 Preview, 1.21.110.22 Preview, 1.21.94 Hotfix, 1.21.100, 1.21.101 Hotfix

Retrieved