setCancelled

public void setCancelled(boolean cancel)

Sets the cancellation state of this event. A canceled event will not be executed in the server, but will still pass to other plugins

Canceling this event will prevent use of food (player won't lose the food item), prevent bows/snowballs/eggs from firing, etc. (player won't lose the ammo)

Parameters

cancel

true if you wish to cancel this event