Interface OnyxItem
- All Known Implementing Classes:
OnyxItemImpl
public interface OnyxItem
-
Method Summary
Modifier and TypeMethodDescriptionSets the underlying vanilla material for this item.create()Generates a single ItemStack representing this custom item.create(int amount) Generates a stack of this custom item.displayName(String name) Sets the display name using a legacy string with no italics.displayName(net.kyori.adventure.text.Component component) Sets the display name using an Adventure Component.Provides direct access to the ItemMeta for complex modifications.Sets the relative path to the texture file, WITHOUT the .png extension.
-
Method Details
-
baseItem
-
displayName
-
displayName
Sets the display name using an Adventure Component.- Parameters:
component- The display name component.- Returns:
- This OnyxItem instance.
-
texture
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.
-
itemMeta
-
create
ItemStack create()Generates a single ItemStack representing this custom item. Automatically applies CustomModelData and PDC tags.- Returns:
- A new ItemStack.
- Throws:
IllegalStateException- If baseItem is not defined.
-
create
Generates a stack of this custom item. Automatically applies CustomModelData and PDC tags.- Parameters:
amount- The size of the stack.- Returns:
- A new ItemStack.
- Throws:
IllegalStateException- If baseItem is not defined.
-