public class ScriptableItemStack
extends cubex2.mods.customstuff2.engine.ScriptObject
| Constructor and Description |
|---|
ScriptableItemStack(net.minecraft.item.ItemStack stack) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEnchantment(int id,
int level)
Adds an enchantment to the itemstack
|
void |
clearEnchantments()
Removes all enchantments from the itemstack
|
void |
damageItem(int amount)
Damages the item by the given amount
|
int |
getDamage()
Gets the stack's damage value
|
int |
getId()
Gets the stack's itemID
|
int |
getStackSize()
Gets the stack's stack size
|
boolean |
hasEnchantment()
Checks if the itemstack has any enchantment
|
boolean |
hasEnchantment(int id)
Checks if the itemstack has the given enchantment
|
boolean |
hasEnchantment(int id,
int level)
Checks if the itemstack has the given enchantment.
|
void |
removeEnchantment(int id)
Removes an enchantment from the itemstack
|
void |
setDamage(int damage)
Sets the stack's damage value
|
void |
setId(int id)
Sets the stack's itemID
|
void |
setStackSize(int stackSize)
Sets the stack's stack size
|
void |
setValues(int id,
int stacksize,
int meta)
Sets the stack's itemID, damage value and stack size
|
public ScriptableItemStack(net.minecraft.item.ItemStack stack)
public void setValues(int id,
int stacksize,
int meta)
id - The new itemIDstacksize - The new stack sizemeta - The new damage valuepublic void setId(int id)
id - The new itemIDpublic int getId()
public void setDamage(int damage)
damage - The new damage valuepublic int getDamage()
public void setStackSize(int stackSize)
stackSize - The new stack sizepublic int getStackSize()
public void damageItem(int amount)
amount - The damage to add to the itempublic boolean hasEnchantment()
public boolean hasEnchantment(int id)
id - The id of the enchantmentpublic boolean hasEnchantment(int id,
int level)
id - The id of the enchantmentlevel - The level of the enchantmentpublic void clearEnchantments()
public void addEnchantment(int id,
int level)
id - The id of the enchantmentlevel - The level of the enchantmentpublic void removeEnchantment(int id)
id - The id of the enchantment