public class Item extends Object
Constructor and Description |
---|
Item(int par1) |
Modifier and Type | Method and Description |
---|---|
void |
addInformation(ItemStack par1ItemStack,
EntityPlayer par2EntityPlayer,
List par3List,
boolean par4) |
boolean |
canHarvestBlock(Block par1Block)
Returns if the item (tool) can harvest results from the block type.
|
Entity |
createEntity(World world,
Entity location,
ItemStack itemstack)
This function should return a new entity to replace the dropped item.
|
boolean |
doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
If this returns true, after a recipe involving this item is crafted the container item will be added to the
player's inventory instead of remaining in the crafting grid.
|
String |
func_77653_i(ItemStack par1ItemStack) |
boolean |
func_82788_x() |
void |
func_94581_a(IconRegister par1IconRegister) |
int |
func_94901_k() |
WeightedRandomChestContent |
getChestGenBase(ChestGenHooks chest,
Random rnd,
WeightedRandomChestContent original)
Generates the base Random item for a specific instance of the chest gen,
Enchanted books use this to pick a random enchantment.
|
int |
getColorFromItemStack(ItemStack par1ItemStack,
int par2) |
Item |
getContainerItem() |
ItemStack |
getContainerItemStack(ItemStack itemStack)
ItemStack sensitive version of getContainerItem.
|
CreativeTabs |
getCreativeTab() |
CreativeTabs[] |
getCreativeTabs()
Gets a list of tabs that items belonging to this class can display on,
combined properly with getSubItems allows for a single item to span
many sub-items across many tabs.
|
int |
getDamageVsEntity(Entity par1Entity)
Returns the damage against a given entity.
|
int |
getEntityLifespan(ItemStack itemStack,
World world)
Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem.
|
boolean |
getHasSubtypes() |
Icon |
getIcon(ItemStack stack,
int pass)
Return the correct icon for rendering based on the supplied ItemStack and render pass.
|
Icon |
getIcon(ItemStack stack,
int renderPass,
EntityPlayer player,
ItemStack usingItem,
int useRemaining)
Player, Render pass, and item usage sensitive version of getIconIndex.
|
Icon |
getIconFromDamage(int par1) |
Icon |
getIconFromDamageForRenderPass(int par1,
int par2) |
Icon |
getIconIndex(ItemStack par1ItemStack) |
boolean |
getIsRepairable(ItemStack par1ItemStack,
ItemStack par2ItemStack)
Return whether this item is repairable in an anvil.
|
String |
getItemDisplayName(ItemStack par1ItemStack) |
int |
getItemEnchantability()
Return the enchantability factor of the item, most of the time is based on material.
|
int |
getItemStackLimit()
Returns the maximum size of the stack for a specific item.
|
EnumAction |
getItemUseAction(ItemStack par1ItemStack)
returns the action that specifies what animation to play when the items is being used
|
String |
getLocalizedName(ItemStack par1ItemStack)
Gets the localized name of the given item stack.
|
int |
getMaxDamage()
Returns the maximum damage an item can take.
|
int |
getMaxItemUseDuration(ItemStack par1ItemStack)
How long it takes to use or consume an item
|
int |
getMetadata(int par1)
Returns the metadata of the block which this Item (ItemBlock) can place
|
String |
getPotionEffect()
Returns a string representing what this item does to a potion.
|
String |
getPotionEffect(ItemStack stack)
ItemStack sensitive version of getPotionEffect
|
EnumRarity |
getRarity(ItemStack par1ItemStack) |
int |
getRenderPasses(int metadata)
Returns the number of render passes/layers this item has.
|
boolean |
getShareTag()
If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
|
float |
getSmeltingExperience(ItemStack item)
Determines the base experience for a player when they remove this item from a furnace slot.
|
String |
getStatName() |
float |
getStrVsBlock(ItemStack par1ItemStack,
Block par2Block)
Returns the strength of the stack against a given block.
|
float |
getStrVsBlock(ItemStack itemstack,
Block block,
int metadata)
Metadata-sensitive version of getStrVsBlock
|
void |
getSubItems(int par1,
CreativeTabs par2CreativeTabs,
List par3List) |
String |
getUnlocalizedName()
Returns the unlocalized name of this item.
|
String |
getUnlocalizedName(ItemStack par1ItemStack)
Returns the unlocalized name of this item.
|
boolean |
hasContainerItem()
True if this Item has a container item (a.k.a.
|
boolean |
hasCustomEntity(ItemStack stack)
Determines if this Item has a special entity for when they are in the world.
|
boolean |
hasEffect(ItemStack par1ItemStack) |
boolean |
hitEntity(ItemStack par1ItemStack,
EntityLiving par2EntityLiving,
EntityLiving par3EntityLiving)
Current implementations of this method in child classes do not use the entry argument beside ev.
|
boolean |
isDamageable() |
boolean |
isFull3D() |
boolean |
isItemTool(ItemStack par1ItemStack)
Checks isDamagable and if it cannot be stacked
|
boolean |
isMap()
false for all Items except sub-classes of ItemMapBase
|
boolean |
isPotionIngredient()
Returns true if this item serves as a potion ingredient (its ingredient information is not null).
|
boolean |
isPotionIngredient(ItemStack stack)
ItemStack sensitive version of isPotionIngredient
|
boolean |
isRepairable()
Called by CraftingManager to determine if an item is reparable.
|
boolean |
isValidArmor(ItemStack stack,
int armorType)
Determines if the specific ItemStack can be placed in the specified armor slot.
|
boolean |
itemInteractionForEntity(ItemStack par1ItemStack,
EntityLiving par2EntityLiving)
Called when a player right clicks an entity with an item.
|
void |
onArmorTickUpdate(World world,
EntityPlayer player,
ItemStack itemStack)
Called to tick armor in the armor slot.
|
boolean |
onBlockDestroyed(ItemStack par1ItemStack,
World par2World,
int par3,
int par4,
int par5,
int par6,
EntityLiving par7EntityLiving) |
boolean |
onBlockStartBreak(ItemStack itemstack,
int X,
int Y,
int Z,
EntityPlayer player)
Called before a block is broken.
|
void |
onCreated(ItemStack par1ItemStack,
World par2World,
EntityPlayer par3EntityPlayer)
Called when item is crafted/smelted.
|
boolean |
onDroppedByPlayer(ItemStack item,
EntityPlayer player)
Called when a player drops the item into the world,
returning false from this will prevent the item from
being removed from the players inventory and spawning
in the world
|
ItemStack |
onEaten(ItemStack par1ItemStack,
World par2World,
EntityPlayer par3EntityPlayer) |
ItemStack |
onItemRightClick(ItemStack par1ItemStack,
World par2World,
EntityPlayer par3EntityPlayer)
Called whenever this item is equipped and the right mouse button is pressed.
|
boolean |
onItemUse(ItemStack par1ItemStack,
EntityPlayer par2EntityPlayer,
World par3World,
int par4,
int par5,
int par6,
int par7,
float par8,
float par9,
float par10)
Callback for item usage.
|
boolean |
onItemUseFirst(ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ)
This is called when the item is used, before the block is activated.
|
boolean |
onLeftClickEntity(ItemStack stack,
EntityPlayer player,
Entity entity)
Called when the player Left Clicks (attacks) an entity.
|
void |
onPlayerStoppedUsing(ItemStack par1ItemStack,
World par2World,
EntityPlayer par3EntityPlayer,
int par4)
called when the player releases the use item button.
|
void |
onUpdate(ItemStack par1ItemStack,
World par2World,
Entity par3Entity,
int par4,
boolean par5)
Called each tick as long the item is on a player inventory.
|
void |
onUsingItemTick(ItemStack stack,
EntityPlayer player,
int count)
Called each tick while using an item.
|
boolean |
requiresMultipleRenderPasses() |
Item |
setContainerItem(Item par1Item) |
Item |
setCreativeTab(CreativeTabs par1CreativeTabs)
returns this;
|
Item |
setFull3D()
Sets bFull3D to True and return the object.
|
Item |
setMaxDamage(int par1)
set max damage of an Item
|
Item |
setMaxStackSize(int par1) |
Item |
setNoRepair()
Call to disable repair recipes.
|
Item |
setUnlocalizedName(String par1Str)
Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item."
|
boolean |
shouldPassSneakingClickToBlock(World par2World,
int par4,
int par5,
int par6)
Should this item, when held, allow sneak-clicks to pass through to the underlying block?
|
boolean |
shouldRotateAroundWhenRendering() |
public static Item shovelSteel
public static Item pickaxeSteel
public static Item flintAndSteel
public static Item swordSteel
public static Item shovelWood
public static Item pickaxeWood
public static Item swordStone
public static Item shovelStone
public static Item pickaxeStone
public static Item swordDiamond
public static Item shovelDiamond
public static Item pickaxeDiamond
public static Item axeDiamond
public static Item shovelGold
public static Item pickaxeGold
public static Item hoeDiamond
public static ItemArmor helmetLeather
public static ItemArmor plateLeather
public static ItemArmor legsLeather
public static ItemArmor bootsLeather
public static ItemArmor helmetChain
public static ItemArmor plateChain
public static ItemArmor bootsChain
public static ItemArmor helmetSteel
public static ItemArmor plateSteel
public static ItemArmor bootsSteel
public static ItemArmor helmetDiamond
public static ItemArmor plateDiamond
public static ItemArmor legsDiamond
public static ItemArmor bootsDiamond
public static ItemArmor helmetGold
public static Item porkCooked
public static Item bucketEmpty
public static Item bucketWater
public static Item bucketLava
public static Item minecartEmpty
public static Item bucketMilk
public static Item minecartCrate
public static Item minecartPowered
public static ItemFishingRod fishingRod
public static Item pocketSundial
public static Item lightStoneDust
public static Item fishCooked
public static Item redstoneRepeater
public static ItemShears shears
public static Item pumpkinSeeds
public static Item melonSeeds
public static Item beefCooked
public static Item chickenRaw
public static Item chickenCooked
public static Item rottenFlesh
public static Item enderPearl
public static Item goldNugget
public static Item netherStalkSeeds
public static ItemPotion potion
public static Item glassBottle
public static Item fermentedSpiderEye
public static Item blazePowder
public static Item magmaCream
public static Item brewingStand
public static Item eyeOfEnder
public static Item speckledMelon
public static Item monsterPlacer
public static Item expBottle
public static Item fireballCharge
public static Item writableBook
public static Item writtenBook
public static Item bakedPotato
public static Item poisonousPotato
public static ItemEmptyMap emptyMap
public static Item goldenCarrot
public static Item carrotOnAStick
public static Item netherStar
public static Item pumpkinPie
public static Item fireworkCharge
public static ItemEnchantedBook enchantedBook
public static Item field_94585_bY
public static Item field_94584_bZ
public static Item field_94583_ca
public static Item field_94582_cb
public static Item field_96600_cc
public static Item recordBlocks
public static Item recordChirp
public static Item recordMall
public static Item recordMellohi
public static Item recordStal
public static Item recordStrad
public static Item recordWard
public static Item recordWait
public final int itemID
public Item(int par1)
public Item setMaxStackSize(int par1)
public int func_94901_k()
public Icon getIconFromDamage(int par1)
public final Icon getIconIndex(ItemStack par1ItemStack)
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
public int getItemStackLimit()
public int getMetadata(int par1)
public boolean getHasSubtypes()
public int getMaxDamage()
public Item setMaxDamage(int par1)
public boolean isDamageable()
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
public int getDamageVsEntity(Entity par1Entity)
public boolean canHarvestBlock(Block par1Block)
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving)
public boolean isFull3D()
public boolean shouldRotateAroundWhenRendering()
public Item setUnlocalizedName(String par1Str)
public String getLocalizedName(ItemStack par1ItemStack)
public String getUnlocalizedName()
public String getUnlocalizedName(ItemStack par1ItemStack)
public Item setContainerItem(Item par1Item)
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
public boolean getShareTag()
public Item getContainerItem()
public boolean hasContainerItem()
public String getStatName()
public String func_77653_i(ItemStack par1ItemStack)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
public boolean isMap()
public EnumAction getItemUseAction(ItemStack par1ItemStack)
public int getMaxItemUseDuration(ItemStack par1ItemStack)
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
public String getPotionEffect()
public boolean isPotionIngredient()
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
public String getItemDisplayName(ItemStack par1ItemStack)
public EnumRarity getRarity(ItemStack par1ItemStack)
public boolean isItemTool(ItemStack par1ItemStack)
public int getItemEnchantability()
public boolean requiresMultipleRenderPasses()
public Icon getIconFromDamageForRenderPass(int par1, int par2)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
public Item setCreativeTab(CreativeTabs par1CreativeTabs)
public CreativeTabs getCreativeTab()
public boolean func_82788_x()
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
public void func_94581_a(IconRegister par1IconRegister)
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
player
- The player that dropped the itemitem
- The item stack, before the item is removed.public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
stack
- The Item Stackplayer
- The Player that used the itemworld
- The Current Worldx
- Target X Positiony
- Target Y Positionz
- Target Z Positionside
- The side of the target hitpublic float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
itemstack
- The Item Stackblock
- The block the item is trying to breakmetadata
- The items current metadatapublic boolean isRepairable()
public Item setNoRepair()
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
itemstack
- The current ItemStackX
- The X PositionY
- The X PositionZ
- The X Positionplayer
- The Player that is wielding the itempublic void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
stack
- The Item being usedplayer
- The Player using the itemcount
- The amount of time in tick the item has been used for continuouslypublic boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
stack
- The Item being usedplayer
- The player that is attackingentity
- The entity being attackedpublic Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
stack
- The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null)renderPass
- The pass to get the icon for, 0 is default.player
- The player holding the itemusingItem
- The item the player is actively using. Can be null if not using anything.useRemaining
- The ticks remaining for the active item.public int getRenderPasses(int metadata)
metadata
- The item's metadatapublic ItemStack getContainerItemStack(ItemStack itemStack)
itemStack
- The current ItemStackpublic int getEntityLifespan(ItemStack itemStack, World world)
itemStack
- The current ItemStackworld
- The world the entity is inpublic boolean hasCustomEntity(ItemStack stack)
stack
- The current item stackpublic Entity createEntity(World world, Entity location, ItemStack itemstack)
world
- The world objectlocation
- The EntityItem object, useful for getting the position of the entityitemstack
- The current item stackpublic CreativeTabs[] getCreativeTabs()
public float getSmeltingExperience(ItemStack item)
item
- The item stack the player is picking up.public Icon getIcon(ItemStack stack, int pass)
getIconFromDamageForRenderPass(int, int)
stack
- to render forpass
- the multi-render passpublic WeightedRandomChestContent getChestGenBase(ChestGenHooks chest, Random rnd, WeightedRandomChestContent original)
chest
- The chest category to generate forrnd
- World RNGoriginal
- Original result registered with the chest gen hooks.public boolean shouldPassSneakingClickToBlock(World par2World, int par4, int par5, int par6)
par2World
- par4
- par5
- par6
- public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack)
world
- player
- itemStack
- public boolean isValidArmor(ItemStack stack, int armorType)
stack
- The ItemStackarmorType
- Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Bootspublic boolean isPotionIngredient(ItemStack stack)
stack
- The item stackpublic String getPotionEffect(ItemStack stack)
stack
- The item stack