net.minecraft.entity.item

## Class EntityItem

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.item.EntityItem

-     public class EntityItem
      extends Entity

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `age` The age of this EntityItem (used to animate it up and down as well as expire it)
    `int` | `delayBeforeCanPickup`
    `float` | `hoverStart` The EntityItem's random initial float height.
    `int` | `lifespan` The maximum age of this EntityItem.

    - ### Fields inherited from class net.minecraft.entity.Entity

      `addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, cloakUrl, dimension, distanceWalkedModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, field_82151_R, field_98038_p, fireResistance, height, hurtResistantTime, ignoreFrustumCheck, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, skinUrl, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityItem(World par1World)`
    `EntityItem(World par1World, double par2, double par4, double par6)`
    `EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `attackEntityFrom(DamageSource par1DamageSource, int par2)` Called when the entity is attacked.
    `boolean` | `canAttackWithItem()` If returns false, the item will not inflict any damage against entities.
    `boolean` | `combineItems(EntityItem par1EntityItem)` Tries to merge this item with the item passed as the parameter.
    `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)
    `String` | `getEntityName()` Gets the username of the entity.
    `boolean` | `handleWaterMovement()` Returns if this entity is in water and will end up adding the waters velocity to the entity
    `void` | `onCollideWithPlayer(EntityPlayer par1EntityPlayer)` Called by a player entity when they collide with an entity
    `void` | `onUpdate()` Called to update the entity's position/logic.
    `void` | `readEntityFromNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to read subclass entity data from NBT.
    `void` | `setAgeToCreativeDespawnTime()` sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five).
    `void` | `setEntityItemStack(ItemStack par1ItemStack)` Sets the ItemStack for this entity
    `void` | `travelToDimension(int par1)` Teleports the entity to another dimension.
    `void` | `writeEntityToNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to write subclass entity data to NBT.

    - ### Methods inherited from class net.minecraft.entity.Entity

      `addEntityID, addToPlayerScore, addVelocity, applyEntityCollision, canBeCollidedWith, canBePushed, canRenderOnFire, copyDataFrom, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_82143_as, func_82146_a, func_82148_at, func_82149_j, func_85029_a, func_85031_j, func_96090_ax, func_96091_a, func_96092_aw, func_98034_c, func_98035_c, getAir, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getEyeHeight, getHasActivePotion, getLastActiveItems, getLookVec, getMaxInPortalTime, getMountedYOffset, getParts, getPersistentID, getPickedResult, getPortalCooldown, getRotationYawHead, getShadowSize, getTexture, getYOffset, handleHealthUpdate, handleLavaMovement, hashCode, interact, isBurning, isCreatureType, isEating, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInWater, isOffsetPositionInLiquid, isRiding, isSneaking, isSprinting, isWet, mountEntity, moveEntity, moveFlying, onEntityUpdate, onKillEntity, onStruckByLightning, performHurtAnimation, playSound, readFromNBT, resetEntityId, setAir, setAngles, setCurrentItemOrArmor, setDead, setEating, setFire, setHasActivePotion, setInPortal, setInWeb, setLocationAndAngles, setPosition, setPositionAndRotation, setPositionAndRotation2, setRotationYawHead, setSneaking, setSprinting, setVelocity, setWorld, shouldRenderInPass, shouldRiderSit, toString, unmountEntity, updateCloak, updateRidden, updateRiderPosition, writeToNBT`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### 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.

    - #### lifespan

          public int lifespan

      The maximum age of this EntityItem. The item is expired once this is reached.

  - ### Constructor Detail

    - #### 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 Detail

    - #### 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`

    - #### attackEntityFrom

          public boolean attackEntityFrom(DamageSource par1DamageSource,
                                 int 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.

    - #### readEntityFromNBT

          public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to read subclass entity data from NBT.

    - #### 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