public final class ItemStack
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
animationsToGo
Number of animation frames to go when receiving an item (by walking into it, for example).
|
static java.text.DecimalFormat |
field_111284_a |
int |
stackSize
Size of the stack.
|
NBTTagCompound |
stackTagCompound
A NBTTagMap containing data about an ItemStack.
|
Constructor and Description |
---|
ItemStack(Block par1Block) |
ItemStack(Block par1Block,
int par2) |
ItemStack(Block par1Block,
int par2,
int par3) |
ItemStack(Item par1Item) |
ItemStack(Item par1Item,
int par2) |
ItemStack(Item par1Item,
int par2,
int par3) |
Modifier and Type | Method and Description |
---|---|
void |
addEnchantment(Enchantment par1Enchantment,
int par2)
Adds an enchantment with a desired level on the ItemStack.
|
static boolean |
areItemStacksEqual(ItemStack par0ItemStack,
ItemStack par1ItemStack)
compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal
|
static boolean |
areItemStackTagsEqual(ItemStack par0ItemStack,
ItemStack par1ItemStack) |
boolean |
attemptDamageItem(int par1,
java.util.Random par2Random)
Attempts to damage the ItemStack with par1 amount of damage, If the ItemStack has the Unbreaking enchantment
there is a chance for each point of damage to be negated.
|
boolean |
canEditBlocks() |
ItemStack |
copy()
Returns a new stack with the same properties.
|
static ItemStack |
copyItemStack(ItemStack par0ItemStack)
Creates a copy of a ItemStack, a null parameters will return a null.
|
void |
damageItem(int par1,
EntityLivingBase par2EntityLivingBase)
Damages the item in the ItemStack
|
void |
func_135074_t() |
void |
func_150996_a(Item p_150996_1_) |
float |
func_150997_a(Block p_150997_1_) |
boolean |
func_150998_b(Block p_150998_1_) |
void |
func_150999_a(World p_150999_1_,
Block p_150999_2_,
int p_150999_3_,
int p_150999_4_,
int p_150999_5_,
EntityPlayer p_150999_6_) |
IChatComponent |
func_151000_E() |
com.google.common.collect.Multimap |
getAttributeModifiers()
Gets the attribute modifiers for this ItemStack.nWill check for an NBT tag list containing modifiers for the
stack.
|
java.lang.String |
getDisplayName()
returns the display name of the itemstack
|
NBTTagList |
getEnchantmentTagList() |
boolean |
getHasSubtypes() |
IIcon |
getIconIndex()
Returns the icon index of the current stack.
|
Item |
getItem()
Returns the object corresponding to the stack.
|
int |
getItemDamage()
gets the damage of an itemstack
|
int |
getItemDamageForDisplay()
gets the damage of an itemstack, for displaying purposes
|
EntityItemFrame |
getItemFrame()
Return the item frame this stack is on.
|
int |
getItemSpriteNumber() |
EnumAction |
getItemUseAction() |
int |
getMaxDamage()
Returns the max damage an item in the stack can take.
|
int |
getMaxItemUseDuration() |
int |
getMaxStackSize()
Returns maximum size of the stack.
|
EnumRarity |
getRarity() |
int |
getRepairCost()
Get this stack's repair cost, or 0 if no repair cost is defined.
|
NBTTagCompound |
getTagCompound()
Returns the NBTTagCompound of the ItemStack.
|
java.util.List |
getTooltip(EntityPlayer par1EntityPlayer,
boolean par2)
Return a list of strings containing information about the item
|
java.lang.String |
getUnlocalizedName() |
boolean |
hasDisplayName()
Returns true if the itemstack has a display name
|
boolean |
hasEffect()
Deprecated.
|
boolean |
hasEffect(int pass) |
boolean |
hasTagCompound()
Returns true if the ItemStack has an NBTTagCompound.
|
void |
hitEntity(EntityLivingBase par1EntityLivingBase,
EntityPlayer par2EntityPlayer)
Calls the corresponding fct in di
|
boolean |
interactWithEntity(EntityPlayer par1EntityPlayer,
EntityLivingBase par2EntityLivingBase) |
boolean |
isItemDamaged()
returns true when a damageable item is damaged
|
boolean |
isItemEnchantable()
True if it is a tool and has no enchantments to begin with
|
boolean |
isItemEnchanted()
True if the item has enchantment data
|
boolean |
isItemEqual(ItemStack par1ItemStack)
compares ItemStack argument to the instance ItemStack; returns true if the Items contained in both ItemStacks are
equal
|
boolean |
isItemStackDamageable()
true if this itemStack is damageable
|
boolean |
isOnItemFrame()
Return whether this stack is on an item frame.
|
boolean |
isStackable()
Returns true if the ItemStack can hold 2 or more units of the item.
|
static ItemStack |
loadItemStackFromNBT(NBTTagCompound par0NBTTagCompound) |
void |
onCrafting(World par1World,
EntityPlayer par2EntityPlayer,
int par3) |
ItemStack |
onFoodEaten(World par1World,
EntityPlayer par2EntityPlayer) |
void |
onPlayerStoppedUsing(World par1World,
EntityPlayer par2EntityPlayer,
int par3)
Called when the player releases the use item button.
|
void |
readFromNBT(NBTTagCompound par1NBTTagCompound)
Read the stack fields from a NBT object.
|
void |
setItemDamage(int par1)
Sets the item damage of the ItemStack.
|
void |
setItemFrame(EntityItemFrame par1EntityItemFrame)
Set the item frame this stack is on.
|
void |
setRepairCost(int par1)
Set this stack's repair cost.
|
ItemStack |
setStackDisplayName(java.lang.String p_151001_1_) |
void |
setTagCompound(NBTTagCompound par1NBTTagCompound)
Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it.
|
void |
setTagInfo(java.lang.String par1Str,
NBTBase par2NBTBase) |
ItemStack |
splitStack(int par1)
Remove the argument from the stack size.
|
java.lang.String |
toString() |
boolean |
tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer,
World par2World,
int par3,
int par4,
int par5,
int par6,
float par7,
float par8,
float par9) |
void |
updateAnimation(World par1World,
Entity par2Entity,
int par3,
boolean par4)
Called each tick as long the ItemStack in on player inventory.
|
ItemStack |
useItemRightClick(World par1World,
EntityPlayer par2EntityPlayer)
Called whenever this item stack is equipped and right clicked.
|
NBTTagCompound |
writeToNBT(NBTTagCompound par1NBTTagCompound)
Write the stack fields to a NBT object.
|
public static final java.text.DecimalFormat field_111284_a
public int stackSize
public int animationsToGo
public NBTTagCompound stackTagCompound
public ItemStack(Block par1Block)
public ItemStack(Block par1Block, int par2)
public ItemStack(Block par1Block, int par2, int par3)
public ItemStack(Item par1Item)
public ItemStack(Item par1Item, int par2)
public ItemStack(Item par1Item, int par2, int par3)
public static ItemStack loadItemStackFromNBT(NBTTagCompound par0NBTTagCompound)
public ItemStack splitStack(int par1)
public Item getItem()
public IIcon getIconIndex()
public int getItemSpriteNumber()
public boolean tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6, float par7, float par8, float par9)
public float func_150997_a(Block p_150997_1_)
public ItemStack useItemRightClick(World par1World, EntityPlayer par2EntityPlayer)
public ItemStack onFoodEaten(World par1World, EntityPlayer par2EntityPlayer)
public NBTTagCompound writeToNBT(NBTTagCompound par1NBTTagCompound)
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
public int getMaxStackSize()
public boolean isStackable()
public boolean isItemStackDamageable()
public boolean getHasSubtypes()
public boolean isItemDamaged()
public int getItemDamageForDisplay()
public int getItemDamage()
public void setItemDamage(int par1)
public int getMaxDamage()
public boolean attemptDamageItem(int par1, java.util.Random par2Random)
public void damageItem(int par1, EntityLivingBase par2EntityLivingBase)
public void hitEntity(EntityLivingBase par1EntityLivingBase, EntityPlayer par2EntityPlayer)
public void func_150999_a(World p_150999_1_, Block p_150999_2_, int p_150999_3_, int p_150999_4_, int p_150999_5_, EntityPlayer p_150999_6_)
public boolean func_150998_b(Block p_150998_1_)
public boolean interactWithEntity(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase)
public ItemStack copy()
public static boolean areItemStackTagsEqual(ItemStack par0ItemStack, ItemStack par1ItemStack)
public static boolean areItemStacksEqual(ItemStack par0ItemStack, ItemStack par1ItemStack)
public boolean isItemEqual(ItemStack par1ItemStack)
public java.lang.String getUnlocalizedName()
public static ItemStack copyItemStack(ItemStack par0ItemStack)
public java.lang.String toString()
toString
in class java.lang.Object
public void updateAnimation(World par1World, Entity par2Entity, int par3, boolean par4)
public void onCrafting(World par1World, EntityPlayer par2EntityPlayer, int par3)
public int getMaxItemUseDuration()
public EnumAction getItemUseAction()
public void onPlayerStoppedUsing(World par1World, EntityPlayer par2EntityPlayer, int par3)
public boolean hasTagCompound()
public NBTTagCompound getTagCompound()
public NBTTagList getEnchantmentTagList()
public void setTagCompound(NBTTagCompound par1NBTTagCompound)
public java.lang.String getDisplayName()
public ItemStack setStackDisplayName(java.lang.String p_151001_1_)
public void func_135074_t()
public boolean hasDisplayName()
public java.util.List getTooltip(EntityPlayer par1EntityPlayer, boolean par2)
@Deprecated public boolean hasEffect()
public boolean hasEffect(int pass)
public EnumRarity getRarity()
public boolean isItemEnchantable()
public void addEnchantment(Enchantment par1Enchantment, int par2)
public boolean isItemEnchanted()
public void setTagInfo(java.lang.String par1Str, NBTBase par2NBTBase)
public boolean canEditBlocks()
public boolean isOnItemFrame()
public void setItemFrame(EntityItemFrame par1EntityItemFrame)
public EntityItemFrame getItemFrame()
public int getRepairCost()
public void setRepairCost(int par1)
public com.google.common.collect.Multimap getAttributeModifiers()
public void func_150996_a(Item p_150996_1_)
public IChatComponent func_151000_E()