#how to make a "RightClickEmpty" event

9 messages · Page 1 of 1 (latest)

warm leaf
#

Where is the best place to create a mixin to make an event triggered by a right-click over the air?

# Personally, I've tried catching every tick and checking if the right mouse button is pressed and if the player is looking at the block. But as far as I'm concerned, it's a crutch that definitely has a better alternative.

floral valve
#

FAPI UseItemCallback

#

Keep in mind that thats ran on both client & server

warm leaf
floral valve
#

What prevents it from reaching the server is a failing actionresult which you can manipulate on the client

warm leaf
#

Of course you are. I only need such an event on the client anyway.

warm leaf
warm leaf
#

Solved. I throw the mixin into MinecraftClient.handleInputEvents and make the following check this.options.useKey.isPressed() && this.crosshairTarget != null && this.crosshairTarget.getType().equals(HitResult.Type.MISS)