Class CustomItem
java.lang.Object
com.github.pinont.singularitylib.api.items.CustomItem
Abstract base class for creating custom items with interactions.
Custom items combine an ItemCreator with an ItemInteraction to provide
both visual representation and functionality.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ItemInteractionGets the interaction behavior for this custom item.org.bukkit.inventory.ItemStackgetItem()Gets the final ItemStack for this custom item.getName()Gets the normalized name of this custom item.abstract ItemCreatorregister()Registers and configures the ItemCreator for this custom item.
-
Constructor Details
-
CustomItem
public CustomItem()Default constructor for CustomItem.
-
-
Method Details
-
getItem
public org.bukkit.inventory.ItemStack getItem()Gets the final ItemStack for this custom item. This method combines the item creation and interaction registration.- Returns:
- the complete ItemStack with interaction capabilities
-
getName
Gets the normalized name of this custom item. The name is derived from the item's display name, with colors removed and formatted as lowercase with underscores.- Returns:
- the normalized item name
-
getInteraction
Gets the interaction behavior for this custom item. Implement this method to define what happens when players interact with the item.- Returns:
- the ItemInteraction that defines the item's behavior
-
register
Registers and configures the ItemCreator for this custom item. Implement this method to define the item's appearance and properties.- Returns:
- the ItemCreator that defines the item's visual properties
-