Package net.minecraft.entity.player
Class EntityPlayer
- java.lang.Object
-
- net.zxmushroom63.plugins.BaseData
-
- net.zxmushroom63.plugins.PluginData
-
- net.minecraft.entity.Entity
-
- net.minecraft.entity.EntityLivingBase
-
- net.minecraft.entity.player.EntityPlayer
-
- All Implemented Interfaces:
ICommandSender
,org.teavm.jso.JSObject
- Direct Known Subclasses:
AbstractClientPlayer
public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityPlayer.EnumChatVisibility
static class
EntityPlayer.EnumStatus
-
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
Fields Modifier and Type Field Description float
cameraYaw
PlayerCapabilities
capabilities
+ The player's capabilities.double
chasingPosX
double
chasingPosY
double
chasingPosZ
float
experience
int
experienceLevel
int
experienceTotal
EntityFishHook
fishEntity
protected int
flyToggleTimer
protected FoodStats
foodStats
+ The food object of the player, the general hunger logic.InventoryPlayer
inventory
+ Inventory of the playerContainer
inventoryContainer
Container
openContainer
BlockPos
playerLocation
float
prevCameraYaw
double
prevChasingPosX
double
prevChasingPosY
double
prevChasingPosZ
float
renderOffsetX
float
renderOffsetY
float
renderOffsetZ
protected boolean
sleeping
protected float
speedInAir
protected float
speedOnGround
int
xpCooldown
-
Fields inherited from class net.minecraft.entity.EntityLivingBase
arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, field_70741_aB, field_70769_ao, field_70770_ap, hurtTime, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingProgress, swingProgressInt
-
Fields inherited from class net.minecraft.entity.Entity
addedToChunk, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, field_181016_an, field_181017_ao, field_181018_ap, fireResistance, firstUpdate, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj
-
-
Constructor Summary
Constructors Constructor Description EntityPlayer(World worldIn, GameProfile gameProfileIn)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addChatComponentMessage(IChatComponent var1)
void
addExhaustion(float parFloat1)
+ increases exhaustion level by supplied amountvoid
addExperience(int amount)
+ Add experience points to player.void
addExperienceLevel(int i)
+ Add experience levels to this player.void
addMovementStat(double parDouble1, double parDouble2, double parDouble3)
+ Adds a value to a movement statistic field - like run, walk, swin or climb.void
addScore(int parInt1)
+ Add to player's scorevoid
addStat(StatBase var1, int var2)
+ Adds a value to a statistic field.void
addToPlayerScore(Entity entity, int i)
+ Adds a value to the player score.protected void
applyEntityAttributes()
boolean
attackEntityFrom(DamageSource damagesource, float f)
+ Called when the entity is attacked.void
attackTargetEntityWithCurrentItem(Entity entity)
+ Attacks for the player the targeted entity with the currently equipped item.boolean
canAttackPlayer(EntityPlayer entityplayer)
boolean
canEat(boolean ignoreHunger)
boolean
canHarvestBlock(Block blockToHarvest)
+ Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary)boolean
canOpen(LockCode code)
+ Check whether this player can open an inventory locked with the given LockCode.boolean
canPlayerEdit(BlockPos parBlockPos, EnumFacing parEnumFacing, ItemStack parItemStack)
protected boolean
canTriggerWalking()
+ returns if this entity triggers Block.onEntityWalking on the blocks they walk on.void
clearItemInUse()
void
clonePlayer(EntityPlayer entityplayer, boolean flag)
+ Copies the values from the given player into this player if boolean par2 is true.protected void
closeScreen()
+ set current crafting inventory back to the 2x2 squareprotected void
damageArmor(float f)
protected void
damageEntity(DamageSource damagesource, float f)
+ Deals damage to the entity.void
destroyCurrentEquippedItem()
+ Destroys the currently equipped item from the player's inventory.void
displayGui(IInteractionObject var1)
void
displayGUIBook(ItemStack var1)
+ Displays the GUI for interacting with a book.void
displayGUIChest(IInventory var1)
+ Displays the GUI for interacting with a chest inventory.void
displayGUIHorse(EntityHorse var1, IInventory var2)
void
displayVillagerTradeGui(IMerchant var1)
EntityItem
dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem)
EntityItem
dropOneItem(boolean flag)
+ Called when player presses the drop item keyEntityItem
dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused)
+ Args: itemstack, flagprotected void
entityInit()
void
fall(float f, float f1)
void
func_175145_a(StatBase var1)
float
getAbsorptionAmount()
float
getAIMoveSpeed()
+ the movespeed used for the new AI systemboolean
getAlwaysRenderNameTagForRender()
float
getArmorVisibility()
+ When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing them anyway.BlockPos
getBedLocation()
float
getBedOrientationInDegrees()
+ Returns the orientation of the bed in degrees.static BlockPos
getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn)
+ Return null if bed is invalidItemStack
getCurrentArmor(int i)
ItemStack
getCurrentEquippedItem()
+ Returns the currently being used item by the player.protected java.lang.String
getDeathSound()
+ Returns the sound this mob makes on death.IChatComponent
getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chatItemStack
getEquipmentInSlot(int i)
+ 0: Tool in Hand; 1-4: Armorprotected int
getExperiencePoints(EntityPlayer var1)
+ Get the experience points the entity currently has.float
getEyeHeight()
protected java.lang.String
getFallSoundString(int i)
FoodStats
getFoodStats()
+ Returns the player's FoodStats object.GameProfile
getGameProfile()
+ Returns the GameProfile for this playerItemStack
getHeldItem()
+ Returns the item that this EntityLiving is holding, if any.protected java.lang.String
getHurtSound()
+ Returns the sound this mob makes when it is hurt.ItemStack[]
getInventory()
+ returns the inventory of this entity (only used in EntityPlayerMP it seems)InventoryEnderChest
getInventoryEnderChest()
+ Returns the InventoryEnderChest of this player.ItemStack
getItemInUse()
+ returns the ItemStack containing the itemInUseint
getItemInUseCount()
+ Returns the item in use countint
getItemInUseDuration()
+ gets the duration for how long the current itemInUse has been in useint
getMaxInPortalTime()
+ Return the amount of time this entity should stay in a portal before being transported.java.lang.String
getName()
+ Gets the name of this command sender (usually username, but possibly "Rcon")static EaglercraftUUID
getOfflineUUID(java.lang.String username)
int
getPortalCooldown()
+ Return the amount of cooldown before this entity can use a portal again.int
getScore()
int
getSleepTimer()
protected java.lang.String
getSplashSound()
protected java.lang.String
getSwimSound()
Team
getTeam()
float
getToolDigEfficiency(Block parBlock)
+ Block hardness will be further counted in net/minecraft/block/Block.getPlayerRelativeBlockHardnessint
getTotalArmorValue()
+ Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValuestatic EaglercraftUUID
getUUID(GameProfile profile)
+ Gets a players UUID given their GameProfieScoreboard
getWorldScoreboard()
int
getXPSeed()
double
getYOffset()
+ Returns the Y Offset of this entity.void
handleStatusUpdate(byte b0)
boolean
hasReducedDebug()
+ Whether the "reducedDebugInfo" option is active for this player.boolean
interactWith(Entity parEntity)
boolean
isAllowEdit()
boolean
isBlocking()
boolean
isEntityInsideOpaqueBlock()
+ Checks if this entity is inside of an opaque blockboolean
isInvisibleToPlayer(EntityPlayer entityplayer)
+ 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.protected boolean
isMovementBlocked()
+ Dead and sleeping entities cannot moveprotected boolean
isPlayer()
+ Only use is to identify if class is an instance of player for experience droppingboolean
isPlayerFullyAsleep()
+ Returns whether or not the player is asleep and the screen has fully faded.boolean
isPlayerSleeping()
+ Returns whether player is sleeping or notboolean
isPushedByWater()
boolean
isSpawnForced()
abstract boolean
isSpectator()
boolean
isUser()
+ returns true if this is an EntityPlayerSP, or the logged in player.boolean
isUsingItem()
+ Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButtonboolean
isWearing(EnumPlayerModelParts parEnumPlayerModelParts)
protected void
joinEntityItemWithWorld(EntityItem entityitem)
+ Joins the passed in entity item with the world.void
jump()
+ Causes this entity to do an upwards motion (jumping).void
loadPluginData(BaseData data)
PluginData
makePluginData()
void
moveEntityWithHeading(float f, float f1)
+ Moves the entity based on the specified heading.void
onCriticalHit(Entity var1)
+ Called when the player performs a critical hit on the Entity.void
onDeath(DamageSource damagesource)
+ Called when the mob's health reaches 0.void
onEnchantmentCritical(Entity var1)
protected void
onItemUseFinish()
+ Used for when item use count runs out, ie: eating completedvoid
onKillEntity(EntityLivingBase entitylivingbase)
+ This method gets called when the entity kills another one.void
onLivingUpdate()
+ Called frequently so the entity can update its state every tick as required.void
onUpdate()
+ Called to update the entity's position/logic.void
openEditCommandBlock(CommandBlockLogic var1)
void
openEditSign(TileEntitySign var1)
void
playSound(java.lang.String s, float f, float f1)
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)void
readEntityFromNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to read subclass entity data from NBT.void
removeExperienceLevel(int i)
boolean
replaceItemInInventory(int i, ItemStack itemstack)
protected void
resetHeight()
+ sets the players height back to normal after doing things like sleeping and dieingvoid
respawnPlayer()
boolean
sendCommandFeedback()
+ Returns true if the command sender should be sent feedback about executed commandsvoid
sendPlayerAbilities()
+ Sends the player's abilities to the server (if there is one).void
setAbsorptionAmount(float f)
void
setCurrentItemOrArmor(int i, ItemStack itemstack)
+ Sets the held item, or an armor slot.void
setDead()
+ Will get destroyed next tick.void
setGameType(WorldSettings.GameType var1)
+ Sets the player's game mode and sends it to them.void
setInWeb()
+ Sets the Entity inside a web block.void
setItemInUse(ItemStack itemstack, int i)
+ sets the itemInUse when the use item button is clicked.void
setReducedDebug(boolean reducedDebug)
void
setScore(int parInt1)
+ Set player's scorevoid
setSpawnPoint(BlockPos pos, boolean forced)
boolean
shouldHeal()
+ Checks if the player's health is not full and not zero.void
stopUsingItem()
void
triggerAchievement(StatBase achievementIn)
+ Will trigger the specified trigger.EntityPlayer.EnumStatus
trySleep(BlockPos blockpos)
protected void
updateEntityActionState()
protected void
updateItemUse(ItemStack itemStackIn, int parInt1)
+ Plays sounds and makes particles for item in use statevoid
updateRidden()
+ Handles updating while being ridden by an entityvoid
wakeUpPlayer(boolean flag, boolean flag1, boolean flag2)
+ Wake up the player if they're sleeping.void
writeEntityToNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to write subclass entity data to NBT.int
xpBarCap()
+ This method returns the cap amount of experience that the experience bar can hold.-
Methods inherited from class net.minecraft.entity.EntityLivingBase
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, decreaseAirSupply, dismountEntity, dropEquipment, dropFewItems, func_110146_f, func_181013_g, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getArrowCountInEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getHealth, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, handleJumpLava, heal, isChild, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, isServerWorld, kill, knockBack, markPotionsDirty, mountEntity, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onNewPotionEffect, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, setSprinting, swingItem, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata
-
Methods inherited from class net.minecraft.entity.Entity
addChatMessage, addEntityCrashInfo, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canCommandSenderUseCommand, canRenderOnFire, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fromNBT, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCustomNameTag, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getFlag, getHorizontalFacing, getHoverEvent, getMaxFallHeight, getMountedYOffset, getNBTTagCompound, getParts, getPosition, getPositionEyes, getPositionVector, getUniqueID, getVectorForRotation, handleWaterMovement, hasCustomName, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isEating, isEntityEqual, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isRiding, isSilent, isSneaking, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, pushOutOfBlocks, rayTrace, readFromNBT, setAir, setAlwaysRenderNameTag, setAngles, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toNBT, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraft.command.ICommandSender
addChatMessage, canCommandSenderUseCommand, getCommandSenderEntity, getEntityWorld, getPosition, getPositionVector
-
-
-
-
Field Detail
-
inventory
public InventoryPlayer inventory
+ Inventory of the player
-
inventoryContainer
public Container inventoryContainer
-
openContainer
public Container openContainer
-
foodStats
protected FoodStats foodStats
+ The food object of the player, the general hunger logic.
-
flyToggleTimer
protected int flyToggleTimer
-
prevCameraYaw
public float prevCameraYaw
-
cameraYaw
public float cameraYaw
-
xpCooldown
public int xpCooldown
-
prevChasingPosX
public double prevChasingPosX
-
prevChasingPosY
public double prevChasingPosY
-
prevChasingPosZ
public double prevChasingPosZ
-
chasingPosX
public double chasingPosX
-
chasingPosY
public double chasingPosY
-
chasingPosZ
public double chasingPosZ
-
sleeping
protected boolean sleeping
-
playerLocation
public BlockPos playerLocation
-
renderOffsetX
public float renderOffsetX
-
renderOffsetY
public float renderOffsetY
-
renderOffsetZ
public float renderOffsetZ
-
capabilities
public PlayerCapabilities capabilities
+ The player's capabilities. (See class PlayerCapabilities)
-
experienceLevel
public int experienceLevel
-
experienceTotal
public int experienceTotal
-
experience
public float experience
-
speedOnGround
protected float speedOnGround
-
speedInAir
protected float speedInAir
-
fishEntity
public EntityFishHook fishEntity
-
-
Constructor Detail
-
EntityPlayer
public EntityPlayer(World worldIn, GameProfile gameProfileIn)
-
-
Method Detail
-
applyEntityAttributes
protected void applyEntityAttributes()
- Overrides:
applyEntityAttributes
in classEntityLivingBase
-
entityInit
protected void entityInit()
- Overrides:
entityInit
in classEntityLivingBase
-
loadPluginData
public void loadPluginData(BaseData data)
- Overrides:
loadPluginData
in classEntityLivingBase
-
makePluginData
public PluginData makePluginData()
- Overrides:
makePluginData
in classEntityLivingBase
-
getItemInUse
public ItemStack 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:
onUpdate
in classEntityLivingBase
-
getMaxInPortalTime
public int getMaxInPortalTime()
+ Return the amount of time this entity should stay in a portal before being transported.- Overrides:
getMaxInPortalTime
in classEntity
-
getSwimSound
protected java.lang.String getSwimSound()
- Overrides:
getSwimSound
in classEntity
-
getSplashSound
protected java.lang.String getSplashSound()
- Overrides:
getSplashSound
in classEntity
-
getPortalCooldown
public int getPortalCooldown()
+ Return the amount of cooldown before this entity can use a portal again.- Overrides:
getPortalCooldown
in classEntity
-
playSound
public void playSound(java.lang.String s, float f, float f1)
-
updateItemUse
protected void updateItemUse(ItemStack itemStackIn, int parInt1)
+ 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
-
handleStatusUpdate
public void handleStatusUpdate(byte b0)
- Overrides:
handleStatusUpdate
in classEntityLivingBase
-
isMovementBlocked
protected boolean isMovementBlocked()
+ Dead and sleeping entities cannot move- Overrides:
isMovementBlocked
in classEntityLivingBase
-
closeScreen
protected void closeScreen()
+ set current crafting inventory back to the 2x2 square
-
updateRidden
public void updateRidden()
+ Handles updating while being ridden by an entity- Overrides:
updateRidden
in 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:
preparePlayerToSpawn
in classEntity
-
updateEntityActionState
protected void updateEntityActionState()
- Overrides:
updateEntityActionState
in 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:
onLivingUpdate
in classEntityLivingBase
-
getScore
public int getScore()
-
setScore
public void setScore(int parInt1)
+ Set player's score
-
addScore
public void addScore(int parInt1)
+ Add to player's score
-
onDeath
public void onDeath(DamageSource damagesource)
+ Called when the mob's health reaches 0.- Overrides:
onDeath
in classEntityLivingBase
-
getHurtSound
protected java.lang.String getHurtSound()
+ Returns the sound this mob makes when it is hurt.- Overrides:
getHurtSound
in classEntityLivingBase
-
getDeathSound
protected java.lang.String getDeathSound()
+ Returns the sound this mob makes on death.- Overrides:
getDeathSound
in classEntityLivingBase
-
addToPlayerScore
public void addToPlayerScore(Entity entity, int i)
+ Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, scoreToAdd- Overrides:
addToPlayerScore
in classEntity
-
dropOneItem
public EntityItem dropOneItem(boolean flag)
+ Called when player presses the drop item key
-
dropPlayerItemWithRandomChoice
public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused)
+ Args: itemstack, flag
-
dropItem
public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem)
-
joinEntityItemWithWorld
protected void joinEntityItemWithWorld(EntityItem entityitem)
+ Joins the passed in entity item with the world. Args: entityItem
-
getToolDigEfficiency
public float getToolDigEfficiency(Block parBlock)
+ Block hardness will be further counted in net/minecraft/block/Block.getPlayerRelativeBlockHardness
-
canHarvestBlock
public boolean canHarvestBlock(Block blockToHarvest)
+ Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary)
-
readEntityFromNBT
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readEntityFromNBT
in classEntityLivingBase
-
writeEntityToNBT
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
writeEntityToNBT
in classEntityLivingBase
-
attackEntityFrom
public boolean attackEntityFrom(DamageSource damagesource, float f)
+ Called when the entity is attacked.- Overrides:
attackEntityFrom
in classEntityLivingBase
-
canAttackPlayer
public boolean canAttackPlayer(EntityPlayer entityplayer)
-
damageArmor
protected void damageArmor(float f)
- Overrides:
damageArmor
in classEntityLivingBase
-
getTotalArmorValue
public int getTotalArmorValue()
+ Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue- Overrides:
getTotalArmorValue
in 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
protected void damageEntity(DamageSource damagesource, float f)
+ 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:
damageEntity
in classEntityLivingBase
-
openEditSign
public void openEditSign(TileEntitySign var1)
-
openEditCommandBlock
public void openEditCommandBlock(CommandBlockLogic var1)
-
displayVillagerTradeGui
public void displayVillagerTradeGui(IMerchant var1)
-
displayGUIChest
public void displayGUIChest(IInventory var1)
+ Displays the GUI for interacting with a chest inventory. Args: chestInventory
-
displayGUIHorse
public void displayGUIHorse(EntityHorse var1, IInventory var2)
-
displayGui
public void displayGui(IInteractionObject var1)
-
displayGUIBook
public void displayGUIBook(ItemStack var1)
+ Displays the GUI for interacting with a book.
-
interactWith
public boolean interactWith(Entity parEntity)
-
getCurrentEquippedItem
public ItemStack 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:
getYOffset
in classEntity
-
attackTargetEntityWithCurrentItem
public void attackTargetEntityWithCurrentItem(Entity entity)
+ Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called on it. Args: targetEntity
-
onCriticalHit
public void onCriticalHit(Entity var1)
+ Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
-
onEnchantmentCritical
public void onEnchantmentCritical(Entity var1)
-
respawnPlayer
public void respawnPlayer()
-
isEntityInsideOpaqueBlock
public boolean isEntityInsideOpaqueBlock()
+ Checks if this entity is inside of an opaque block- Overrides:
isEntityInsideOpaqueBlock
in classEntity
-
isUser
public boolean isUser()
+ returns true if this is an EntityPlayerSP, or the logged in player.
-
getGameProfile
public GameProfile getGameProfile()
+ Returns the GameProfile for this player
-
trySleep
public EntityPlayer.EnumStatus trySleep(BlockPos blockpos)
-
wakeUpPlayer
public void wakeUpPlayer(boolean flag, boolean flag1, boolean flag2)
+ Wake up the player if they're sleeping.
-
getBedSpawnLocation
public static BlockPos getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn)
+ Return null if bed is invalid
-
getBedOrientationInDegrees
public float getBedOrientationInDegrees()
+ Returns the orientation of the bed in degrees.
-
isPlayerSleeping
public boolean isPlayerSleeping()
+ Returns whether player is sleeping or not- Overrides:
isPlayerSleeping
in classEntityLivingBase
-
isPlayerFullyAsleep
public boolean isPlayerFullyAsleep()
+ Returns whether or not the player is asleep and the screen has fully faded.
-
getSleepTimer
public int getSleepTimer()
-
addChatComponentMessage
public void addChatComponentMessage(IChatComponent var1)
-
getBedLocation
public BlockPos getBedLocation()
-
isSpawnForced
public boolean isSpawnForced()
-
setSpawnPoint
public void setSpawnPoint(BlockPos pos, boolean forced)
-
triggerAchievement
public void triggerAchievement(StatBase achievementIn)
+ Will trigger the specified trigger.
-
addStat
public void addStat(StatBase var1, int var2)
+ Adds a value to a statistic field.
-
func_175145_a
public void func_175145_a(StatBase var1)
-
jump
public void jump()
+ Causes this entity to do an upwards motion (jumping).- Overrides:
jump
in classEntityLivingBase
-
moveEntityWithHeading
public void moveEntityWithHeading(float f, float f1)
+ Moves the entity based on the specified heading. Args: strafe, forward- Overrides:
moveEntityWithHeading
in classEntityLivingBase
-
getAIMoveSpeed
public float getAIMoveSpeed()
+ the movespeed used for the new AI system- Overrides:
getAIMoveSpeed
in classEntityLivingBase
-
addMovementStat
public void addMovementStat(double parDouble1, double parDouble2, double parDouble3)
+ Adds a value to a movement statistic field - like run, walk, swin or climb.
-
fall
public void fall(float f, float f1)
- Overrides:
fall
in classEntityLivingBase
-
resetHeight
protected void resetHeight()
+ sets the players height back to normal after doing things like sleeping and dieing- Overrides:
resetHeight
in classEntity
-
getFallSoundString
protected java.lang.String getFallSoundString(int i)
- Overrides:
getFallSoundString
in classEntityLivingBase
-
onKillEntity
public void onKillEntity(EntityLivingBase entitylivingbase)
+ This method gets called when the entity kills another one.- Overrides:
onKillEntity
in classEntity
-
setInWeb
public void setInWeb()
+ Sets the Entity inside a web block.
-
getCurrentArmor
public ItemStack getCurrentArmor(int i)
- Specified by:
getCurrentArmor
in classEntityLivingBase
-
addExperience
public void addExperience(int amount)
+ Add experience points to player.
-
getXPSeed
public int getXPSeed()
-
removeExperienceLevel
public void removeExperienceLevel(int i)
-
addExperienceLevel
public void addExperienceLevel(int i)
+ 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 parFloat1)
+ increases exhaustion level by supplied amount
-
getFoodStats
public FoodStats getFoodStats()
+ Returns the player's FoodStats object.
-
canEat
public boolean canEat(boolean ignoreHunger)
-
shouldHeal
public boolean shouldHeal()
+ Checks if the player's health is not full and not zero.
-
setItemInUse
public void setItemInUse(ItemStack itemstack, int i)
+ sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration
-
isAllowEdit
public boolean isAllowEdit()
-
canPlayerEdit
public boolean canPlayerEdit(BlockPos parBlockPos, EnumFacing parEnumFacing, ItemStack parItemStack)
-
getExperiencePoints
protected int getExperiencePoints(EntityPlayer var1)
+ Get the experience points the entity currently has.- Overrides:
getExperiencePoints
in classEntityLivingBase
-
isPlayer
protected boolean isPlayer()
+ Only use is to identify if class is an instance of player for experience dropping- Overrides:
isPlayer
in classEntityLivingBase
-
getAlwaysRenderNameTagForRender
public boolean getAlwaysRenderNameTagForRender()
- Overrides:
getAlwaysRenderNameTagForRender
in classEntityLivingBase
-
clonePlayer
public void clonePlayer(EntityPlayer entityplayer, boolean flag)
+ Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest 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:
canTriggerWalking
in classEntity
-
sendPlayerAbilities
public void sendPlayerAbilities()
+ Sends the player's abilities to the server (if there is one).
-
setGameType
public void setGameType(WorldSettings.GameType var1)
+ Sets the player's game mode and sends it to them.
-
getName
public java.lang.String getName()
+ Gets the name of this command sender (usually username, but possibly "Rcon")- Specified by:
getName
in interfaceICommandSender
- Overrides:
getName
in classEntity
-
getInventoryEnderChest
public InventoryEnderChest getInventoryEnderChest()
+ Returns the InventoryEnderChest of this player.
-
getEquipmentInSlot
public ItemStack getEquipmentInSlot(int i)
+ 0: Tool in Hand; 1-4: Armor- Specified by:
getEquipmentInSlot
in classEntityLivingBase
-
getHeldItem
public ItemStack getHeldItem()
+ Returns the item that this EntityLiving is holding, if any.- Specified by:
getHeldItem
in classEntityLivingBase
-
setCurrentItemOrArmor
public void setCurrentItemOrArmor(int i, ItemStack itemstack)
+ Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot- Specified by:
setCurrentItemOrArmor
in classEntityLivingBase
-
isInvisibleToPlayer
public boolean isInvisibleToPlayer(EntityPlayer entityplayer)
+ 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:
isInvisibleToPlayer
in classEntity
-
isSpectator
public abstract boolean isSpectator()
-
getInventory
public ItemStack[] getInventory()
+ returns the inventory of this entity (only used in EntityPlayerMP it seems)- Specified by:
getInventory
in classEntityLivingBase
-
isPushedByWater
public boolean isPushedByWater()
- Overrides:
isPushedByWater
in classEntity
-
getWorldScoreboard
public Scoreboard getWorldScoreboard()
-
getTeam
public Team getTeam()
- Overrides:
getTeam
in classEntityLivingBase
-
getDisplayName
public IChatComponent getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chat- Specified by:
getDisplayName
in interfaceICommandSender
- Overrides:
getDisplayName
in classEntity
-
getEyeHeight
public float getEyeHeight()
- Overrides:
getEyeHeight
in classEntity
-
setAbsorptionAmount
public void setAbsorptionAmount(float f)
- Overrides:
setAbsorptionAmount
in classEntityLivingBase
-
getAbsorptionAmount
public float getAbsorptionAmount()
- Overrides:
getAbsorptionAmount
in classEntityLivingBase
-
getUUID
public static EaglercraftUUID getUUID(GameProfile profile)
+ Gets a players UUID given their GameProfie
-
getOfflineUUID
public static EaglercraftUUID getOfflineUUID(java.lang.String username)
-
canOpen
public boolean canOpen(LockCode code)
+ Check whether this player can open an inventory locked with the given LockCode.
-
isWearing
public boolean isWearing(EnumPlayerModelParts parEnumPlayerModelParts)
-
sendCommandFeedback
public boolean sendCommandFeedback()
+ Returns true if the command sender should be sent feedback about executed commands- Specified by:
sendCommandFeedback
in interfaceICommandSender
- Overrides:
sendCommandFeedback
in classEntity
-
replaceItemInInventory
public boolean replaceItemInInventory(int i, ItemStack itemstack)
- Overrides:
replaceItemInInventory
in classEntity
-
hasReducedDebug
public boolean hasReducedDebug()
+ Whether the "reducedDebugInfo" option is active for this player.
-
setReducedDebug
public void setReducedDebug(boolean reducedDebug)
-
-