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 classEntityPlayer.EnumChatVisibilitystatic classEntityPlayer.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 floatcameraYawPlayerCapabilitiescapabilities+ The player's capabilities.doublechasingPosXdoublechasingPosYdoublechasingPosZfloatexperienceintexperienceLevelintexperienceTotalEntityFishHookfishEntityprotected intflyToggleTimerprotected FoodStatsfoodStats+ The food object of the player, the general hunger logic.InventoryPlayerinventory+ Inventory of the playerContainerinventoryContainerContaineropenContainerBlockPosplayerLocationfloatprevCameraYawdoubleprevChasingPosXdoubleprevChasingPosYdoubleprevChasingPosZfloatrenderOffsetXfloatrenderOffsetYfloatrenderOffsetZprotected booleansleepingprotected floatspeedInAirprotected floatspeedOnGroundintxpCooldown-
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 voidaddChatComponentMessage(IChatComponent var1)voidaddExhaustion(float parFloat1)+ increases exhaustion level by supplied amountvoidaddExperience(int amount)+ Add experience points to player.voidaddExperienceLevel(int i)+ Add experience levels to this player.voidaddMovementStat(double parDouble1, double parDouble2, double parDouble3)+ Adds a value to a movement statistic field - like run, walk, swin or climb.voidaddScore(int parInt1)+ Add to player's scorevoidaddStat(StatBase var1, int var2)+ Adds a value to a statistic field.voidaddToPlayerScore(Entity entity, int i)+ Adds a value to the player score.protected voidapplyEntityAttributes()booleanattackEntityFrom(DamageSource damagesource, float f)+ Called when the entity is attacked.voidattackTargetEntityWithCurrentItem(Entity entity)+ Attacks for the player the targeted entity with the currently equipped item.booleancanAttackPlayer(EntityPlayer entityplayer)booleancanEat(boolean ignoreHunger)booleancanHarvestBlock(Block blockToHarvest)+ Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary)booleancanOpen(LockCode code)+ Check whether this player can open an inventory locked with the given LockCode.booleancanPlayerEdit(BlockPos parBlockPos, EnumFacing parEnumFacing, ItemStack parItemStack)protected booleancanTriggerWalking()+ returns if this entity triggers Block.onEntityWalking on the blocks they walk on.voidclearItemInUse()voidclonePlayer(EntityPlayer entityplayer, boolean flag)+ Copies the values from the given player into this player if boolean par2 is true.protected voidcloseScreen()+ set current crafting inventory back to the 2x2 squareprotected voiddamageArmor(float f)protected voiddamageEntity(DamageSource damagesource, float f)+ Deals damage to the entity.voiddestroyCurrentEquippedItem()+ Destroys the currently equipped item from the player's inventory.voiddisplayGui(IInteractionObject var1)voiddisplayGUIBook(ItemStack var1)+ Displays the GUI for interacting with a book.voiddisplayGUIChest(IInventory var1)+ Displays the GUI for interacting with a chest inventory.voiddisplayGUIHorse(EntityHorse var1, IInventory var2)voiddisplayVillagerTradeGui(IMerchant var1)EntityItemdropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem)EntityItemdropOneItem(boolean flag)+ Called when player presses the drop item keyEntityItemdropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused)+ Args: itemstack, flagprotected voidentityInit()voidfall(float f, float f1)voidfunc_175145_a(StatBase var1)floatgetAbsorptionAmount()floatgetAIMoveSpeed()+ the movespeed used for the new AI systembooleangetAlwaysRenderNameTagForRender()floatgetArmorVisibility()+ When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing them anyway.BlockPosgetBedLocation()floatgetBedOrientationInDegrees()+ Returns the orientation of the bed in degrees.static BlockPosgetBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn)+ Return null if bed is invalidItemStackgetCurrentArmor(int i)ItemStackgetCurrentEquippedItem()+ Returns the currently being used item by the player.protected java.lang.StringgetDeathSound()+ Returns the sound this mob makes on death.IChatComponentgetDisplayName()+ Get the formatted ChatComponent that will be used for the sender's username in chatItemStackgetEquipmentInSlot(int i)+ 0: Tool in Hand; 1-4: Armorprotected intgetExperiencePoints(EntityPlayer var1)+ Get the experience points the entity currently has.floatgetEyeHeight()protected java.lang.StringgetFallSoundString(int i)FoodStatsgetFoodStats()+ Returns the player's FoodStats object.GameProfilegetGameProfile()+ Returns the GameProfile for this playerItemStackgetHeldItem()+ Returns the item that this EntityLiving is holding, if any.protected java.lang.StringgetHurtSound()+ Returns the sound this mob makes when it is hurt.ItemStack[]getInventory()+ returns the inventory of this entity (only used in EntityPlayerMP it seems)InventoryEnderChestgetInventoryEnderChest()+ Returns the InventoryEnderChest of this player.ItemStackgetItemInUse()+ returns the ItemStack containing the itemInUseintgetItemInUseCount()+ Returns the item in use countintgetItemInUseDuration()+ gets the duration for how long the current itemInUse has been in useintgetMaxInPortalTime()+ Return the amount of time this entity should stay in a portal before being transported.java.lang.StringgetName()+ Gets the name of this command sender (usually username, but possibly "Rcon")static EaglercraftUUIDgetOfflineUUID(java.lang.String username)intgetPortalCooldown()+ Return the amount of cooldown before this entity can use a portal again.intgetScore()intgetSleepTimer()protected java.lang.StringgetSplashSound()protected java.lang.StringgetSwimSound()TeamgetTeam()floatgetToolDigEfficiency(Block parBlock)+ Block hardness will be further counted in net/minecraft/block/Block.getPlayerRelativeBlockHardnessintgetTotalArmorValue()+ Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValuestatic EaglercraftUUIDgetUUID(GameProfile profile)+ Gets a players UUID given their GameProfieScoreboardgetWorldScoreboard()intgetXPSeed()doublegetYOffset()+ Returns the Y Offset of this entity.voidhandleStatusUpdate(byte b0)booleanhasReducedDebug()+ Whether the "reducedDebugInfo" option is active for this player.booleaninteractWith(Entity parEntity)booleanisAllowEdit()booleanisBlocking()booleanisEntityInsideOpaqueBlock()+ Checks if this entity is inside of an opaque blockbooleanisInvisibleToPlayer(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 booleanisMovementBlocked()+ Dead and sleeping entities cannot moveprotected booleanisPlayer()+ Only use is to identify if class is an instance of player for experience droppingbooleanisPlayerFullyAsleep()+ Returns whether or not the player is asleep and the screen has fully faded.booleanisPlayerSleeping()+ Returns whether player is sleeping or notbooleanisPushedByWater()booleanisSpawnForced()abstract booleanisSpectator()booleanisUser()+ returns true if this is an EntityPlayerSP, or the logged in player.booleanisUsingItem()+ Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButtonbooleanisWearing(EnumPlayerModelParts parEnumPlayerModelParts)protected voidjoinEntityItemWithWorld(EntityItem entityitem)+ Joins the passed in entity item with the world.voidjump()+ Causes this entity to do an upwards motion (jumping).voidloadPluginData(BaseData data)PluginDatamakePluginData()voidmoveEntityWithHeading(float f, float f1)+ Moves the entity based on the specified heading.voidonCriticalHit(Entity var1)+ Called when the player performs a critical hit on the Entity.voidonDeath(DamageSource damagesource)+ Called when the mob's health reaches 0.voidonEnchantmentCritical(Entity var1)protected voidonItemUseFinish()+ Used for when item use count runs out, ie: eating completedvoidonKillEntity(EntityLivingBase entitylivingbase)+ This method gets called when the entity kills another one.voidonLivingUpdate()+ Called frequently so the entity can update its state every tick as required.voidonUpdate()+ Called to update the entity's position/logic.voidopenEditCommandBlock(CommandBlockLogic var1)voidopenEditSign(TileEntitySign var1)voidplaySound(java.lang.String s, float f, float f1)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)voidreadEntityFromNBT(NBTTagCompound nbttagcompound)+ (abstract) Protected helper method to read subclass entity data from NBT.voidremoveExperienceLevel(int i)booleanreplaceItemInInventory(int i, ItemStack itemstack)protected voidresetHeight()+ sets the players height back to normal after doing things like sleeping and dieingvoidrespawnPlayer()booleansendCommandFeedback()+ Returns true if the command sender should be sent feedback about executed commandsvoidsendPlayerAbilities()+ Sends the player's abilities to the server (if there is one).voidsetAbsorptionAmount(float f)voidsetCurrentItemOrArmor(int i, ItemStack itemstack)+ Sets the held item, or an armor slot.voidsetDead()+ Will get destroyed next tick.voidsetGameType(WorldSettings.GameType var1)+ Sets the player's game mode and sends it to them.voidsetInWeb()+ Sets the Entity inside a web block.voidsetItemInUse(ItemStack itemstack, int i)+ sets the itemInUse when the use item button is clicked.voidsetReducedDebug(boolean reducedDebug)voidsetScore(int parInt1)+ Set player's scorevoidsetSpawnPoint(BlockPos pos, boolean forced)booleanshouldHeal()+ Checks if the player's health is not full and not zero.voidstopUsingItem()voidtriggerAchievement(StatBase achievementIn)+ Will trigger the specified trigger.EntityPlayer.EnumStatustrySleep(BlockPos blockpos)protected voidupdateEntityActionState()protected voidupdateItemUse(ItemStack itemStackIn, int parInt1)+ Plays sounds and makes particles for item in use statevoidupdateRidden()+ Handles updating while being ridden by an entityvoidwakeUpPlayer(boolean flag, boolean flag1, boolean flag2)+ Wake up the player if they're sleeping.voidwriteEntityToNBT(NBTTagCompound nbttagcompound)+ (abstract) Protected helper method to write subclass entity data to NBT.intxpBarCap()+ 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:
applyEntityAttributesin classEntityLivingBase
-
entityInit
protected void entityInit()
- Overrides:
entityInitin classEntityLivingBase
-
loadPluginData
public void loadPluginData(BaseData data)
- Overrides:
loadPluginDatain classEntityLivingBase
-
makePluginData
public PluginData makePluginData()
- Overrides:
makePluginDatain 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:
onUpdatein classEntityLivingBase
-
getMaxInPortalTime
public int getMaxInPortalTime()
+ Return the amount of time this entity should stay in a portal before being transported.- Overrides:
getMaxInPortalTimein classEntity
-
getSwimSound
protected java.lang.String getSwimSound()
- Overrides:
getSwimSoundin classEntity
-
getSplashSound
protected java.lang.String getSplashSound()
- Overrides:
getSplashSoundin classEntity
-
getPortalCooldown
public int getPortalCooldown()
+ Return the amount of cooldown before this entity can use a portal again.- Overrides:
getPortalCooldownin 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:
handleStatusUpdatein classEntityLivingBase
-
isMovementBlocked
protected boolean isMovementBlocked()
+ Dead and sleeping entities cannot move- Overrides:
isMovementBlockedin 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:
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 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:
onDeathin classEntityLivingBase
-
getHurtSound
protected java.lang.String getHurtSound()
+ Returns the sound this mob makes when it is hurt.- Overrides:
getHurtSoundin classEntityLivingBase
-
getDeathSound
protected java.lang.String getDeathSound()
+ Returns the sound this mob makes on death.- Overrides:
getDeathSoundin 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:
addToPlayerScorein 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:
readEntityFromNBTin classEntityLivingBase
-
writeEntityToNBT
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
writeEntityToNBTin classEntityLivingBase
-
attackEntityFrom
public boolean attackEntityFrom(DamageSource damagesource, float f)
+ Called when the entity is attacked.- Overrides:
attackEntityFromin classEntityLivingBase
-
canAttackPlayer
public boolean canAttackPlayer(EntityPlayer entityplayer)
-
damageArmor
protected void damageArmor(float f)
- Overrides:
damageArmorin classEntityLivingBase
-
getTotalArmorValue
public int getTotalArmorValue()
+ Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue- Overrides:
getTotalArmorValuein 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:
damageEntityin 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:
getYOffsetin 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:
isEntityInsideOpaqueBlockin 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:
isPlayerSleepingin 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:
jumpin classEntityLivingBase
-
moveEntityWithHeading
public void moveEntityWithHeading(float f, float f1)+ Moves the entity based on the specified heading. Args: strafe, forward- Overrides:
moveEntityWithHeadingin classEntityLivingBase
-
getAIMoveSpeed
public float getAIMoveSpeed()
+ the movespeed used for the new AI system- Overrides:
getAIMoveSpeedin 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:
fallin classEntityLivingBase
-
resetHeight
protected void resetHeight()
+ sets the players height back to normal after doing things like sleeping and dieing- Overrides:
resetHeightin classEntity
-
getFallSoundString
protected java.lang.String getFallSoundString(int i)
- Overrides:
getFallSoundStringin classEntityLivingBase
-
onKillEntity
public void onKillEntity(EntityLivingBase entitylivingbase)
+ This method gets called when the entity kills another one.- Overrides:
onKillEntityin classEntity
-
setInWeb
public void setInWeb()
+ Sets the Entity inside a web block.
-
getCurrentArmor
public ItemStack getCurrentArmor(int i)
- Specified by:
getCurrentArmorin 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:
getExperiencePointsin classEntityLivingBase
-
isPlayer
protected boolean isPlayer()
+ Only use is to identify if class is an instance of player for experience dropping- Overrides:
isPlayerin classEntityLivingBase
-
getAlwaysRenderNameTagForRender
public boolean getAlwaysRenderNameTagForRender()
- Overrides:
getAlwaysRenderNameTagForRenderin 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:
canTriggerWalkingin 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:
getNamein interfaceICommandSender- Overrides:
getNamein 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:
getEquipmentInSlotin classEntityLivingBase
-
getHeldItem
public ItemStack getHeldItem()
+ Returns the item that this EntityLiving is holding, if any.- Specified by:
getHeldItemin 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:
setCurrentItemOrArmorin 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:
isInvisibleToPlayerin classEntity
-
isSpectator
public abstract boolean isSpectator()
-
getInventory
public ItemStack[] getInventory()
+ returns the inventory of this entity (only used in EntityPlayerMP it seems)- Specified by:
getInventoryin classEntityLivingBase
-
isPushedByWater
public boolean isPushedByWater()
- Overrides:
isPushedByWaterin classEntity
-
getWorldScoreboard
public Scoreboard getWorldScoreboard()
-
getTeam
public Team getTeam()
- Overrides:
getTeamin classEntityLivingBase
-
getDisplayName
public IChatComponent getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chat- Specified by:
getDisplayNamein interfaceICommandSender- Overrides:
getDisplayNamein classEntity
-
getEyeHeight
public float getEyeHeight()
- Overrides:
getEyeHeightin classEntity
-
setAbsorptionAmount
public void setAbsorptionAmount(float f)
- Overrides:
setAbsorptionAmountin classEntityLivingBase
-
getAbsorptionAmount
public float getAbsorptionAmount()
- Overrides:
getAbsorptionAmountin 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:
sendCommandFeedbackin interfaceICommandSender- Overrides:
sendCommandFeedbackin classEntity
-
replaceItemInInventory
public boolean replaceItemInInventory(int i, ItemStack itemstack)- Overrides:
replaceItemInInventoryin classEntity
-
hasReducedDebug
public boolean hasReducedDebug()
+ Whether the "reducedDebugInfo" option is active for this player.
-
setReducedDebug
public void setReducedDebug(boolean reducedDebug)
-
-