Class PlayerInteractEvent.RightClickBlock

Enclosing class:

public static class PlayerInteractEvent.RightClickBlock extends PlayerInteractEvent
This event is fired on both sides whenever the player right clicks while targeting a block.
This event controls which of IForgeItem.onItemUseFirst(net.minecraft.item.ItemStack, net.minecraft.item.ItemUseContext), Block#onBlockActivated, and Item#onItemUse will be called.
Canceling the event will cause none of the above three to be called.

Let result be the first non-pass return value of the above three methods, or pass, if they all pass.
Or PlayerInteractEvent.cancellationResult if the event is cancelled.
If result equals ActionResultType.PASS, we proceed to PlayerInteractEvent.RightClickItem.

There are various results to this event, see the getters below.
Note that handling things differently on the client vs server may cause desynchronizations!