Class Entity

    • Field Detail

      • renderDistanceWeight

        public double renderDistanceWeight
      • preventEntitySpawning

        public boolean preventEntitySpawning
      • riddenByEntity

        public Entity riddenByEntity
      • ridingEntity

        public Entity ridingEntity
      • forceSpawn

        public boolean forceSpawn
      • worldObj

        public World worldObj
      • prevPosX

        public double prevPosX
      • prevPosY

        public double prevPosY
      • prevPosZ

        public double prevPosZ
      • posX

        public double posX
      • posY

        public double posY
      • posZ

        public double posZ
      • motionX

        public double motionX
      • motionY

        public double motionY
      • motionZ

        public double motionZ
      • rotationYaw

        public float rotationYaw
      • rotationPitch

        public float rotationPitch
      • prevRotationYaw

        public float prevRotationYaw
      • prevRotationPitch

        public float prevRotationPitch
      • onGround

        public boolean onGround
      • isCollidedHorizontally

        public boolean isCollidedHorizontally
      • isCollidedVertically

        public boolean isCollidedVertically
      • isCollided

        public boolean isCollided
      • velocityChanged

        public boolean velocityChanged
      • isInWeb

        public boolean isInWeb
      • isDead

        public boolean isDead
      • width

        public float width
      • height

        public float height
      • prevDistanceWalkedModified

        public float prevDistanceWalkedModified
      • distanceWalkedModified

        public float distanceWalkedModified
      • distanceWalkedOnStepModified

        public float distanceWalkedOnStepModified
      • fallDistance

        public float fallDistance
      • lastTickPosX

        public double lastTickPosX
      • lastTickPosY

        public double lastTickPosY
      • lastTickPosZ

        public double lastTickPosZ
      • stepHeight

        public float stepHeight
      • noClip

        public boolean noClip
      • entityCollisionReduction

        public float entityCollisionReduction
      • ticksExisted

        public int ticksExisted
      • fireResistance

        public int fireResistance
      • inWater

        protected boolean inWater
      • hurtResistantTime

        public int hurtResistantTime
      • firstUpdate

        protected boolean firstUpdate
      • isImmuneToFire

        protected boolean isImmuneToFire
      • addedToChunk

        public boolean addedToChunk
      • chunkCoordX

        public int chunkCoordX
      • chunkCoordY

        public int chunkCoordY
      • chunkCoordZ

        public int chunkCoordZ
      • serverPosX

        public int serverPosX
      • serverPosY

        public int serverPosY
      • serverPosZ

        public int serverPosZ
      • ignoreFrustumCheck

        public boolean ignoreFrustumCheck
      • isAirBorne

        public boolean isAirBorne
      • timeUntilPortal

        public int timeUntilPortal
      • inPortal

        protected boolean inPortal
      • portalCounter

        protected int portalCounter
      • dimension

        public int dimension
      • field_181016_an

        protected BlockPos field_181016_an
      • field_181017_ao

        protected Vec3 field_181017_ao
      • field_181018_ap

        protected EnumFacing field_181018_ap
    • Constructor Detail

      • Entity

        public Entity​(World worldIn)
    • Method Detail

      • getEntityId

        public int getEntityId()
      • setEntityId

        public void setEntityId​(int id)
      • onKillCommand

        public void onKillCommand()
        + Called by the /kill command.
      • entityInit

        protected abstract void entityInit()
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • preparePlayerToSpawn

        protected void preparePlayerToSpawn()
        + Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned (only actually used on players though its also on Entity)
      • setDead

        public void setDead()
        + Will get destroyed next tick.
      • setSize

        protected void setSize​(float f,
                               float f1)
        + Sets the width and height of the entity. Args: width, height
      • setRotation

        protected void setRotation​(float yaw,
                                   float pitch)
        + Sets the rotation of the entity. Args: yaw, pitch (both in degrees)
      • setPosition

        public void setPosition​(double x,
                                double y,
                                double z)
        + Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box.
      • setAngles

        public void setAngles​(float yaw,
                              float pitch)
        + Adds 15% to the entity's yaw and subtracts 15% from the pitch. Clamps pitch from -90 to 90. Both arguments in degrees.
      • onUpdate

        public void onUpdate()
        + Called to update the entity's position/logic.
      • onEntityUpdate

        public void onEntityUpdate()
        + Gets called every tick from main Entity class
      • getMaxInPortalTime

        public int getMaxInPortalTime()
        + Return the amount of time this entity should stay in a portal before being transported.
      • setOnFireFromLava

        protected void setOnFireFromLava()
        + Called whenever the entity is walking inside of lava.
      • setFire

        public void setFire​(int seconds)
        + Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.
      • extinguish

        public void extinguish()
        + Removes fire from entity.
      • kill

        protected void kill()
        + sets the dead flag. Used when you fall off the bottom of the world.
      • isOffsetPositionInLiquid

        public boolean isOffsetPositionInLiquid​(double x,
                                                double y,
                                                double z)
        + Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z
      • moveEntity

        public void moveEntity​(double x,
                               double y,
                               double z)
        + Tries to moves the entity by the passed in displacement. Args: x, y, z
      • getSwimSound

        protected java.lang.String getSwimSound()
      • doBlockCollisions

        protected void doBlockCollisions()
      • playStepSound

        protected void playStepSound​(BlockPos pos,
                                     Block blockIn)
      • playSound

        public void playSound​(java.lang.String s,
                              float f,
                              float f1)
      • isSilent

        public boolean isSilent()
        +
        Returns:
        True if this entity will not play sounds
      • setSilent

        public void setSilent​(boolean isSilent)
        + When set to true the entity will not play sounds.
      • 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
      • updateFallState

        protected void updateFallState​(double d0,
                                       boolean flag,
                                       Block block,
                                       BlockPos blockpos)
      • getCollisionBoundingBox

        public AxisAlignedBB getCollisionBoundingBox()
        + Returns the collision bounding box for this entity
      • dealFireDamage

        protected void dealFireDamage​(int amount)
        + Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage
      • isImmuneToFire

        public final boolean isImmuneToFire()
      • fall

        public void fall​(float distance,
                         float damageMultiplier)
      • isWet

        public boolean isWet()
        + Checks if this entity is either in water or on an open air block in rain (used in wolves).
      • isInWater

        public boolean isInWater()
        + Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true)
      • loadPluginData

        public void loadPluginData​(BaseData data)
      • makePluginData

        public PluginData makePluginData()
      • handleWaterMovement

        public boolean handleWaterMovement()
        + Returns if this entity is in water and will end up adding the waters velocity to the entity
      • resetHeight

        protected void resetHeight()
        + sets the players height back to normal after doing things like sleeping and dieing
      • spawnRunningParticles

        public void spawnRunningParticles()
        + Attempts to create sprinting particles if the entity is sprinting and not in water.
      • createRunningParticles

        protected void createRunningParticles()
      • getSplashSound

        protected java.lang.String getSplashSound()
      • isInsideOfMaterial

        public boolean isInsideOfMaterial​(Material materialIn)
        + Checks if the current block the entity is within of the specified material type
      • isInLava

        public boolean isInLava()
      • moveFlying

        public void moveFlying​(float strafe,
                               float forward,
                               float friction)
        + Used in both water and by flying objects
      • getBrightnessForRender

        public int getBrightnessForRender​(float var1)
      • getBrightness

        public float getBrightness​(float var1)
        + Gets how bright this entity is.
      • setWorld

        public void setWorld​(World worldIn)
        + Sets the reference to the World object.
      • setPositionAndRotation

        public void setPositionAndRotation​(double x,
                                           double y,
                                           double z,
                                           float yaw,
                                           float pitch)
        + Sets the entity's position and rotation.
      • moveToBlockPosAndAngles

        public void moveToBlockPosAndAngles​(BlockPos pos,
                                            float rotationYawIn,
                                            float rotationPitchIn)
      • setLocationAndAngles

        public void setLocationAndAngles​(double x,
                                         double y,
                                         double z,
                                         float yaw,
                                         float pitch)
        + Sets the location and Yaw/Pitch of an entity in the world
      • getDistanceToEntity

        public float getDistanceToEntity​(Entity entityIn)
        + Returns the distance to the entity. Args: entity
      • getDistanceSq

        public double getDistanceSq​(double x,
                                    double y,
                                    double z)
        + Gets the squared distance to the position. Args: x, y, z
      • getDistanceSq

        public double getDistanceSq​(BlockPos pos)
        + Gets the squared distance to the position. Args: x, y, z
      • getDistanceSqToCenter

        public double getDistanceSqToCenter​(BlockPos pos)
      • getDistance

        public double getDistance​(double x,
                                  double y,
                                  double z)
        + Gets the distance to the position. Args: x, y, z
      • getDistanceSqToEntity

        public double getDistanceSqToEntity​(Entity entityIn)
        + Returns the squared distance to the entity. Args: entity
      • onCollideWithPlayer

        public void onCollideWithPlayer​(EntityPlayer parEntityPlayer)
        + Called by a player entity when they collide with an entity
      • applyEntityCollision

        public void applyEntityCollision​(Entity entityIn)
        + Applies a velocity to each of the entities pushing them away from each other. Args: entity
      • addVelocity

        public void addVelocity​(double x,
                                double y,
                                double z)
        + Adds to the current velocity of the entity. Args: x, y, z
      • setBeenAttacked

        protected void setBeenAttacked()
        + Sets that this entity has been attacked.
      • attackEntityFrom

        public boolean attackEntityFrom​(DamageSource damagesource,
                                        float var2)
        + Called when the entity is attacked.
      • getLook

        public Vec3 getLook​(float partialTicks)
        + interpolated look vector
      • getVectorForRotation

        protected final Vec3 getVectorForRotation​(float pitch,
                                                  float yaw)
        + Creates a Vec3 using the pitch and yaw of the entities rotation.
      • getPositionEyes

        public Vec3 getPositionEyes​(float partialTicks)
      • rayTrace

        public MovingObjectPosition rayTrace​(double blockReachDistance,
                                             float partialTicks)
      • canBeCollidedWith

        public boolean canBeCollidedWith()
        + Returns true if other Entities should be prevented from moving through this Entity.
      • canBePushed

        public boolean canBePushed()
        + Returns true if this entity should push and be pushed by other entities when colliding.
      • addToPlayerScore

        public void addToPlayerScore​(Entity entityIn,
                                     int amount)
        + Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, scoreToAdd
      • isInRangeToRender3d

        public boolean isInRangeToRender3d​(double x,
                                           double y,
                                           double z)
      • isInRangeToRenderDist

        public boolean isInRangeToRenderDist​(double distance)
        + Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length * 64 * renderDistanceWeight Args: distance
      • writeMountToNBT

        public boolean writeMountToNBT​(NBTTagCompound tagCompund)
        + Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their riders.
      • writeToNBTOptional

        public boolean writeToNBTOptional​(NBTTagCompound tagCompund)
        + Either write this entity to the NBT tag given and return true, or return false without doing anything. If this returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider.
      • writeToNBT

        public void writeToNBT​(NBTTagCompound tagCompund)
        + Save the entity to NBT (calls an abstract helper method to write extra data)
      • readFromNBT

        public void readFromNBT​(NBTTagCompound tagCompund)
        + Reads the entity from NBT (calls an abstract helper method to read specialized data)
      • shouldSetPosAfterLoading

        protected boolean shouldSetPosAfterLoading()
      • getEntityString

        protected final java.lang.String getEntityString()
        + Returns the string that identifies this Entity's class
      • readEntityFromNBT

        protected abstract void readEntityFromNBT​(NBTTagCompound var1)
      • writeEntityToNBT

        protected abstract void writeEntityToNBT​(NBTTagCompound var1)
      • onChunkLoad

        public void onChunkLoad()
      • newDoubleNBTList

        protected NBTTagList newDoubleNBTList​(double... numbers)
        + creates a NBT list from the array of doubles passed to this function
      • newFloatNBTList

        protected NBTTagList newFloatNBTList​(float... numbers)
        + Returns a new NBTTagList filled with the specified floats
      • dropItemWithOffset

        public EntityItem dropItemWithOffset​(Item itemIn,
                                             int size,
                                             float offsetY)
      • entityDropItem

        public EntityItem entityDropItem​(ItemStack itemStackIn,
                                         float offsetY)
        + Drops an item at the position of the entity.
      • isEntityAlive

        public boolean isEntityAlive()
        + Checks whether target entity is alive.
      • isEntityInsideOpaqueBlock

        public boolean isEntityInsideOpaqueBlock()
        + Checks if this entity is inside of an opaque block
      • interactFirst

        public boolean interactFirst​(EntityPlayer playerIn)
        + First layer of player interaction
      • getCollisionBox

        public AxisAlignedBB getCollisionBox​(Entity entityIn)
        + Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be pushable on contact, like boats or minecarts.
      • updateRidden

        public void updateRidden()
        + Handles updating while being ridden by an entity
      • updateRiderPosition

        public void updateRiderPosition()
      • getYOffset

        public double getYOffset()
        + Returns the Y Offset of this entity.
      • getMountedYOffset

        public double getMountedYOffset()
        + Returns the Y offset from the entity's position for any entity riding this one.
      • mountEntity

        public void mountEntity​(Entity entity)
        + Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
      • setPositionAndRotation2

        public void setPositionAndRotation2​(double d0,
                                            double d1,
                                            double d2,
                                            float f,
                                            float f1,
                                            int var9,
                                            boolean var10)
      • getCollisionBorderSize

        public float getCollisionBorderSize()
      • getLookVec

        public Vec3 getLookVec()
        + returns a (normalized) vector of where this entity is looking
      • func_181015_d

        public void func_181015_d​(BlockPos parBlockPos)
      • getPortalCooldown

        public int getPortalCooldown()
        + Return the amount of cooldown before this entity can use a portal again.
      • setVelocity

        public void setVelocity​(double x,
                                double y,
                                double z)
        + Sets the velocity to the args. Args: x, y, z
      • handleStatusUpdate

        public void handleStatusUpdate​(byte id)
      • performHurtAnimation

        public void performHurtAnimation()
        + Setups the entity to do the hurt animation. Only used by packets in multiplayer.
      • getInventory

        public ItemStack[] getInventory()
        + returns the inventory of this entity (only used in EntityPlayerMP it seems)
      • setCurrentItemOrArmor

        public void setCurrentItemOrArmor​(int var1,
                                          ItemStack var2)
        + Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot
      • isBurning

        public boolean isBurning()
        + Returns true if the entity is on fire. Used by render to add the fire effect on rendering.
      • isRiding

        public boolean isRiding()
        + Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for players.
      • isSneaking

        public boolean isSneaking()
        + Returns if this entity is sneaking.
      • setSneaking

        public void setSneaking​(boolean sneaking)
        + Sets the sneaking flag.
      • isSprinting

        public boolean isSprinting()
        + Get if the Entity is sprinting.
      • setSprinting

        public void setSprinting​(boolean flag)
        + Set sprinting switch for Entity.
      • isInvisible

        public boolean isInvisible()
      • isInvisibleToPlayer

        public boolean isInvisibleToPlayer​(EntityPlayer player)
        + Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent.
      • setInvisible

        public void setInvisible​(boolean invisible)
      • isEating

        public boolean isEating()
      • setEating

        public void setEating​(boolean eating)
      • getFlag

        protected boolean getFlag​(int flag)
        + Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding something; 3) is sprinting; 4) is eating
      • setFlag

        protected void setFlag​(int flag,
                               boolean set)
        + Enable or disable a entity flag, see getEntityFlag to read the know flags.
      • getAir

        public int getAir()
      • setAir

        public void setAir​(int air)
      • onStruckByLightning

        public void onStruckByLightning​(EntityLightningBolt lightningBolt)
        + Called when a lightning bolt hits the entity.
      • onKillEntity

        public void onKillEntity​(EntityLivingBase entityLivingIn)
        + This method gets called when the entity kills another one.
      • pushOutOfBlocks

        protected boolean pushOutOfBlocks​(double d0,
                                          double d1,
                                          double d2)
      • setInWeb

        public void setInWeb()
        + Sets the Entity inside a web block.
      • getName

        public java.lang.String getName()
        + Gets the name of this command sender (usually username, but possibly "Rcon")
      • getParts

        public Entity[] getParts()
        + Return the Entity parts making up this Entity (currently only for dragons)
      • isEntityEqual

        public boolean isEntityEqual​(Entity entityIn)
        + Returns true if Entity argument is equal to this Entity
      • getRotationYawHead

        public float getRotationYawHead()
      • setRotationYawHead

        public void setRotationYawHead​(float rotation)
        + Sets the head's yaw rotation of the entity.
      • func_181013_g

        public void func_181013_g​(float parFloat1)
      • canAttackWithItem

        public boolean canAttackWithItem()
        + If returns false, the item will not inflict any damage against entities.
      • hitByEntity

        public boolean hitByEntity​(Entity entityIn)
        + Called when a player attacks an entity. If this returns true the attack will not happen.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isEntityInvulnerable

        public boolean isEntityInvulnerable​(DamageSource source)
      • copyLocationAndAnglesFrom

        public void copyLocationAndAnglesFrom​(Entity entityIn)
        + Sets this entity's location and angles to the location and angles of the passed in entity.
      • copyDataFromOld

        public void copyDataFromOld​(Entity entityIn)
        + Prepares this entity in new dimension by copying NBT data from entity in old dimension
      • toNBT

        public java.lang.String toNBT()
      • fromNBT

        public void fromNBT​(java.lang.String nbt)
      • travelToDimension

        public void travelToDimension​(int i)
        + Teleports the entity to another dimension. Params: Dimension number to teleport to
      • getExplosionResistance

        public float getExplosionResistance​(Explosion explosionIn,
                                            World worldIn,
                                            BlockPos pos,
                                            IBlockState blockStateIn)
        + Explosion resistance of a block relative to this entity
      • getMaxFallHeight

        public int getMaxFallHeight()
        + The maximum height from where the entity is alowed to jump (used in pathfinder)
      • func_181014_aG

        public Vec3 func_181014_aG()
      • func_181012_aH

        public EnumFacing func_181012_aH()
      • doesEntityNotTriggerPressurePlate

        public boolean doesEntityNotTriggerPressurePlate()
        + Return whether this entity should NOT trigger a pressure plate or a tripwire.
      • canRenderOnFire

        public boolean canRenderOnFire()
        + Return whether this entity should be rendered as on fire.
      • isPushedByWater

        public boolean isPushedByWater()
      • getDisplayName

        public IChatComponent getDisplayName()
        + Get the formatted ChatComponent that will be used for the sender's username in chat
      • setCustomNameTag

        public void setCustomNameTag​(java.lang.String name)
        + Sets the custom name tag for this entity
      • getCustomNameTag

        public java.lang.String getCustomNameTag()
      • hasCustomName

        public boolean hasCustomName()
        + Returns true if this thing is named
      • setAlwaysRenderNameTag

        public void setAlwaysRenderNameTag​(boolean alwaysRenderNameTag)
      • getAlwaysRenderNameTag

        public boolean getAlwaysRenderNameTag()
      • setPositionAndUpdate

        public void setPositionAndUpdate​(double d0,
                                         double d1,
                                         double d2)
        + Sets the position of the entity and updates the 'last' variables
      • getAlwaysRenderNameTagForRender

        public boolean getAlwaysRenderNameTagForRender()
      • onDataWatcherUpdate

        public void onDataWatcherUpdate​(int dataID)
      • getHorizontalFacing

        public EnumFacing getHorizontalFacing()
      • getHoverEvent

        protected HoverEvent getHoverEvent()
      • getEntityBoundingBox

        public AxisAlignedBB getEntityBoundingBox()
      • setEntityBoundingBox

        public void setEntityBoundingBox​(AxisAlignedBB bb)
      • getEyeHeight

        public float getEyeHeight()
      • isOutsideBorder

        public boolean isOutsideBorder()
      • setOutsideBorder

        public void setOutsideBorder​(boolean outsideBorder)
      • replaceItemInInventory

        public boolean replaceItemInInventory​(int inventorySlot,
                                              ItemStack itemStackIn)
      • addChatMessage

        public void addChatMessage​(IChatComponent var1)
        + Send a chat message to the CommandSender
      • canCommandSenderUseCommand

        public boolean canCommandSenderUseCommand​(int var1,
                                                  java.lang.String var2)
        + Returns true if the CommandSender is allowed to execute the command, false if not
      • getPosition

        public BlockPos getPosition()
        + Get the position in the world. null is not allowed! If you are not an entity in the world, return the coordinates 0, 0, 0
      • getPositionVector

        public Vec3 getPositionVector()
        + Get the position vector. null is not allowed! If you are not an entity in the world, return 0.0D, 0.0D, 0.0D
      • getEntityWorld

        public World getEntityWorld()
        + Get the world, if available. null is not allowed! If you are not an entity in the world, return the overworld
      • getCommandSenderEntity

        public Entity getCommandSenderEntity()
        + Returns the entity associated with the command sender. MAY BE NULL!
      • sendCommandFeedback

        public boolean sendCommandFeedback()
        + Returns true if the command sender should be sent feedback about executed commands
      • clientUpdateEntityNBT

        public void clientUpdateEntityNBT​(NBTTagCompound compound)
        + Called when client receives entity's NBTTagCompound from server.
      • interactAt

        public boolean interactAt​(EntityPlayer player,
                                  Vec3 targetVec3)
        + New version of interactWith that includes vector information on where precisely the player targeted.
      • isImmuneToExplosions

        public boolean isImmuneToExplosions()
      • applyEnchantments

        protected void applyEnchantments​(EntityLivingBase entityLivingBaseIn,
                                         Entity entityIn)