Class OnyxItemImpl
java.lang.Object
com.zombienw.onyxlib.impl.item.OnyxItemImpl
- All Implemented Interfaces:
OnyxItem, OnyxElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the underlying vanilla material for this item.create()Creates a single ItemStack of this element.create(int amount) Creates an ItemStack of this element with the specified amount.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.getId()getKey()Provides direct access to the ItemMeta for complex modifications.Sets the relative path to the developer made JSON item model.Sets the relative path to the texture file, WITHOUT the .png extension.
-
Constructor Details
-
OnyxItemImpl
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceOnyxElement- Returns:
- The string identifier of this element (e.g., "marble")
-
getTexturePath
-
getCustomModelPath
-
getBaseMaterial
-
getKey
- Specified by:
getKeyin interfaceOnyxElement- Returns:
- The underlying Bukkit NamespacedKey for this element
-
baseItem
Description copied from interface:OnyxItemSets the underlying vanilla material for this item. Required for the item to be created. -
displayName
Description copied from interface:OnyxItemSets the display name using a legacy string with no italics.- Specified by:
displayNamein interfaceOnyxItem- Parameters:
name- The display name.- Returns:
- This OnyxItem instance.
-
displayName
Description copied from interface:OnyxItemSets the display name using an Adventure Component.- Specified by:
displayNamein interfaceOnyxItem- Parameters:
component- The display name component.- Returns:
- This OnyxItem instance.
-
texture
Description copied from interface:OnyxItemSets 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
-
model
Description copied from interface:OnyxItemSets the relative path to the developer made JSON item model. The path is relative to assets//models/ in your plugin jar. -
itemMeta
Description copied from interface:OnyxItemProvides direct access to the ItemMeta for complex modifications. -
create
Description copied from interface:OnyxElementCreates a single ItemStack of this element. Automatically applies CustomModelData and PDC tags.- Specified by:
createin interfaceOnyxElement- Returns:
- The generated ItemStack.
-
create
Description copied from interface:OnyxElementCreates an ItemStack of this element with the specified amount. Automatically applies CustomModelData and PDC tags.- Specified by:
createin interfaceOnyxElement- Parameters:
amount- The stack size.- Returns:
- The generated ItemStack.
-