Class PlayerInteractEvent

All Implemented Interfaces:
Cancellable

public class PlayerInteractEvent
extends PlayerEvent
implements Cancellable
Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand. The hand can be determined using getHand().

This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.