Class EntityPlayer

    • Field Detail

      • 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
    • Constructor Detail

      • EntityPlayer

        public EntityPlayer​(World worldIn,
                            GameProfile gameProfileIn)
    • Method Detail

      • 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 class EntityLivingBase
      • getMaxInPortalTime

        public int getMaxInPortalTime()
        + Return the amount of time this entity should stay in a portal before being transported.
        Overrides:
        getMaxInPortalTime in class Entity
      • getSwimSound

        protected java.lang.String getSwimSound()
        Overrides:
        getSwimSound in class Entity
      • getSplashSound

        protected java.lang.String getSplashSound()
        Overrides:
        getSplashSound in class Entity
      • getPortalCooldown

        public int getPortalCooldown()
        + Return the amount of cooldown before this entity can use a portal again.
        Overrides:
        getPortalCooldown in class Entity
      • playSound

        public void playSound​(java.lang.String s,
                              float f,
                              float f1)
        Overrides:
        playSound in class Entity
      • 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
      • 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 class EntityLivingBase
      • 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 class Entity
      • 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 class EntityLivingBase
      • 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
      • getHurtSound

        protected java.lang.String getHurtSound()
        + Returns the sound this mob makes when it is hurt.
        Overrides:
        getHurtSound in class EntityLivingBase
      • getDeathSound

        protected java.lang.String getDeathSound()
        + Returns the sound this mob makes on death.
        Overrides:
        getDeathSound in class EntityLivingBase
      • 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 class Entity
      • 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)
      • canAttackPlayer

        public boolean canAttackPlayer​(EntityPlayer entityplayer)
      • getTotalArmorValue

        public int getTotalArmorValue()
        + Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
        Overrides:
        getTotalArmorValue in class EntityLivingBase
      • 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 class EntityLivingBase
      • 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
      • 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 class Entity
      • 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()
      • setDead

        public void setDead()
        + Will get destroyed next tick.
        Overrides:
        setDead in class Entity
      • isEntityInsideOpaqueBlock

        public boolean isEntityInsideOpaqueBlock()
        + Checks if this entity is inside of an opaque block
        Overrides:
        isEntityInsideOpaqueBlock in class Entity
      • 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
      • 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.
      • 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 class EntityLivingBase
      • moveEntityWithHeading

        public void moveEntityWithHeading​(float f,
                                          float f1)
        + Moves the entity based on the specified heading. Args: strafe, forward
        Overrides:
        moveEntityWithHeading in class EntityLivingBase
      • addMovementStat

        public void addMovementStat​(double parDouble1,
                                    double parDouble2,
                                    double parDouble3)
        + Adds a value to a movement statistic field - like run, walk, swin or climb.
      • resetHeight

        protected void resetHeight()
        + sets the players height back to normal after doing things like sleeping and dieing
        Overrides:
        resetHeight in class Entity
      • onKillEntity

        public void onKillEntity​(EntityLivingBase entitylivingbase)
        + This method gets called when the entity kills another one.
        Overrides:
        onKillEntity in class Entity
      • setInWeb

        public void setInWeb()
        + Sets the Entity inside a web block.
        Overrides:
        setInWeb in class Entity
      • 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()
      • isPlayer

        protected boolean isPlayer()
        + Only use is to identify if class is an instance of player for experience dropping
        Overrides:
        isPlayer in class EntityLivingBase
      • 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 class Entity
      • 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 interface ICommandSender
        Overrides:
        getName in class Entity
      • getInventoryEnderChest

        public InventoryEnderChest getInventoryEnderChest()
        + Returns the InventoryEnderChest of this player.
      • 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 class EntityLivingBase
      • 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 class Entity
      • isSpectator

        public abstract boolean isSpectator()
      • getWorldScoreboard

        public Scoreboard getWorldScoreboard()
      • 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.
      • hasReducedDebug

        public boolean hasReducedDebug()
        + Whether the "reducedDebugInfo" option is active for this player.
      • setReducedDebug

        public void setReducedDebug​(boolean reducedDebug)