Package net.minecraft.entity
Class Entity
- java.lang.Object
-
- net.zxmushroom63.plugins.BaseData
-
- net.zxmushroom63.plugins.PluginData
-
- net.minecraft.entity.Entity
-
- All Implemented Interfaces:
org.teavm.jso.JSObject
- Direct Known Subclasses:
EntityArrow,EntityBoat,EntityDragonPart,EntityEnderCrystal,EntityEnderEye,EntityFallingBlock,EntityFireball,EntityFireworkRocket,EntityFishHook,EntityFX,EntityHanging,EntityItem,EntityLivingBase,EntityMinecart,EntityThrowable,EntityTNTPrimed,EntityWeatherEffect,EntityXPOrb
public abstract class Entity extends PluginData
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback
-
-
Field Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChatMessage(IChatComponent var1)+ Send a chat message to the CommandSendervoidaddEntityCrashInfo(CrashReportCategory category)voidaddToPlayerScore(Entity entityIn, int amount)+ Adds a value to the player score.voidaddVelocity(double x, double y, double z)+ Adds to the current velocity of the entity.protected voidapplyEnchantments(EntityLivingBase entityLivingBaseIn, Entity entityIn)voidapplyEntityCollision(Entity entityIn)+ Applies a velocity to each of the entities pushing them away from each other.booleanattackEntityFrom(DamageSource damagesource, float var2)+ Called when the entity is attacked.booleancanAttackWithItem()+ If returns false, the item will not inflict any damage against entities.booleancanBeCollidedWith()+ Returns true if other Entities should be prevented from moving through this Entity.booleancanBePushed()+ Returns true if this entity should push and be pushed by other entities when colliding.booleancanCommandSenderUseCommand(int var1, java.lang.String var2)+ Returnstrueif the CommandSender is allowed to execute the command,falseif notbooleancanRenderOnFire()+ Return whether this entity should be rendered as on fire.protected booleancanTriggerWalking()+ returns if this entity triggers Block.onEntityWalking on the blocks they walk on.voidclientUpdateEntityNBT(NBTTagCompound compound)+ Called when client receives entity's NBTTagCompound from server.voidcopyDataFromOld(Entity entityIn)+ Prepares this entity in new dimension by copying NBT data from entity in old dimensionvoidcopyLocationAndAnglesFrom(Entity entityIn)+ Sets this entity's location and angles to the location and angles of the passed in entity.protected voidcreateRunningParticles()protected voiddealFireDamage(int amount)+ Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage.protected voiddoBlockCollisions()booleandoesEntityNotTriggerPressurePlate()+ Return whether this entity should NOT trigger a pressure plate or a tripwire.EntityItemdropItem(Item itemIn, int size)EntityItemdropItemWithOffset(Item itemIn, int size, float offsetY)EntityItementityDropItem(ItemStack itemStackIn, float offsetY)+ Drops an item at the position of the entity.protected abstract voidentityInit()booleanequals(java.lang.Object object)voidextinguish()+ Removes fire from entity.voidfall(float distance, float damageMultiplier)voidfromNBT(java.lang.String nbt)EnumFacingfunc_181012_aH()voidfunc_181013_g(float parFloat1)Vec3func_181014_aG()voidfunc_181015_d(BlockPos parBlockPos)intgetAir()booleangetAlwaysRenderNameTag()booleangetAlwaysRenderNameTagForRender()floatgetBrightness(float var1)+ Gets how bright this entity is.intgetBrightnessForRender(float var1)floatgetCollisionBorderSize()AxisAlignedBBgetCollisionBoundingBox()+ Returns the collision bounding box for this entityAxisAlignedBBgetCollisionBox(Entity entityIn)+ Returns a boundingBox used to collide the entity with other entities and blocks.EntitygetCommandSenderEntity()+ Returns the entity associated with the command sender.java.lang.StringgetCustomNameTag()DataWatchergetDataWatcher()IChatComponentgetDisplayName()+ Get the formatted ChatComponent that will be used for the sender's username in chatdoublegetDistance(double x, double y, double z)+ Gets the distance to the position.doublegetDistanceSq(double x, double y, double z)+ Gets the squared distance to the position.doublegetDistanceSq(BlockPos pos)+ Gets the squared distance to the position.doublegetDistanceSqToCenter(BlockPos pos)doublegetDistanceSqToEntity(Entity entityIn)+ Returns the squared distance to the entity.floatgetDistanceToEntity(Entity entityIn)+ Returns the distance to the entity.AxisAlignedBBgetEntityBoundingBox()intgetEntityId()protected java.lang.StringgetEntityString()+ Returns the string that identifies this Entity's classWorldgetEntityWorld()+ Get the world, if available.floatgetExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn)+ Explosion resistance of a block relative to this entityfloatgetEyeHeight()protected booleangetFlag(int flag)+ Returns true if the flag is active for the entity.EnumFacinggetHorizontalFacing()protected HoverEventgetHoverEvent()ItemStack[]getInventory()+ returns the inventory of this entity (only used in EntityPlayerMP it seems)Vec3getLook(float partialTicks)+ interpolated look vectorVec3getLookVec()+ returns a (normalized) vector of where this entity is lookingintgetMaxFallHeight()+ The maximum height from where the entity is alowed to jump (used in pathfinder)intgetMaxInPortalTime()+ Return the amount of time this entity should stay in a portal before being transported.doublegetMountedYOffset()+ Returns the Y offset from the entity's position for any entity riding this one.java.lang.StringgetName()+ Gets the name of this command sender (usually username, but possibly "Rcon")NBTTagCompoundgetNBTTagCompound()Entity[]getParts()+ Return the Entity parts making up this Entity (currently only for dragons)intgetPortalCooldown()+ Return the amount of cooldown before this entity can use a portal again.BlockPosgetPosition()+ Get the position in the world.Vec3getPositionEyes(float partialTicks)Vec3getPositionVector()+ Get the position vector.floatgetRotationYawHead()protected java.lang.StringgetSplashSound()protected java.lang.StringgetSwimSound()EaglercraftUUIDgetUniqueID()protected Vec3getVectorForRotation(float pitch, float yaw)+ Creates a Vec3 using the pitch and yaw of the entities rotation.doublegetYOffset()+ Returns the Y Offset of this entity.voidhandleStatusUpdate(byte id)booleanhandleWaterMovement()+ Returns if this entity is in water and will end up adding the waters velocity to the entitybooleanhasCustomName()+ Returns true if this thing is namedinthashCode()booleanhitByEntity(Entity entityIn)+ Called when a player attacks an entity.booleaninteractAt(EntityPlayer player, Vec3 targetVec3)+ New version of interactWith that includes vector information on where precisely the player targeted.booleaninteractFirst(EntityPlayer playerIn)+ First layer of player interactionbooleanisBurning()+ Returns true if the entity is on fire.booleanisEating()booleanisEntityAlive()+ Checks whether target entity is alive.booleanisEntityEqual(Entity entityIn)+ Returns true if Entity argument is equal to this EntitybooleanisEntityInsideOpaqueBlock()+ Checks if this entity is inside of an opaque blockbooleanisEntityInvulnerable(DamageSource source)booleanisImmuneToExplosions()booleanisImmuneToFire()booleanisInLava()booleanisInRangeToRender3d(double x, double y, double z)booleanisInRangeToRenderDist(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: distancebooleanisInsideOfMaterial(Material materialIn)+ Checks if the current block the entity is within of the specified material typebooleanisInvisible()booleanisInvisibleToPlayer(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.booleanisInWater()+ Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true)booleanisOffsetPositionInLiquid(double x, double y, double z)+ Checks if the offset position from the entity's current position is inside of liquid.booleanisOutsideBorder()booleanisPushedByWater()booleanisRiding()+ Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for players.booleanisSilent()+booleanisSneaking()+ Returns if this entity is sneaking.booleanisSprinting()+ Get if the Entity is sprinting.booleanisWet()+ Checks if this entity is either in water or on an open air block in rain (used in wolves).protected voidkill()+ sets the dead flag.voidloadPluginData(BaseData data)PluginDatamakePluginData()voidmountEntity(Entity entity)+ Called when a player mounts an entity.voidmoveEntity(double x, double y, double z)+ Tries to moves the entity by the passed in displacement.voidmoveFlying(float strafe, float forward, float friction)+ Used in both water and by flying objectsvoidmoveToBlockPosAndAngles(BlockPos pos, float rotationYawIn, float rotationPitchIn)protected NBTTagListnewDoubleNBTList(double... numbers)+ creates a NBT list from the array of doubles passed to this functionprotected NBTTagListnewFloatNBTList(float... numbers)+ Returns a new NBTTagList filled with the specified floatsvoidonChunkLoad()voidonCollideWithPlayer(EntityPlayer parEntityPlayer)+ Called by a player entity when they collide with an entityvoidonDataWatcherUpdate(int dataID)voidonEntityUpdate()+ Gets called every tick from main Entity classvoidonKillCommand()+ Called by the /kill command.voidonKillEntity(EntityLivingBase entityLivingIn)+ This method gets called when the entity kills another one.voidonStruckByLightning(EntityLightningBolt lightningBolt)+ Called when a lightning bolt hits the entity.voidonUpdate()+ Called to update the entity's position/logic.voidperformHurtAnimation()+ Setups the entity to do the hurt animation.voidplaySound(java.lang.String s, float f, float f1)protected voidplayStepSound(BlockPos pos, Block blockIn)protected voidpreparePlayerToSpawn()+ 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)protected booleanpushOutOfBlocks(double d0, double d1, double d2)MovingObjectPositionrayTrace(double blockReachDistance, float partialTicks)protected abstract voidreadEntityFromNBT(NBTTagCompound var1)voidreadFromNBT(NBTTagCompound tagCompund)+ Reads the entity from NBT (calls an abstract helper method to read specialized data)booleanreplaceItemInInventory(int inventorySlot, ItemStack itemStackIn)protected voidresetHeight()+ sets the players height back to normal after doing things like sleeping and dieingbooleansendCommandFeedback()+ Returns true if the command sender should be sent feedback about executed commandsvoidsetAir(int air)voidsetAlwaysRenderNameTag(boolean alwaysRenderNameTag)voidsetAngles(float yaw, float pitch)+ Adds 15% to the entity's yaw and subtracts 15% from the pitch.protected voidsetBeenAttacked()+ Sets that this entity has been attacked.voidsetCurrentItemOrArmor(int var1, ItemStack var2)+ Sets the held item, or an armor slot.voidsetCustomNameTag(java.lang.String name)+ Sets the custom name tag for this entityvoidsetDead()+ Will get destroyed next tick.voidsetEating(boolean eating)voidsetEntityBoundingBox(AxisAlignedBB bb)voidsetEntityId(int id)voidsetFire(int seconds)+ Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.protected voidsetFlag(int flag, boolean set)+ Enable or disable a entity flag, see getEntityFlag to read the know flags.voidsetInvisible(boolean invisible)voidsetInWeb()+ Sets the Entity inside a web block.voidsetLocationAndAngles(double x, double y, double z, float yaw, float pitch)+ Sets the location and Yaw/Pitch of an entity in the worldprotected voidsetOnFireFromLava()+ Called whenever the entity is walking inside of lava.voidsetOutsideBorder(boolean outsideBorder)voidsetPosition(double x, double y, double z)+ Sets the x,y,z of the entity from the given parameters.voidsetPositionAndRotation(double x, double y, double z, float yaw, float pitch)+ Sets the entity's position and rotation.voidsetPositionAndRotation2(double d0, double d1, double d2, float f, float f1, int var9, boolean var10)voidsetPositionAndUpdate(double d0, double d1, double d2)+ Sets the position of the entity and updates the 'last' variablesprotected voidsetRotation(float yaw, float pitch)+ Sets the rotation of the entity.voidsetRotationYawHead(float rotation)+ Sets the head's yaw rotation of the entity.voidsetSilent(boolean isSilent)+ When set to true the entity will not play sounds.protected voidsetSize(float f, float f1)+ Sets the width and height of the entity.voidsetSneaking(boolean sneaking)+ Sets the sneaking flag.voidsetSprinting(boolean flag)+ Set sprinting switch for Entity.voidsetVelocity(double x, double y, double z)+ Sets the velocity to the args.voidsetWorld(World worldIn)+ Sets the reference to the World object.protected booleanshouldSetPosAfterLoading()voidspawnRunningParticles()+ Attempts to create sprinting particles if the entity is sprinting and not in water.java.lang.StringtoNBT()java.lang.StringtoString()voidtravelToDimension(int i)+ Teleports the entity to another dimension.protected voidupdateFallState(double d0, boolean flag, Block block, BlockPos blockpos)voidupdateRidden()+ Handles updating while being ridden by an entityvoidupdateRiderPosition()booleanverifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float parFloat1)protected abstract voidwriteEntityToNBT(NBTTagCompound var1)booleanwriteMountToNBT(NBTTagCompound tagCompund)+ Like writeToNBTOptional but does not check if the entity is ridden.voidwriteToNBT(NBTTagCompound tagCompund)+ Save the entity to NBT (calls an abstract helper method to write extra data)booleanwriteToNBTOptional(NBTTagCompound tagCompund)+ Either write this entity to the NBT tag given and return true, or return false without doing anything.-
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull
-
-
-
-
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
-
rand
protected EaglercraftRandom rand
-
ticksExisted
public int ticksExisted
-
fireResistance
public int fireResistance
-
inWater
protected boolean inWater
-
hurtResistantTime
public int hurtResistantTime
-
firstUpdate
protected boolean firstUpdate
-
isImmuneToFire
protected boolean isImmuneToFire
-
dataWatcher
protected DataWatcher dataWatcher
-
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
-
entityUniqueID
protected EaglercraftUUID entityUniqueID
-
-
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()
-
getDataWatcher
public DataWatcher getDataWatcher()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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()
-
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
-
dropItem
public EntityItem dropItem(Item itemIn, int size)
-
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:
toStringin classjava.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
-
verifyExplosion
public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float parFloat1)
-
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.
-
addEntityCrashInfo
public void addEntityCrashInfo(CrashReportCategory category)
-
canRenderOnFire
public boolean canRenderOnFire()
+ Return whether this entity should be rendered as on fire.
-
getUniqueID
public EaglercraftUUID getUniqueID()
-
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)+ Returnstrueif the CommandSender is allowed to execute the command,falseif not
-
getPosition
public BlockPos getPosition()
+ Get the position in the world.nullis 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.nullis 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.nullis 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
-
getNBTTagCompound
public NBTTagCompound getNBTTagCompound()
-
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)
-
-