Class ModdedConsumable
java.lang.Object
me.mythicalflame.spigotmodding.items.ModdedItem
me.mythicalflame.spigotmodding.items.ModdedConsumable
This class represents a custom consumable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onConsume
(org.bukkit.event.player.PlayerItemConsumeEvent event) This method is intended to be overridden and is called when a player is involved in a PlayerItemConsumeEvent.Methods inherited from class me.mythicalflame.spigotmodding.items.ModdedItem
equals, finalizeItem, getCustomModelData, getDisplayName, getID, getItem, getItem, getMaterial, getNamespace, hasCustomModelData, hashCode, onAttack, onInteract, onKill, onTick
-
Constructor Details
-
ModdedConsumable
public ModdedConsumable(String namespace, String id, org.bukkit.Material material, String name, Integer customModelData, List<String> lore) Constructs a ModdedConsumable object.- Parameters:
namespace
- The non-null namespace that this item belongs to.id
- The non-null ID of this item.material
- The non-null consumable Material that this item is based off of.name
- The nullable display name of this item.customModelData
- The nullable custom model data value of this item.lore
- The nullable lore of the item.- Throws:
NotConsumableException
- If this constructor is called with a non-edible Material.
-
-
Method Details
-
onConsume
public void onConsume(org.bukkit.event.player.PlayerItemConsumeEvent event) This method is intended to be overridden and is called when a player is involved in a PlayerItemConsumeEvent.- Parameters:
event
- The PlayerItemConsumeEvent.
-