Class Item

    • Field Detail

      • itemModifierUUID

        protected static final EaglercraftUUID itemModifierUUID
      • itemRand

        protected static EaglercraftRandom itemRand
        + The RNG used by the Item subclasses.
      • maxStackSize

        protected int maxStackSize
        + Maximum size of the stack.
      • bFull3D

        protected boolean bFull3D
      • hasSubtypes

        protected boolean hasSubtypes
    • Constructor Detail

      • Item

        public Item()
    • Method Detail

      • getIdFromItem

        public static int getIdFromItem​(Item itemIn)
      • getItemById

        public static Item getItemById​(int id)
      • getItemFromBlock

        public static Item getItemFromBlock​(Block blockIn)
      • loadPluginData

        public void loadPluginData​(BaseData data)
      • makePluginData

        public PluginData makePluginData()
      • getByNameOrId

        public static Item getByNameOrId​(java.lang.String id)
        + Tries to get an Item by it's name (e.g. minecraft:apple) or a String representation of a numerical ID. If both fail, null is returned.
      • updateItemStackNBT

        public boolean updateItemStackNBT​(NBTTagCompound var1)
        + Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data
      • setMaxStackSize

        public Item setMaxStackSize​(int maxStackSize)
      • getStrVsBlock

        public float getStrVsBlock​(ItemStack var1,
                                   Block var2)
      • onItemRightClick

        public ItemStack onItemRightClick​(ItemStack itemstack,
                                          World var2,
                                          EntityPlayer var3)
        + Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
      • onItemUseFinish

        public ItemStack onItemUseFinish​(ItemStack itemstack,
                                         World var2,
                                         EntityPlayer var3)
        + Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using the Item before the action is complete.
      • getItemStackLimit

        public int getItemStackLimit()
        + Returns the maximum size of the stack for a specific item. *Isn't this more a Set than a Get?*
      • getMetadata

        public int getMetadata​(int var1)
        + Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is placed as a Block (mostly used with ItemBlocks).
      • getHasSubtypes

        public boolean getHasSubtypes()
      • setHasSubtypes

        protected Item setHasSubtypes​(boolean hasSubtypes)
      • getMaxDamage

        public int getMaxDamage()
        + Returns the maximum damage an item can take.
      • setMaxDamage

        protected Item setMaxDamage​(int maxDamageIn)
        + set max damage of an Item
      • isDamageable

        public boolean isDamageable()
      • hitEntity

        public boolean hitEntity​(ItemStack var1,
                                 EntityLivingBase var2,
                                 EntityLivingBase var3)
        + Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the damage on the stack.
      • onBlockDestroyed

        public boolean onBlockDestroyed​(ItemStack var1,
                                        World var2,
                                        Block var3,
                                        BlockPos var4,
                                        EntityLivingBase var5)
        + Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
      • canHarvestBlock

        public boolean canHarvestBlock​(Block var1)
        + Check whether this Item can harvest the given Block
      • itemInteractionForEntity

        public boolean itemInteractionForEntity​(ItemStack var1,
                                                EntityPlayer var2,
                                                EntityLivingBase var3)
        + Returns true if the item can be used on the given entity, e.g. shears on sheep.
      • setFull3D

        public Item setFull3D()
        + Sets bFull3D to True and return the object.
      • isFull3D

        public boolean isFull3D()
        + Returns True is the item is renderer in full 3D when hold.
      • shouldRotateAroundWhenRendering

        public boolean shouldRotateAroundWhenRendering()
        + Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands.
      • setUnlocalizedName

        public Item setUnlocalizedName​(java.lang.String s)
        + Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item."
      • getUnlocalizedNameInefficiently

        public java.lang.String getUnlocalizedNameInefficiently​(ItemStack stack)
        + Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the unlocalized name itself is returned.
      • getUnlocalizedName

        public java.lang.String getUnlocalizedName()
        + Returns the unlocalized name of this item.
      • getUnlocalizedName

        public java.lang.String getUnlocalizedName​(ItemStack var1)
        + Returns the unlocalized name of this item.
      • setContainerItem

        public Item setContainerItem​(Item containerItem)
      • getShareTag

        public boolean getShareTag()
        + If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
      • getContainerItem

        public Item getContainerItem()
      • hasContainerItem

        public boolean hasContainerItem()
        + True if this Item has a container item (a.k.a. crafting result)
      • getColorFromItemStack

        public int getColorFromItemStack​(ItemStack var1,
                                         int var2)
      • onUpdate

        public void onUpdate​(ItemStack var1,
                             World var2,
                             Entity var3,
                             int var4,
                             boolean var5)
        + Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update it's contents.
      • onCreated

        public void onCreated​(ItemStack var1,
                              World var2,
                              EntityPlayer var3)
        + Called when item is crafted/smelted. Used only by maps so far.
      • isMap

        public boolean isMap()
        + false for all Items except sub-classes of ItemMapBase
      • getItemUseAction

        public EnumAction getItemUseAction​(ItemStack var1)
        + returns the action that specifies what animation to play when the items is being used
      • getMaxItemUseDuration

        public int getMaxItemUseDuration​(ItemStack var1)
        + How long it takes to use or consume an item
      • onPlayerStoppedUsing

        public void onPlayerStoppedUsing​(ItemStack var1,
                                         World var2,
                                         EntityPlayer var3,
                                         int var4)
        + Called when the player stops using an Item (stops holding the right mouse button).
      • setPotionEffect

        protected Item setPotionEffect​(java.lang.String potionEffect)
        + Sets the string representing this item's effect on a potion when used as an ingredient.
      • getPotionEffect

        public java.lang.String getPotionEffect​(ItemStack var1)
      • isPotionIngredient

        public boolean isPotionIngredient​(ItemStack stack)
      • addInformation

        public void addInformation​(ItemStack var1,
                                   EntityPlayer var2,
                                   java.util.List<java.lang.String> var3,
                                   boolean var4)
        + allows items to add custom lines of information to the mouseover description
      • getItemStackDisplayName

        public java.lang.String getItemStackDisplayName​(ItemStack itemstack)
      • hasEffect

        public boolean hasEffect​(ItemStack itemstack)
      • getRarity

        public EnumRarity getRarity​(ItemStack itemstack)
        + Return an item rarity from EnumRarity
      • isItemTool

        public boolean isItemTool​(ItemStack var1)
        + Checks isDamagable and if it cannot be stacked
      • getItemEnchantability

        public int getItemEnchantability()
        + Return the enchantability factor of the item, most of the time is based on material.
      • getSubItems

        public void getSubItems​(Item item,
                                CreativeTabs var2,
                                java.util.List<ItemStack> list)
        + returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
      • getCreativeTab

        public CreativeTabs getCreativeTab()
        + gets the CreativeTab this item is displayed on
      • setCreativeTab

        public Item setCreativeTab​(CreativeTabs tab)
        + returns this;
      • canItemEditBlocks

        public boolean canItemEditBlocks()
        + Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal) when not in creative
      • getIsRepairable

        public boolean getIsRepairable​(ItemStack var1,
                                       ItemStack var2)
        + Return whether this item is repairable in an anvil.
      • registerItems

        public static void registerItems()
      • registerItemBlock

        protected static void registerItemBlock​(Block blockIn,
                                                Item itemIn)
        + Register the given Item as the ItemBlock for the given Block.