Package noppes.npcs.api.item
Interface IItemScripted
- All Superinterfaces:
IItemStack
public interface IItemScripted extends IItemStack
-
Method Summary
Modifier and Type Method Description int
getColor()
int
getDurabilityColor()
boolean
getDurabilityShow()
double
getDurabilityValue()
java.lang.String
getTexture(int damage)
boolean
hasTexture(int damage)
void
setColor(int color)
void
setDurabilityColor(int color)
void
setDurabilityShow(boolean bo)
void
setDurabilityValue(float value)
void
setMaxStackSize(int size)
void
setTexture(int damage, java.lang.String texture)
All scripted items with the same damage value have the same texture.Methods inherited from interface noppes.npcs.api.item.IItemStack
addEnchantment, compare, copy, damageItem, getAttackDamage, getAttribute, getDisplayName, getFoodLevel, getItemDamage, getItemName, getItemNbt, getLore, getMaxItemDamage, getMaxStackSize, getMCItemStack, getName, getNbt, getStackSize, getStoreddata, getTempdata, getType, hasAttribute, hasCustomName, hasEnchant, hasNbt, isBlock, isBook, isEmpty, isEnchanted, isWearable, removeEnchant, removeNbt, setAttribute, setAttribute, setCustomName, setItemDamage, setLore, setStackSize
-
Method Details
-
hasTexture
boolean hasTexture(int damage) -
getTexture
java.lang.String getTexture(int damage)- Parameters:
damage
-- Returns:
- Returns the texture associated with this damage value
-
setTexture
void setTexture(int damage, java.lang.String texture)All scripted items with the same damage value have the same texture. To change the actual texture of the item call setItemDamage afterwards with the same damage value- Parameters:
damage
- The damage valuetexture
- Texture you want this damage value to have
-
setMaxStackSize
void setMaxStackSize(int size) -
getDurabilityValue
double getDurabilityValue()- Returns:
- Returns a value between 0 and 1, 0 is an empty durability bar and 1 a full one
-
setDurabilityValue
void setDurabilityValue(float value)- Parameters:
value
- A value between 0 and 1, 0 is an empty durability bar and 1 a full one
-
getDurabilityShow
boolean getDurabilityShow()- Returns:
- Returns whether the durability is visible or not
-
setDurabilityShow
void setDurabilityShow(boolean bo)- Parameters:
bo
- Set whether the durability is visible
-
getDurabilityColor
int getDurabilityColor()- Returns:
- Returns the customly set durability color for the bar. If no custom value is set it will return -1
-
setDurabilityColor
void setDurabilityColor(int color)- Parameters:
color
- Set a custom color hex value for durability bar.
-
getColor
int getColor()- Returns:
- Returns the color of the item. -1 for no color
-
setColor
void setColor(int color)- Parameters:
color
- Set a custom color hex value for the item tint. -1 to remove the color
-