mojira.dev
MCPE-189942

onUseOn in scripts:initEvent.itemComponentRegistry.registerCustomComponent doesn't work correctly

Custom component connection scripts can be buggy. The code section is visible in the diagram. As a matter of common sense, both onUseOn and onUse should be between the before and after events in the registered component. But in reality, after clicking the right mouse button once, before, onUse, and after appear, and onUseOn does not appear. When you right-click twice in a row, the first time you will have the effect of the first time, and the second time you will have beforeOnUseOn, onUseOn, and afterUseOn. In my understanding, it should be possible to determine the type of block and item first, that is, the role of the filter, and then the corresponding animation can be applied if it is not filtered, and onUseOn should not appear on the second (continuous) mouse click, but should be judged on the first mouse click.

Attachments

Comments 1

The actual order is: beforeUseOn, beforeUse, onUse, onUseOn, afterUseOn, afterUseOn
The expected order is: beforeUseOn, beforeUse, onUse, afterUseOn, onUseOn, afterUse
The item component "minecraft:usemodify" can affect the above events, and when enabled, onUseOn will be interrupted

FalsonAuYeung

(Unassigned)

Unconfirmed

Windows

windows11

1.21.51 Hotfix

Retrieved