Class CustomItem

java.lang.Object
com.github.pinont.singularitylib.api.items.CustomItem

public abstract class CustomItem extends Object
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 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

      public String 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

      public abstract ItemInteraction 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

      public abstract ItemCreator 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