Package net.minecraft.src
Class EntityItem
java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityItem
- Direct Known Subclasses:
BloodWoodSaplingItemEntity,FloatingItemEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe age of this EntityItem (used to animate it up and down as well as expire it)intfloatThe EntityItem's random initial float height.Fields inherited from class net.minecraft.src.Entity
addedToChunk, boundingBox, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastGroundPosX, lastGroundPosY, lastGroundPosZ, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, nextBlockCheckDistance, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize -
Constructor Summary
ConstructorsConstructorDescriptionEntityItem(World par1World) EntityItem(World par1World, double par2, double par4, double par6) EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) -
Method Summary
Modifier and TypeMethodDescriptionbooleanattackEntityFrom(DamageSource par1DamageSource, float par2) Called when the entity is attacked.booleanIf returns false, the item will not inflict any damage against entities.booleanprotected booleanreturns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling cropsbooleancombineItems(EntityItem par1EntityItem) Tries to merge this item with the item passed as the parameter.voiddealFireDamage(int par1) Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage.protected void// +++START EDIT+++ // ---END EDIT--- Checks for block collisions, and calls the associated onBlockCollided method for the collided block.protected voidprotected voidfall(float fFallDistance) Called when the mob is falling.Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an ItemStack containing Block.stone)Gets the username of the entity.booleanReturns if this entity is in water and will end up adding the waters velocity to the entitystatic booleanbooleanvoidonCollideWithPlayer(EntityPlayer par1EntityPlayer) Called by a player entity when they collide with an entityvoidonUpdate()Called to update the entity's position/logic.protected booleanpushOutOfBlocks(double par1, double par3, double par5) Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, zvoidreadEntityFromNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to read subclass entity data from NBT.voidsets the age of the item so that it'll despawn one minute after it has been dropped (instead of five).voidvoidsetEntityItemStack(ItemStack par1ItemStack) Sets the ItemStack for this entityvoidtravelToDimension(int par1) Teleports the entity to another dimension.voidwriteEntityToNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to write subclass entity data to NBT.Methods inherited from class net.minecraft.src.Entity
addComponent, addEntityCrashInfo, addToPlayerScore, addVelocity, appliesConstantForceWhenRidingBoat, applyEntityCollision, attractsLightning, canBeCollidedWith, canBePushed, canCollideWithEntity, canRenderOnFire, copyDataFrom, copyLocationAndAnglesFrom, doesEntityApplyToSpawnCap, doesEntityApplyToSquidPossessionCap, doesEntityNotTriggerPressurePlate, doesNotDismountInWater, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, flagAllWatchedObjectsDirty, flingAwayFromEntity, getAir, getAnimalKickMovementMultiplier, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCanBeHeadCrabbed, getCollisionBorderSize, getCollisionBox, getComponent, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityString, getEyeHeight, getFlag, getHeadCrabSharedAttackTarget, getLastActiveItems, getLookVec, getMaxInPortalTime, getMaxSafePointTries, getMountedYOffset, getParts, getPortalCooldown, getRotationYawHead, getShadowSize, getTeleportDirection, getTranslatedEntityName, getUniqueID, getVisualBoundingBox, getXZDistanceSqToEntity, getYOffset, handleHealthUpdate, handleLavaMovement, hasComponent, hashCode, hasHeadCrabbedSquid, hitByEntity, initComponents, interactFirst, isAffectedByMovementModifiers, isBeingRainedOn, isBurning, isEating, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInsideOpaqueBlock, isEntityInsideSuffocatingBlock, isEntityInsideSuffocatingBlock, isEntityInvulnerable, isImmuneToFire, isImmuneToHeadCrabDamage, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSecondaryTargetForSquid, isSneaking, isSprinting, isUsingSpecialKey, isValidOngoingAttackTargetForSquid, isValidZombieSecondaryTarget, isWet, kill, mountEntity, mountEntityRemote, moveEntity, moveFlying, movementModifierWhenRidingBoat, newDoubleNBTList, newFloatNBTList, notifyOfWolfHowl, onBlockDispenserConsume, onChunkLoad, onEntityUpdate, onFlungBySquidTentacle, onHeadCrabbedBySquid, onKickedByAnimal, onKillEntity, onPossessedRidingEntityDeath, onStruckByLightning, outOfUpdateRangeUpdate, performHurtAnimation, playSound, playStepSound, preparePlayerToSpawn, readFromNBT, setAir, setAngles, setBeenAttacked, setCurrentItemOrArmor, setDead, setEating, setFire, setFlag, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setPositionAndRotation2, setRotation, setRotationYawHead, setSize, setSneaking, setSprinting, setVelocity, setWorld, shouldExplodeBlock, shouldSetPosAfterLoading, shouldSetPositionOnLoad, toString, tryToSetFireToBlocksInContact, updateCloak, updateFallState, updateRidden, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Field Details
-
age
public int ageThe age of this EntityItem (used to animate it up and down as well as expire it) -
delayBeforeCanPickup
public int delayBeforeCanPickup -
hoverStart
public float hoverStartThe EntityItem's random initial float height.
-
-
Constructor Details
-
EntityItem
-
EntityItem
-
EntityItem
-
-
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:
canTriggerWalkingin classEntity
-
entityInit
protected void entityInit()- Specified by:
entityInitin classEntity
-
onUpdate
public void onUpdate()Called to update the entity's position/logic. -
combineItems
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:
handleWaterMovementin classEntity
-
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:
dealFireDamagein classEntity
-
attackEntityFrom
Called when the entity is attacked.- Overrides:
attackEntityFromin classEntity
-
writeEntityToNBT
(abstract) Protected helper method to write subclass entity data to NBT.- Specified by:
writeEntityToNBTin classEntity
-
readEntityFromNBT
(abstract) Protected helper method to read subclass entity data from NBT.- Specified by:
readEntityFromNBTin classEntity
-
onCollideWithPlayer
Called by a player entity when they collide with an entity- Overrides:
onCollideWithPlayerin classEntity
-
getEntityName
Gets the username of the entity.- Overrides:
getEntityNamein classEntity
-
canAttackWithItem
public boolean canAttackWithItem()If returns false, the item will not inflict any damage against entities.- Overrides:
canAttackWithItemin classEntity
-
travelToDimension
public void travelToDimension(int par1) Teleports the entity to another dimension. Params: Dimension number to teleport to- Overrides:
travelToDimensionin classEntity
-
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
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:
doBlockCollisionsin classEntity
-
fall
protected void fall(float fFallDistance) Description copied from class:EntityCalled when the mob is falling. Calculates and applies fall damage. -
pushOutOfBlocks
protected boolean pushOutOfBlocks(double par1, double par3, double par5) Description copied from class:EntityAdds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z- Overrides:
pushOutOfBlocksin classEntity
-
isItemEntity
public boolean isItemEntity()- Overrides:
isItemEntityin classEntity
-
canEntityTriggerTripwire
public boolean canEntityTriggerTripwire()- Overrides:
canEntityTriggerTripwirein classEntity
-
setEntityItemAsDroppedOnPlayerDeath
-
installationIntegrityTestEntityItem
public static boolean installationIntegrityTestEntityItem()
-