Class EntityItem

java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityItem
Direct Known Subclasses:
BloodWoodSaplingItemEntity, FloatingItemEntity

public class EntityItem extends Entity
  • Field Details

    • age

      public int age
      The age of this EntityItem (used to animate it up and down as well as expire it)
    • delayBeforeCanPickup

      public int delayBeforeCanPickup
    • hoverStart

      public float hoverStart
      The EntityItem's random initial float height.
  • Constructor Details

    • EntityItem

      public EntityItem(World par1World, double par2, double par4, double par6)
    • EntityItem

      public EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
    • EntityItem

      public EntityItem(World par1World)
  • Method Details

    • canTriggerWalking

      protected boolean canTriggerWalking()
      returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling crops
      Overrides:
      canTriggerWalking in class Entity
    • entityInit

      protected void entityInit()
      Specified by:
      entityInit in class Entity
    • onUpdate

      public void onUpdate()
      Called to update the entity's position/logic.
      Overrides:
      onUpdate in class Entity
    • combineItems

      public boolean combineItems(EntityItem par1EntityItem)
      Tries to merge this item with the item passed as the parameter. Returns true if successful. Either this item or the other item will be removed from the world.
    • setAgeToCreativeDespawnTime

      public void setAgeToCreativeDespawnTime()
      sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five). Used when items are dropped from players in creative mode
    • handleWaterMovement

      public boolean handleWaterMovement()
      Returns if this entity is in water and will end up adding the waters velocity to the entity
      Overrides:
      handleWaterMovement in class Entity
    • dealFireDamage

      public void dealFireDamage(int par1)
      Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage
      Overrides:
      dealFireDamage in class Entity
    • attackEntityFrom

      public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
      Called when the entity is attacked.
      Overrides:
      attackEntityFrom in class Entity
    • writeEntityToNBT

      public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
      (abstract) Protected helper method to write subclass entity data to NBT.
      Specified by:
      writeEntityToNBT in class Entity
    • readEntityFromNBT

      public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
      (abstract) Protected helper method to read subclass entity data from NBT.
      Specified by:
      readEntityFromNBT in class Entity
    • onCollideWithPlayer

      public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
      Called by a player entity when they collide with an entity
      Overrides:
      onCollideWithPlayer in class Entity
    • getEntityName

      public String getEntityName()
      Gets the username of the entity.
      Overrides:
      getEntityName in class Entity
    • canAttackWithItem

      public boolean canAttackWithItem()
      If returns false, the item will not inflict any damage against entities.
      Overrides:
      canAttackWithItem in class Entity
    • travelToDimension

      public void travelToDimension(int par1)
      Teleports the entity to another dimension. Params: Dimension number to teleport to
      Overrides:
      travelToDimension in class Entity
    • getEntityItem

      public ItemStack getEntityItem()
      Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an ItemStack containing Block.stone)
    • setEntityItemStack

      public void setEntityItemStack(ItemStack par1ItemStack)
      Sets the ItemStack for this entity
    • doBlockCollisions

      protected void doBlockCollisions()
      Description copied from class: Entity
      // +++START EDIT+++ // ---END EDIT--- Checks for block collisions, and calls the associated onBlockCollided method for the collided block.
      Overrides:
      doBlockCollisions in class Entity
    • fall

      protected void fall(float fFallDistance)
      Description copied from class: Entity
      Called when the mob is falling. Calculates and applies fall damage.
      Overrides:
      fall in class Entity
    • pushOutOfBlocks

      protected boolean pushOutOfBlocks(double par1, double par3, double par5)
      Description copied from class: Entity
      Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z
      Overrides:
      pushOutOfBlocks in class Entity
    • isItemEntity

      public boolean isItemEntity()
      Overrides:
      isItemEntity in class Entity
    • canEntityTriggerTripwire

      public boolean canEntityTriggerTripwire()
      Overrides:
      canEntityTriggerTripwire in class Entity
    • setEntityItemAsDroppedOnPlayerDeath

      public void setEntityItemAsDroppedOnPlayerDeath(EntityPlayer player)
    • installationIntegrityTestEntityItem

      public static boolean installationIntegrityTestEntityItem()