Package net.minecraft.src
Class EntityPlayer
java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityLivingBase
net.minecraft.src.EntityPlayer
- All Implemented Interfaces:
ICommandSender
- Direct Known Subclasses:
AbstractClientPlayer,EntityPlayerMP
-
Field Summary
FieldsModifier and TypeFieldDescriptionintfloatThe player's capabilities.protected floatintstatic final floatstatic final floatfloatThe current amount of experience the player has within their Experience Bar.intThe current experience level the player is on.intThe total amount of experience the player has.floatfloatdoublefloatdoubledoubledoubledoubledoubleAn instance of a fishing rod's hook.protected intUsed to tell if the player pressed jump twice.The player's food stats.static final intintInventory of the playerThe Container for the player's inventory (which opens when they press E)intintintintThe Container the player has open.The chunk coordinates of the bed the player is in (null if player isn't in a bed).floatlongprotected booleanBoolean value indicating weather a player is sleeping or not Note: Indicates whether the player is in a bed, not whether they are actually sleeping.intprotected floatprotected floatintlongprotected longprotected floatintfinal StringintUsed by EntityPlayer to prevent too many xp orbs from getting absorbed at once.Fields inherited from class net.minecraft.src.EntityLivingBase
arrowHitTimer, attackedAtYaw, attackingPlayer, attackTime, cameraPitch, dead, deathTime, entityAge, entityLivingToAttack, field_110154_aX, field_70741_aB, field_70763_ax, field_70764_aw, field_70768_au, field_70769_ao, field_70770_ap, hurtTime, isJumping, isLivingDead, isSwingInProgress, jumpMovementFactor, landMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onChoppingBlockMaxCountdown, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, recentlyOnChoppingBlockCountdown, renderYawOffset, revengeCountdown, revengeTimer, rotationYawHead, scoreValue, swingProgress, swingProgressIntFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChatMessage(String par1Str) Add a chat message to the playervoidaddExhaustion(float par1) increases exhaustion level by supplied amountvoidvoidaddExhaustionWithoutVisualFeedback(float fAmount) voidaddExperience(int par1) This method increases the player's current amount of experience.voidaddExperienceLevel(int par1) Add experience levels to this player.voidaddHarvestBlockExhaustion(int iBlockID, int iBlockI, int iBlockJ, int iBlockK, int iBlockMetadata) voidaddMovementStat(double par1, double par3, double par5) Adds a value to a movement statistic field - like run, walk, swin or climb.voidaddRawChatMessage(String message) voidaddScore(int par1) Add to player's scorebooleanvoidAdds a value to a statistic field.voidaddToPlayerScore(Entity par1Entity, int par2) Adds a value to the player score.booleanprotected voidbooleanattackEntityFrom(DamageSource par1DamageSource, float par2) Called when the entity is attacked.voidattackTargetEntityWithCurrentItem(Entity par1Entity) Attacks for the player the targeted entity with the currently equipped item.booleancanAttackPlayer(EntityPlayer par1EntityPlayer) booleancanDrink()booleancanEat(boolean par1) booleancanHarvestBlock(Block par1Block, int i, int j, int k) booleancanJump()booleancanPlayerEdit(int par1, int par2, int par3, int par4, ItemStack par5ItemStack) booleancanSwim()protected booleanreturns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling cropsvoidvoidclonePlayer(EntityPlayer par1EntityPlayer, boolean playerLeavingTheEnd) // +++START EDIT+++ Copies the values from the given player into this player if boolean playerLeavingTheEnd is true.protected voidsets current screen to null (used on escape buttons of GUIs)protected voiddamageArmor(float par1) protected voiddamageEntity(DamageSource par1DamageSource, float par2) Deals damage to the entity.protected intdecreaseAirSupply(int iAirSupply) Decrements the entity's air supply when underwatervoidDestroys the currently equipped item from the player's inventory.protected voidvoiddismountEntity(Entity riddenEntity) Moves the entity to a position out of the way of its mount.voiddisplayGUIAnvil(int par1, int par2, int par3) Displays the GUI for interacting with an anvil.voiddisplayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) Displays the GUI for interacting with a beacon.voiddisplayGUIBook(ItemStack par1ItemStack) Displays the GUI for interacting with a book.voiddisplayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) Displays the GUI for interacting with a brewing stand.voiddisplayGUIChest(IInventory par1IInventory) Displays the GUI for interacting with a chest inventory.voiddisplayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) Displays the dipsenser GUI for the passed in dispenser entity.voiddisplayGUIEditSign(TileEntity par1TileEntity) Displays the GUI for editing a sign.voiddisplayGUIEnchantment(int par1, int par2, int par3, String par4Str) voiddisplayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) Displays the furnace GUI for the passed in furnace entity.voiddisplayGUIHopper(TileEntityHopper par1TileEntityHopper) voiddisplayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) voiddisplayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) voiddisplayGUIMerchant(IMerchant par1IMerchant, String par2Str) voiddisplayGUIWorkbench(int par1, int par2, int par3) Displays the crafting GUI for a workbench.booleanprotected voiddropHead()dropOneItem(boolean par1) Called when player presses the drop item keydropPlayerItem(ItemStack par1ItemStack) Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in a workbench while the workbench'es GUI gets closed)dropPlayerItemWithRandomChoice(ItemStack par1ItemStack, boolean par2) Args: itemstack, flagprotected voidprotected voidfall(float par1) Called when the mob is falling.floatfloatthe movespeed used for the new AI systembooleanprotected doublefloatfloatWhen searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing them anyway.floatReturns the location of the bed the player will respawn at, or null if the player has not slept in a bed.floatReturns the orientation of the bed in degrees.floatbooleangetCanBeHeadCrabbed(boolean bSquidInWater) Gets the name of this command sender (usually username, but possibly "Rcon")getCurrentArmor(int par1) Returns the currently being used item by the player.getCurrentItemOrArmor(int par1) 0 = item, 1-n is armorfloatgetCurrentPlayerStrVsBlock(Block par1Block, int i, int j, int k) Returns how strong the player is against the specified block at this momentabstract <T> TgetData(DataEntry.PlayerDataEntry<T> entry) Gets the username of the entity.protected intgetExperiencePoints(EntityPlayer par1EntityPlayer) Get the experience points the entity currently has.floatReturns the player's FoodStats object.intReturns the item that this EntityLiving is holding, if any.booleanprotected booleangetHideCape(int par1) Returns the InventoryEnderChest of this player.getItemIcon(ItemStack itemStack, int index) Gets the Icon Index of the item currently heldreturns the ItemStack containing the itemInUseintReturns the item in use countintgets the duration for how long the current itemInUse has been in useprotected floatprotected floatprotected floatintReturn the amount of time this entity should stay in a portal before being transported.protected floatprotected floatfloatdoubleReturns the Y offset from the entity's position for any entity riding this one.floatintReturn the amount of cooldown before this entity can use a portal again.intgetScore()intintintintgetStatusForCategory(StatusCategory category) intintprotected floatgetTeam()longfloatReturns the translated name of the entity.intgetValidatedRespawnCoordinates(World newWorld, ChunkCoordinates respawnLocation) returns zero if a valid spawn location is found 1 = invalid forced spawn location 2 = missing beacon 3 = Beacon is out of range 4 = Area around beacon is obstructeddoubleReturns the Y Offset of this entity.voidhandleHealthUpdate(byte par1) booleanbooleanstatic booleanbooleaninteractWith(Entity par1Entity) booleanprotected booleanbooleanisCurrentToolAdventureModeExempt(int par1, int par2, int par3) Returns true if the given block can be mined with the current tool in adventure mode.booleanChecks if this entity is inside of an opaque blockbooleanbooleanisInvisibleToPlayer(EntityPlayer par1EntityPlayer) Only used by renderer in EntityLivingBase subclasses.booleanprotected booleanDead and sleeping entities cannot movebooleanreturns true if this entity is by a ladder, false otherwiseprotected booleanisPlayer()Only use is to identify if class is an instance of player for experience droppingbooleanReturns whether or not the player is asleep and the screen has fully faded.protected booleanbooleanReturns whether player is sleeping or notbooleanbooleanbooleanChecks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButtonbooleanbooleanbooleanbooleanbooleanbooleanprotected voidjoinEntityItemWithWorld(EntityItem par1EntityItem) Joins the passed in entity item with the world.voidjump()Causes this entity to do an upwards motion (jumping).voidmountEntity(Entity par1Entity) Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.voidmountEntityRemote(Entity entityToMount) Called when clients receive a packed from the server indicating that they should mount an entity as part of fix for MC-1291.voidmoveEntityWithHeading(float par1, float par2) Moves the entity based on the specified heading.doubleprotected voidonBlockedDamage(DamageSource source, int iDamage) voidvoidonCriticalHit(Entity par1Entity) Called when the player performs a critical hit on the Entity.voidonDeath(DamageSource par1DamageSource) Called when the mob's health reaches 0.voidonEnchantmentCritical(Entity par1Entity) protected voidUsed for when item use count runs out, ie: eating completedvoidonKillEntity(EntityLivingBase par1EntityLivingBase) This method gets called when the entity kills another one.voidCalled frequently so the entity can update its state every tick as required.voidonUpdate()Called to update the entity's position/logic.protected voidvoid/* the playSound function both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same playerprotected voidplayStepSound(int i, int j, int k, int iBlockID) Plays step sound at given x, y, z for the entityvoidKeeps 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)voidreadEntityFromNBT(NBTTagCompound par1NBTTagCompound) // +++START EDIT+++ // ---END EDIT--- (abstract) Protected helper method to read subclass entity data from NBT.protected voidprotected voidprotected voidsets the players height back to normal after doing things like sleeping and dieingvoidvoidvoidSends the player's abilities to the server (if there is one).voidsetAbsorptionAmount(float par1) voidsetCurrentItemOrArmor(int slot, ItemStack itemStack) Sets the held item, or an armor slot.abstract <T> voidsetData(DataEntry.PlayerDataEntry<T> entry, T value) voidsetDead()Will get destroyed next tick.voidsetGameType(EnumGameType par1EnumGameType) Sets the player's game mode and sends it to them.voidsetGloomLevel(int iGloomLevel) voidsetHasValidMagneticPointForLocation(boolean bValid) protected voidsetHideCape(int par1, boolean par2) voidsetInWeb()Sets the Entity inside a web block.voidsetItemInUse(ItemStack par1ItemStack, int par2) sets the itemInUse when the use item button is clicked.voidsetItemInUseCount(int iCount) protected voidsetMiningSpeedModifier(float modifier) voidsetScore(int par1) Set player's scorevoidsetSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2) Defines a spawn coordinate to player spawn.voidsetSpawnChunk(ChunkCoordinates coords, boolean bForced, int iDimension) voidsetSpawnChunksVisualization(int iLocationI, int iLocationJ, int iLocationK) voidsetStrongestMagneticPointForLocationI(int iLocationI) voidsetStrongestMagneticPointForLocationK(int iLocationK) voidsetTimeOfLastSpawnAssignment(long timeOfLastSpawnAssignment) voidsetTimerSpeedModifier(float timerSpeedModifier) voidsetUsingSpecialKey(boolean usingSpecialKey) booleanChecks if the player's health is not full and not zero.sleepInBedAt(int par1, int par2, int par3) Attempts to have the player sleep in a bed at the specified location.voidvoidtriggerAchievement(StatBase par1StatBase) Will trigger the specified trigger.protected voidprotected voidprotected voidupdateItemUse(ItemStack par1ItemStack, int par2) Plays sounds and makes particles for item in use stateprotected floatvoidHandles updating while being ridden by an entityvalidateBoundRespawnBeacon(World world, int oldDimension, int newDimension) static ChunkCoordinatesverifyRespawnCoordinates(World par0World, ChunkCoordinates par1ChunkCoordinates, boolean par2) Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to spawn.voidwakeUpPlayer(boolean par1, boolean par2, boolean par3) Wake up the player if they're sleeping.voidwriteEntityToNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to write subclass entity data to NBT.protected voidintxpBarCap()This method returns the cap amount of experience that the experience bar can hold.Methods inherited from class net.minecraft.src.EntityLivingBase
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, canJumpMidWater, checkForHeadDrop, checkForRareDrop, checkForScrollDrop, clearActivePotions, collideWithEntity, collideWithNearbyEntities, dropEquipment, dropFewItems, dropRareDrop, entityLivingBaseFall, entityLivingOnDeath, func_110142_aN, func_110146_f, func_142015_aE, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getAmbientLootingModifier, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getDeathSound, getDefaultSlipperinessOnGround, getEntityAttribute, getHealth, getHealthAndExhaustionModifier, getHurtSound, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getMeleeAttackStrength, getPosition, getRNG, getRotationYawHead, getSlipperinessRelativeToBlock, getSoundPitch, getSoundVolume, getSpeedModifier, getSwingProgress, getTotalArmorValue, heal, isAIEnabled, isChild, isClientWorld, isEntityAlive, isEntityUndead, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, isWeighted, isWeightedByHeadCrab, kill, knockBack, knockbackMagnitude, mouseOverCustomRayTrace, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onItemPickup, onNewPotionEffect, performHurtAnimation, rayTrace, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, setSprinting, swingItem, updateAITasks, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffectsMethods inherited from class net.minecraft.src.Entity
addComponent, addEntityCrashInfo, addVelocity, applyEntityCollision, attractsLightning, canAttackWithItem, canCollideWithEntity, canEntityTriggerTripwire, canRenderOnFire, copyDataFrom, copyLocationAndAnglesFrom, dealFireDamage, doBlockCollisions, doesEntityApplyToSpawnCap, doesEntityApplyToSquidPossessionCap, doesEntityNotTriggerPressurePlate, doesNotDismountInWater, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, flagAllWatchedObjectsDirty, flingAwayFromEntity, getAir, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getComponent, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityString, getFlag, getHeadCrabSharedAttackTarget, getMaxSafePointTries, getParts, getShadowSize, getTeleportDirection, getUniqueID, getVisualBoundingBox, getXZDistanceSqToEntity, handleLavaMovement, handleWaterMovement, hasComponent, hashCode, hasHeadCrabbedSquid, hitByEntity, initComponents, interactFirst, isAffectedByMovementModifiers, isBeingRainedOn, isBurning, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInsideSuffocatingBlock, isEntityInsideSuffocatingBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInWater, isItemEntity, isOffsetPositionInLiquid, isRiding, isSecondaryTargetForSquid, isSneaking, isSprinting, isValidZombieSecondaryTarget, isWet, moveEntity, moveFlying, newDoubleNBTList, newFloatNBTList, notifyOfWolfHowl, onBlockDispenserConsume, onChunkLoad, onCollideWithPlayer, onFlungBySquidTentacle, onHeadCrabbedBySquid, onKickedByAnimal, onPossessedRidingEntityDeath, onStruckByLightning, outOfUpdateRangeUpdate, pushOutOfBlocks, readFromNBT, setAir, setAngles, setEating, setFire, setFlag, setInPortal, setInvisible, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setRotation, setSize, setSneaking, setVelocity, setWorld, shouldExplodeBlock, shouldSetPosAfterLoading, shouldSetPositionOnLoad, toString, travelToDimension, tryToSetFireToBlocksInContact, updateCloak, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptionalMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.src.ICommandSender
canCommandSenderUseCommand, getPlayerCoordinates, sendChatToPlayer
-
Field Details
-
inventory
Inventory of the player -
inventoryContainer
The Container for the player's inventory (which opens when they press E) -
openContainer
The Container the player has open. -
foodStats
The player's food stats. (See class FoodStats) -
flyToggleTimer
protected int flyToggleTimerUsed to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. -
prevCameraYaw
public float prevCameraYaw -
cameraYaw
public float cameraYaw -
username
-
xpCooldown
public int xpCooldownUsed by EntityPlayer to prevent too many xp orbs from getting absorbed at once. -
field_71091_bM
public double field_71091_bM -
field_71096_bN
public double field_71096_bN -
field_71097_bO
public double field_71097_bO -
field_71094_bP
public double field_71094_bP -
field_71095_bQ
public double field_71095_bQ -
field_71085_bR
public double field_71085_bR -
sleeping
protected boolean sleepingBoolean value indicating weather a player is sleeping or not Note: Indicates whether the player is in a bed, not whether they are actually sleeping. -
playerLocation
The chunk coordinates of the bed the player is in (null if player isn't in a bed). -
field_71079_bU
public float field_71079_bU -
field_71082_cx
public float field_71082_cx -
field_71089_bV
public float field_71089_bV -
lastDeathLocationX
public int lastDeathLocationX -
lastDeathLocationY
public int lastDeathLocationY -
lastDeathLocationZ
public int lastDeathLocationZ -
lastDeathDimension
public int lastDeathDimension -
capabilities
The player's capabilities. (See class PlayerCapabilities) -
experienceLevel
public int experienceLevelThe current experience level the player is on. -
experienceTotal
public int experienceTotalThe total amount of experience the player has. This also includes the amount of experience within their Experience Bar. -
experience
public float experienceThe current amount of experience the player has within their Experience Bar. -
speedOnGround
protected float speedOnGround -
speedInAir
protected float speedInAir -
fishEntity
An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different -
timerSpeedModifier
protected float timerSpeedModifier -
hardcoreSpawnChunk
-
timeOfLastSpawnAssignment
protected long timeOfLastSpawnAssignment -
timeOfLastDimensionSwitch
public long timeOfLastDimensionSwitch -
respawnAssignmentCooldownTimer
public long respawnAssignmentCooldownTimer -
spawnDimension
public int spawnDimension -
timesCraftedThisTick
public int timesCraftedThisTick -
inGloomCounter
public int inGloomCounter -
airRecoveryCountdown
public int airRecoveryCountdown -
ticksSinceEmoteSound
public int ticksSinceEmoteSound -
currentMiningSpeedModifier
protected float currentMiningSpeedModifier -
deathCount
public int deathCount -
GLOOM_COUNTER_BETWEEN_STATE_CHANGES
public static final int GLOOM_COUNTER_BETWEEN_STATE_CHANGES- See Also:
-
EXHAUSTION_JUMPING
public static final float EXHAUSTION_JUMPING- See Also:
-
EXHAUSTION_JUMPING_SPRINTING
public static final float EXHAUSTION_JUMPING_SPRINTING- See Also:
-
-
Constructor Details
-
EntityPlayer
-
-
Method Details
-
applyEntityAttributes
protected void applyEntityAttributes()- Overrides:
applyEntityAttributesin classEntityLivingBase
-
entityInit
protected void entityInit()- Overrides:
entityInitin classEntityLivingBase
-
getItemInUse
returns the ItemStack containing the itemInUse -
getItemInUseCount
public int getItemInUseCount()Returns the item in use count -
isUsingItem
public boolean isUsingItem()Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton -
getItemInUseDuration
public int getItemInUseDuration()gets the duration for how long the current itemInUse has been in use -
stopUsingItem
public void stopUsingItem() -
clearItemInUse
public void clearItemInUse() -
isBlocking
public boolean isBlocking() -
onUpdate
public void onUpdate()Called to update the entity's position/logic.- Overrides:
onUpdatein classEntityLivingBase
-
getMaxInPortalTime
public int getMaxInPortalTime()Return the amount of time this entity should stay in a portal before being transported.- Overrides:
getMaxInPortalTimein classEntity
-
getPortalCooldown
public int getPortalCooldown()Return the amount of cooldown before this entity can use a portal again.- Overrides:
getPortalCooldownin classEntity
-
playSound
/* the playSound function both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same player -
updateItemUse
Plays sounds and makes particles for item in use state -
onItemUseFinish
protected void onItemUseFinish()Used for when item use count runs out, ie: eating completed -
handleHealthUpdate
public void handleHealthUpdate(byte par1) - Overrides:
handleHealthUpdatein classEntityLivingBase
-
isMovementBlocked
protected boolean isMovementBlocked()Dead and sleeping entities cannot move- Overrides:
isMovementBlockedin classEntityLivingBase
-
closeScreen
protected void closeScreen()sets current screen to null (used on escape buttons of GUIs) -
mountEntity
Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.- Overrides:
mountEntityin classEntity
-
updateRidden
public void updateRidden()Handles updating while being ridden by an entity- Overrides:
updateRiddenin classEntityLivingBase
-
preparePlayerToSpawn
public 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)- Overrides:
preparePlayerToSpawnin classEntity
-
updateEntityActionState
protected void updateEntityActionState()- Overrides:
updateEntityActionStatein classEntityLivingBase
-
onLivingUpdate
public void onLivingUpdate()Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.- Overrides:
onLivingUpdatein classEntityLivingBase
-
getScore
public int getScore() -
setScore
public void setScore(int par1) Set player's score -
addScore
public void addScore(int par1) Add to player's score -
onDeath
Called when the mob's health reaches 0.- Overrides:
onDeathin classEntityLivingBase
-
addToPlayerScore
Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, scoreToAdd- Overrides:
addToPlayerScorein classEntity
-
dropOneItem
Called when player presses the drop item key -
dropPlayerItem
Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in a workbench while the workbench'es GUI gets closed) -
dropPlayerItemWithRandomChoice
Args: itemstack, flag -
joinEntityItemWithWorld
Joins the passed in entity item with the world. Args: entityItem -
getCurrentPlayerStrVsBlock
Returns how strong the player is against the specified block at this moment -
readEntityFromNBT
// +++START EDIT+++ // ---END EDIT--- (abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readEntityFromNBTin classEntityLivingBase
-
writeEntityToNBT
(abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
writeEntityToNBTin classEntityLivingBase
-
displayGUIChest
Displays the GUI for interacting with a chest inventory. Args: chestInventory -
displayGUIHopper
-
displayGUIHopperMinecart
-
displayGUIHorse
-
displayGUIEnchantment
-
displayGUIAnvil
public void displayGUIAnvil(int par1, int par2, int par3) Displays the GUI for interacting with an anvil. -
displayGUIWorkbench
public void displayGUIWorkbench(int par1, int par2, int par3) Displays the crafting GUI for a workbench. -
getEyeHeight
public float getEyeHeight()- Overrides:
getEyeHeightin classEntityLivingBase
-
resetHeight
protected void resetHeight()sets the players height back to normal after doing things like sleeping and dieing -
attackEntityFrom
Called when the entity is attacked.- Overrides:
attackEntityFromin classEntityLivingBase
-
canAttackPlayer
-
damageArmor
protected void damageArmor(float par1) - Overrides:
damageArmorin classEntityLivingBase
-
getArmorVisibility
public float getArmorVisibility()When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing them anyway. -
damageEntity
Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second with the reduced value. Args: damageAmount- Overrides:
damageEntityin classEntityLivingBase
-
displayGUIFurnace
Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace -
displayGUIDispenser
Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser -
displayGUIEditSign
Displays the GUI for editing a sign. Args: tileEntitySign -
displayGUIBrewingStand
Displays the GUI for interacting with a brewing stand. -
displayGUIBeacon
Displays the GUI for interacting with a beacon. -
displayGUIMerchant
-
displayGUIBook
Displays the GUI for interacting with a book. -
interactWith
-
getCurrentEquippedItem
Returns the currently being used item by the player. -
destroyCurrentEquippedItem
public void destroyCurrentEquippedItem()Destroys the currently equipped item from the player's inventory. -
getYOffset
public double getYOffset()Returns the Y Offset of this entity.- Overrides:
getYOffsetin classEntity
-
attackTargetEntityWithCurrentItem
Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called on it. Args: targetEntity -
onCriticalHit
Called when the player performs a critical hit on the Entity. Args: entity that was hit critically -
onEnchantmentCritical
-
respawnPlayer
public void respawnPlayer() -
setDead
public void setDead()Will get destroyed next tick. -
isEntityInsideOpaqueBlock
public boolean isEntityInsideOpaqueBlock()Checks if this entity is inside of an opaque block- Overrides:
isEntityInsideOpaqueBlockin classEntity
-
sleepInBedAt
Attempts to have the player sleep in a bed at the specified location. -
wakeUpPlayer
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) Wake up the player if they're sleeping. -
verifyRespawnCoordinates
public static ChunkCoordinates verifyRespawnCoordinates(World par0World, ChunkCoordinates par1ChunkCoordinates, boolean par2) Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to spawn. -
getBedOrientationInDegrees
public float getBedOrientationInDegrees()Returns the orientation of the bed in degrees. -
isPlayerSleeping
public boolean isPlayerSleeping()Returns whether player is sleeping or not- Overrides:
isPlayerSleepingin classEntityLivingBase
-
isPlayerFullyAsleep
public boolean isPlayerFullyAsleep()Returns whether or not the player is asleep and the screen has fully faded. -
getSleepTimer
public int getSleepTimer() -
getHideCape
protected boolean getHideCape(int par1) -
setHideCape
protected void setHideCape(int par1, boolean par2) -
addChatMessage
Add a chat message to the player -
getBedLocation
Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. -
isSpawnForced
public boolean isSpawnForced() -
setSpawnChunk
Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. -
triggerAchievement
Will trigger the specified trigger. -
addStat
Adds a value to a statistic field. -
jump
public void jump()Causes this entity to do an upwards motion (jumping).- Overrides:
jumpin classEntityLivingBase
-
getAIMoveSpeed
public float getAIMoveSpeed()the movespeed used for the new AI system- Overrides:
getAIMoveSpeedin classEntityLivingBase
-
moveEntityWithHeading
public void moveEntityWithHeading(float par1, float par2) Moves the entity based on the specified heading. Args: strafe, forward- Overrides:
moveEntityWithHeadingin classEntityLivingBase
-
addMovementStat
public void addMovementStat(double par1, double par3, double par5) Adds a value to a movement statistic field - like run, walk, swin or climb. -
fall
protected void fall(float par1) Called when the mob is falling. Calculates and applies fall damage.- Overrides:
fallin classEntityLivingBase
-
onKillEntity
This method gets called when the entity kills another one.- Overrides:
onKillEntityin classEntity
-
setInWeb
public void setInWeb()Sets the Entity inside a web block. -
getItemIcon
Gets the Icon Index of the item currently held- Overrides:
getItemIconin classEntityLivingBase
-
getCurrentArmor
-
addExperience
public void addExperience(int par1) This method increases the player's current amount of experience. -
addExperienceLevel
public void addExperienceLevel(int par1) Add experience levels to this player. -
xpBarCap
public int xpBarCap()This method returns the cap amount of experience that the experience bar can hold. With each level, the experience cap on the player's experience bar is raised by 10. -
addExhaustion
public void addExhaustion(float par1) increases exhaustion level by supplied amount -
getFoodStats
Returns the player's FoodStats object. -
canEat
public boolean canEat(boolean par1) -
shouldHeal
public boolean shouldHeal()Checks if the player's health is not full and not zero. -
setItemInUse
sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration -
isCurrentToolAdventureModeExempt
public boolean isCurrentToolAdventureModeExempt(int par1, int par2, int par3) Returns true if the given block can be mined with the current tool in adventure mode. -
canPlayerEdit
-
getExperiencePoints
Get the experience points the entity currently has.- Overrides:
getExperiencePointsin classEntityLivingBase
-
isPlayer
protected boolean isPlayer()Only use is to identify if class is an instance of player for experience dropping- Overrides:
isPlayerin classEntityLivingBase
-
getEntityName
Gets the username of the entity.- Overrides:
getEntityNamein classEntity
-
getAlwaysRenderNameTagForRender
public boolean getAlwaysRenderNameTagForRender()- Overrides:
getAlwaysRenderNameTagForRenderin classEntityLivingBase
-
clonePlayer
// +++START EDIT+++ Copies the values from the given player into this player if boolean playerLeavingTheEnd is true. Always clones Ender Chest // ---END EDIT--- Inventory. -
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
-
sendPlayerAbilities
public void sendPlayerAbilities()Sends the player's abilities to the server (if there is one). -
setGameType
Sets the player's game mode and sends it to them. -
getEntityWorld
- Specified by:
getEntityWorldin interfaceICommandSender
-
getCommandSenderName
Gets the name of this command sender (usually username, but possibly "Rcon")- Specified by:
getCommandSenderNamein interfaceICommandSender
-
getInventoryEnderChest
Returns the InventoryEnderChest of this player. -
isInvisibleToPlayer
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.- Overrides:
isInvisibleToPlayerin classEntity
-
getCurrentItemOrArmor
0 = item, 1-n is armor- Specified by:
getCurrentItemOrArmorin classEntityLivingBase
-
getHeldItem
Returns the item that this EntityLiving is holding, if any.- Specified by:
getHeldItemin classEntityLivingBase
-
setCurrentItemOrArmor
Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot- Specified by:
setCurrentItemOrArmorin classEntityLivingBase
-
getLastActiveItems
- Specified by:
getLastActiveItemsin classEntityLivingBase
-
getHideCape
public boolean getHideCape() -
isPushedByWater
public boolean isPushedByWater()- Overrides:
isPushedByWaterin classEntity
-
getWorldScoreboard
-
getTeam
- Overrides:
getTeamin classEntityLivingBase
-
getTranslatedEntityName
Returns the translated name of the entity.- Overrides:
getTranslatedEntityNamein classEntity
-
isUsingSpecialKey
public boolean isUsingSpecialKey()- Overrides:
isUsingSpecialKeyin classEntity
-
setUsingSpecialKey
public void setUsingSpecialKey(boolean usingSpecialKey) -
readModDataFromNBT
-
writeModDataToNBT
-
decreaseAirSupply
protected int decreaseAirSupply(int iAirSupply) Description copied from class:EntityLivingBaseDecrements the entity's air supply when underwater- Overrides:
decreaseAirSupplyin classEntityLivingBase
-
recoverAirSupply
protected void recoverAirSupply()- Overrides:
recoverAirSupplyin classEntityLivingBase
-
isOnLadder
public boolean isOnLadder()Description copied from class:EntityLivingBasereturns true if this entity is by a ladder, false otherwise- Overrides:
isOnLadderin classEntityLivingBase
-
canJump
public boolean canJump()- Overrides:
canJumpin classEntityLivingBase
-
canSwim
public boolean canSwim()- Overrides:
canSwimin classEntityLivingBase
-
getArmorExhaustionModifier
public float getArmorExhaustionModifier() -
isWearingFullSuitSoulforgedArmor
public boolean isWearingFullSuitSoulforgedArmor() -
isWearingSoulforgedHelm
public boolean isWearingSoulforgedHelm() -
isWearingSoulforgedBoots
public boolean isWearingSoulforgedBoots() -
isWearingEnderSpectacles
public boolean isWearingEnderSpectacles() -
playStepSound
protected void playStepSound(int i, int j, int k, int iBlockID) Description copied from class:EntityPlays step sound at given x, y, z for the entity- Overrides:
playStepSoundin classEntity
-
getSwimmingHorizontalModifier
protected float getSwimmingHorizontalModifier()- Overrides:
getSwimmingHorizontalModifierin classEntityLivingBase
-
getLandMovementModifier
protected float getLandMovementModifier()- Overrides:
getLandMovementModifierin classEntityLivingBase
-
getLadderVerticalMovementModifier
protected float getLadderVerticalMovementModifier()- Overrides:
getLadderVerticalMovementModifierin classEntityLivingBase
-
getJumpingHorizontalMovementModifier
protected float getJumpingHorizontalMovementModifier() -
setMiningSpeedModifier
protected void setMiningSpeedModifier(float modifier) -
getMiningSpeedModifier
protected float getMiningSpeedModifier() -
updateMiningSpeedModifier
protected float updateMiningSpeedModifier() -
getMeleeDamageModifier
protected float getMeleeDamageModifier() -
getBowPullStrengthModifier
public float getBowPullStrengthModifier() -
doesStatusPreventSprinting
public boolean doesStatusPreventSprinting() -
isCarryingBlastingOil
protected boolean isCarryingBlastingOil() -
detonateCarriedBlastingOil
protected void detonateCarriedBlastingOil() -
dropHead
protected void dropHead()- Overrides:
dropHeadin classEntityLivingBase
-
hasValidMagneticPointForLocation
public boolean hasValidMagneticPointForLocation() -
getStongestMagneticPointForLocationI
public int getStongestMagneticPointForLocationI() -
getStongestMagneticPointForLocationK
public int getStongestMagneticPointForLocationK() -
setHasValidMagneticPointForLocation
public void setHasValidMagneticPointForLocation(boolean bValid) -
setStrongestMagneticPointForLocationI
public void setStrongestMagneticPointForLocationI(int iLocationI) -
setStrongestMagneticPointForLocationK
public void setStrongestMagneticPointForLocationK(int iLocationK) -
getGloomLevel
public int getGloomLevel() -
setGloomLevel
public void setGloomLevel(int iGloomLevel) -
getStatusForCategory
-
getAllActiveStatusEffects
-
getMovementSpeedModifierFromEffects
public float getMovementSpeedModifierFromEffects() -
getMiningSpeedModifierFromEffects
public float getMiningSpeedModifierFromEffects() -
getAttackDamageModifierFromEffects
public float getAttackDamageModifierFromEffects() -
getSpawnChunksVisualizationLocationI
public int getSpawnChunksVisualizationLocationI() -
getSpawnChunksVisualizationLocationJ
public int getSpawnChunksVisualizationLocationJ() -
getSpawnChunksVisualizationLocationK
public int getSpawnChunksVisualizationLocationK() -
setSpawnChunksVisualization
public void setSpawnChunksVisualization(int iLocationI, int iLocationJ, int iLocationK) -
hasRespawnCoordinates
public boolean hasRespawnCoordinates() -
getValidatedRespawnCoordinates
returns zero if a valid spawn location is found 1 = invalid forced spawn location 2 = missing beacon 3 = Beacon is out of range 4 = Area around beacon is obstructed -
validateBoundRespawnBeacon
public BeaconRespawnValidationResult validateBoundRespawnBeacon(World world, int oldDimension, int newDimension) -
setSpawnChunk
-
addRawChatMessage
-
canHarvestBlock
-
addStackToCurrentHeldStackIfEmpty
-
updateGloomState
protected void updateGloomState() -
onBlockedDamage
-
getMountedYOffset
public double getMountedYOffset()Description copied from class:EntityReturns the Y offset from the entity's position for any entity riding this one.- Overrides:
getMountedYOffsetin classEntity
-
addExhaustionWithoutVisualFeedback
public void addExhaustionWithoutVisualFeedback(float fAmount) -
addHarvestBlockExhaustion
public void addHarvestBlockExhaustion(int iBlockID, int iBlockI, int iBlockJ, int iBlockK, int iBlockMetadata) -
onZeroDamageAttack
protected void onZeroDamageAttack() -
isPlayerHoldingSail
protected boolean isPlayerHoldingSail() -
appliesConstantForceWhenRidingBoat
public boolean appliesConstantForceWhenRidingBoat()- Overrides:
appliesConstantForceWhenRidingBoatin classEntity
-
movementModifierWhenRidingBoat
public double movementModifierWhenRidingBoat()- Overrides:
movementModifierWhenRidingBoatin classEntity
-
dismountEntity
Description copied from class:EntityLivingBaseMoves the entity to a position out of the way of its mount.- Overrides:
dismountEntityin classEntityLivingBase
-
addExhaustionForJump
public void addExhaustionForJump() -
setItemInUseCount
public void setItemInUseCount(int iCount) -
getCanBeHeadCrabbed
public boolean getCanBeHeadCrabbed(boolean bSquidInWater) - Overrides:
getCanBeHeadCrabbedin classEntity
-
isValidOngoingAttackTargetForSquid
public boolean isValidOngoingAttackTargetForSquid()- Overrides:
isValidOngoingAttackTargetForSquidin classEntity
-
isImmuneToHeadCrabDamage
public boolean isImmuneToHeadCrabDamage()- Overrides:
isImmuneToHeadCrabDamagein classEntity
-
isLocalPlayerAndHittingBlock
public boolean isLocalPlayerAndHittingBlock() -
mountEntityRemote
Description copied from class:EntityCalled when clients receive a packed from the server indicating that they should mount an entity as part of fix for MC-1291.- Overrides:
mountEntityRemotein classEntity
-
canDrink
public boolean canDrink() -
onCantConsume
public void onCantConsume() -
getAnimalKickMovementMultiplier
protected double getAnimalKickMovementMultiplier()- Overrides:
getAnimalKickMovementMultiplierin classEntity
-
installationIntegrityTestPlayer
public static boolean installationIntegrityTestPlayer() -
setAbsorptionAmount
public void setAbsorptionAmount(float par1) - Overrides:
setAbsorptionAmountin classEntityLivingBase
-
getAbsorptionAmount
public float getAbsorptionAmount()- Overrides:
getAbsorptionAmountin classEntityLivingBase
-
getTimerSpeedModifier
public float getTimerSpeedModifier() -
setTimerSpeedModifier
public void setTimerSpeedModifier(float timerSpeedModifier) -
resetTimerSpeedModifier
public void resetTimerSpeedModifier() -
getTimeOfLastSpawnAssignment
public long getTimeOfLastSpawnAssignment() -
setTimeOfLastSpawnAssignment
public void setTimeOfLastSpawnAssignment(long timeOfLastSpawnAssignment) -
getData
-
setData
-