ActionResult.CONSUME unexpected behavior #2131
-
I'm registering a listener to UseBlockCallback.EVENT. I'm porting from Forge, and on Forge setting the event interaction result to CONSUME would do exactly what I needed to, but on Fabric it doesn't seem to be the case. And it doesn't seem to be the case with any other ActionResult. Is this a Fabric bug? Or should I do something different? Code of the listener:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
According to the javadoc, that event doesn't support CONSUME, only SUCCESS, PASS, FAIL From the mixin you can see it will stop event handling if you return CONSUME but won't send a packet to the server which it does only for SUCCESS. I would suggest you either submit a patch to make the event support CONSUME or write your own event/mixin that has the behaviour you want. |
Beta Was this translation helpful? Give feedback.
-
Solved it, I return |
Beta Was this translation helpful? Give feedback.
Solved it, I return
SUCCESS
instead of consume and instead of checkinginteractionHand != null
I dogetInteractionHand(player) == hand
. This because I saw that the event is triggered 1 time per hand everytime, so I just had to wait for the correct hand.