@FunctionalInterface public interface ItemConsumptionHandler extends ItemHandler
ItemHandler
is triggered when the SlimefunItem
it was assigned to
has been consumed.
This ItemHandler
only works for food or potions.ItemHandler
,
SimpleSlimefunItem
,
FortuneCookie
,
DietCookie
Modifier and Type | Method and Description |
---|---|
default java.lang.Class<? extends ItemHandler> |
getIdentifier()
This method returns the identifier for this
ItemHandler . |
void |
onConsume(PlayerItemConsumeEvent e,
Player p,
ItemStack item)
This method gets fired whenever a
PlayerItemConsumeEvent involving this
SlimefunItem has been triggered. |
isPrivate
void onConsume(PlayerItemConsumeEvent e, Player p, ItemStack item)
PlayerItemConsumeEvent
involving this
SlimefunItem
has been triggered.e
- The PlayerItemConsumeEvent
that was firedp
- The Player
who consumed the given ItemStack
item
- The ItemStack
that was consumeddefault java.lang.Class<? extends ItemHandler> getIdentifier()
ItemHandler
ItemHandler
.
We use a Class
identifier to group Item Handlers together.getIdentifier
in interface ItemHandler
Class
identifier for this ItemHandler