All Implemented Interfaces:
This event will fire when a player is finishing consuming an item (food,
potion, milk bucket).
If the ItemStack is modified the server will use the effects of the new
item and not remove the original one from the player's inventory.
If the event is cancelled the effect will not be applied and the item will
not be removed from the player's inventory.
Methods inherited from class java.lang.
Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public @Nullable ItemStack getReplacement()
Return the custom item stack that will replace the consumed item, or null if no
custom replacement has been set (which means the default replacement will be used).
Returns: The custom item stack that will replace the consumed item or null
public void setReplacement(
@Nullable ItemStack replacement)
Set a custom item stack to replace the consumed item. Pass null to clear any custom
stack that has been set and use the default replacement.
replacement - Replacement item to set, null to clear any custom stack and use default
public boolean isCancelled()
Gets the cancellation state of this event. A cancelled event will not
be executed in the server, but will still pass to other plugins
Returns: true if this event is cancelled
public void setCancelled(boolean cancel)
Sets the cancellation state of this event. A cancelled event will not
be executed in the server, but will still pass to other plugins.
cancel - true if you wish to cancel this event
Copyright © 2021. All rights reserved.