Class OnyxItemImpl

java.lang.Object
com.zombienw.onyxlib.impl.item.OnyxItemImpl
All Implemented Interfaces:
OnyxItem

public class OnyxItemImpl extends Object implements OnyxItem
  • Constructor Details

  • Method Details

    • getId

      public String getId()
    • getTexturePath

      public String getTexturePath()
    • getBaseMaterial

      public Material getBaseMaterial()
    • getKey

      public NamespacedKey getKey()
    • baseItem

      public OnyxItem baseItem(Material material)
      Description copied from interface: OnyxItem
      Sets the underlying vanilla material for this item. Required for the item to be created.
      Specified by:
      baseItem in interface OnyxItem
      Parameters:
      material - The base vanilla Material.
      Returns:
      This OnyxItem instance.
    • displayName

      public OnyxItem displayName(String name)
      Description copied from interface: OnyxItem
      Sets the display name using a legacy string with no italics.
      Specified by:
      displayName in interface OnyxItem
      Parameters:
      name - The display name.
      Returns:
      This OnyxItem instance.
    • displayName

      public OnyxItem displayName(net.kyori.adventure.text.Component component)
      Description copied from interface: OnyxItem
      Sets the display name using an Adventure Component.
      Specified by:
      displayName in interface OnyxItem
      Parameters:
      component - The display name component.
      Returns:
      This OnyxItem instance.
    • texture

      public OnyxItem texture(String path)
      Description copied from interface: OnyxItem
      Sets the relative path to the texture file, WITHOUT the .png extension. The path is relative to assets//textures/ in your plugin jar.

      Example: texture("items/strawberry") -> assets/myplugin/textures/items/strawberry.png

      Specified by:
      texture in interface OnyxItem
      Parameters:
      path - The path without extension (e.g., "items/strawberry")
      Returns:
      This OnyxItem instance.
    • itemMeta

      public OnyxItem itemMeta(Consumer<ItemMeta> metaConsumer)
      Description copied from interface: OnyxItem
      Provides direct access to the ItemMeta for complex modifications.
      Specified by:
      itemMeta in interface OnyxItem
      Parameters:
      metaConsumer - A consumer to manipulate the item's meta.
      Returns:
      This OnyxItem instance.
    • create

      public ItemStack create()
      Description copied from interface: OnyxItem
      Generates a single ItemStack representing this custom item. Automatically applies CustomModelData and PDC tags.
      Specified by:
      create in interface OnyxItem
      Returns:
      A new ItemStack.
    • create

      public ItemStack create(int amount)
      Description copied from interface: OnyxItem
      Generates a stack of this custom item. Automatically applies CustomModelData and PDC tags.
      Specified by:
      create in interface OnyxItem
      Parameters:
      amount - The size of the stack.
      Returns:
      A new ItemStack.