Class OnyxItemImpl

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

public class OnyxItemImpl extends Object implements OnyxItem
Implements OnyxItems
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface OnyxElement
      Returns:
      The string identifier of this element (e.g., "marble")
    • getTexturePath

      public String getTexturePath()
    • getCustomModelPath

      public String getCustomModelPath()
    • getBaseMaterial

      public Material getBaseMaterial()
    • getKey

      public NamespacedKey getKey()
      Specified by:
      getKey in interface OnyxElement
      Returns:
      The underlying Bukkit NamespacedKey for this element
    • 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(@NotNull @NotNull 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.
    • model

      public OnyxItem model(@NotNull @NotNull String path)
      Description copied from interface: OnyxItem
      Sets the relative path to the developer made JSON item model. The path is relative to assets//models/ in your plugin jar.
      Specified by:
      model in interface OnyxItem
      Parameters:
      path - The path without extension (e.g., "items/cool_sword")
      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: OnyxElement
      Creates a single ItemStack of this element. Automatically applies CustomModelData and PDC tags.
      Specified by:
      create in interface OnyxElement
      Returns:
      The generated ItemStack.
    • create

      public ItemStack create(int amount)
      Description copied from interface: OnyxElement
      Creates an ItemStack of this element with the specified amount. Automatically applies CustomModelData and PDC tags.
      Specified by:
      create in interface OnyxElement
      Parameters:
      amount - The stack size.
      Returns:
      The generated ItemStack.