Interface OnyxItem

All Superinterfaces:
OnyxElement
All Known Implementing Classes:
OnyxItemImpl

public interface OnyxItem extends OnyxElement
Represents a custom item. Acts as the builder for itself.
  • Method Details

    • baseItem

      OnyxItem baseItem(Material material)
      Sets the underlying vanilla material for this item. Required for the item to be created.
      Parameters:
      material - The base vanilla Material.
      Returns:
      This OnyxItem instance.
    • displayName

      OnyxItem displayName(String name)
      Sets the display name using a legacy string with no italics.
      Parameters:
      name - The display name.
      Returns:
      This OnyxItem instance.
    • displayName

      OnyxItem displayName(net.kyori.adventure.text.Component component)
      Sets the display name using an Adventure Component.
      Parameters:
      component - The display name component.
      Returns:
      This OnyxItem instance.
    • texture

      OnyxItem texture(String path)
      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

      Parameters:
      path - The path without extension (e.g., "items/strawberry")
      Returns:
      This OnyxItem instance.
    • model

      OnyxItem model(String path)
      Sets the relative path to the developer made JSON item model. The path is relative to assets//models/ in your plugin jar.
      Parameters:
      path - The path without extension (e.g., "items/cool_sword")
      Returns:
      This OnyxItem instance.
    • itemMeta

      OnyxItem itemMeta(Consumer<ItemMeta> metaConsumer)
      Provides direct access to the ItemMeta for complex modifications.
      Parameters:
      metaConsumer - A consumer to manipulate the item's meta.
      Returns:
      This OnyxItem instance.