net.minecraft.client.entity

## Class EntityPlayerSP

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.EntityLivingBase
    - - net.minecraft.entity.player.EntityPlayer
      - - net.minecraft.client.entity.AbstractClientPlayer
        - - net.minecraft.client.entity.EntityPlayerSP

- All Implemented Interfaces:
    ICommandSender
  Direct Known Subclasses:
    EntityClientPlayerMP

      public class EntityPlayerSP
      extends AbstractClientPlayer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `MovementInput` | `movementInput`
    `float` | `prevRenderArmPitch`
    `float` | `prevRenderArmYaw`
    `float` | `prevTimeInPortal` The amount of time an entity has been in a Portal the previous tick
    `float` | `renderArmPitch`
    `float` | `renderArmYaw`
    `int` | `sprintingTicksLeft` Ticks left before sprinting is disabled.
    `float` | `timeInPortal` The amount of time an entity has been in a Portal

    - ### Fields inherited from class net.minecraft.client.entity.AbstractClientPlayer

      `locationStevePng`

    - ### Fields inherited from class net.minecraft.entity.player.EntityPlayer

      `cameraYaw, capabilities, experience, experienceLevel, experienceTotal, eyeHeight, field_71079_bU, field_71082_cx, field_71085_bR, field_71089_bV, field_71091_bM, field_71094_bP, field_71095_bQ, field_71096_bN, field_71097_bO, fishEntity, inventory, inventoryContainer, openContainer, PERSISTED_NBT_TAG, playerLocation, prevCameraYaw, sleepTimer, username, xpCooldown`

    - ### Fields inherited from class net.minecraft.entity.EntityLivingBase

      `arrowHitTimer, attackedAtYaw, attackTime, cameraPitch, deathTime, field_70769_ao, field_70770_ap, hurtTime, isSwingInProgress, jumpMovementFactor, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, renderYawOffset, rotationYawHead, swingProgress, swingProgressInt`

    - ### Fields inherited from class net.minecraft.entity.Entity

      `addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityPlayerSP(Minecraft par1Minecraft, World par2World, Session par3Session, int par4)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChatMessage(String par1Str)` Add a chat message to the player
    `void` | `addStat(StatBase par1StatBase, int par2)` Adds a value to a statistic field.
    `boolean` | `canCommandSenderUseCommand(int par1, String par2Str)` Returns true if the command sender is allowed to use the given command.
    `void` | `closeScreen()` sets current screen to null (used on escape buttons of GUIs)
    `void` | `displayGUIAnvil(int par1, int par2, int par3)` Displays the GUI for interacting with an anvil.
    `void` | `displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon)` Displays the GUI for interacting with a beacon.
    `void` | `displayGUIBook(ItemStack par1ItemStack)` Displays the GUI for interacting with a book.
    `void` | `displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)` Displays the GUI for interacting with a brewing stand.
    `void` | `displayGUIChest(IInventory par1IInventory)` Displays the GUI for interacting with a chest inventory.
    `void` | `displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)` Displays the dipsenser GUI for the passed in dispenser entity.
    `void` | `displayGUIEditSign(TileEntity par1TileEntity)` Displays the GUI for editing a sign.
    `void` | `displayGUIEnchantment(int par1, int par2, int par3, String par4Str)`
    `void` | `displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)` Displays the furnace GUI for the passed in furnace entity.
    `void` | `displayGUIHopper(TileEntityHopper par1TileEntityHopper)`
    `void` | `displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)`
    `void` | `displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory)`
    `void` | `displayGUIMerchant(IMerchant par1IMerchant, String par2Str)`
    `void` | `displayGUIWorkbench(int par1, int par2, int par3)` Displays the crafting GUI for a workbench.
    `float` | `getFOVMultiplier()` Gets the player's field of view multiplier.
    `ItemStack` | `getHeldItem()` Returns the item that this EntityLiving is holding, if any.
    `float` | `getHorseJumpPower()`
    `ChunkCoordinates` | `getPlayerCoordinates()` Return the position for this command sender.
    `boolean` | `isClientWorld()` Returns whether the entity is in a local (client) world
    `boolean` | `isRidingHorse()`
    `boolean` | `isSneaking()` Returns if this entity is sneaking.
    `void` | `onCriticalHit(Entity par1Entity)` Called when the player performs a critical hit on the Entity.
    `void` | `onEnchantmentCritical(Entity par1Entity)`
    `void` | `onItemPickup(Entity par1Entity, int par2)` Called whenever an item is picked up from walking over it.
    `void` | `onLivingUpdate()` Called frequently so the entity can update its state every tick as required.
    `void` | `playSound(String par1Str, float par2, float par3)`
    `void` | `sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)`
    `void` | `setPlayerSPHealth(float par1)` Updates health locally.
    `void` | `setSprinting(boolean par1)` Set sprinting switch for Entity.
    `void` | `setXPStats(float par1, int par2, int par3)` Sets the current XP, total XP, and level number.
    `void` | `updateEntityActionState()`

    - ### Methods inherited from class net.minecraft.client.entity.AbstractClientPlayer

      `getCapeUrl, getDownloadImageCape, getDownloadImageSkin, getLocationCape, getLocationCape, getLocationSkin, getLocationSkin, getLocationSkull, getSkinUrl, getTextureCape, getTextureSkin`

    - ### Methods inherited from class net.minecraft.entity.player.EntityPlayer

      `addExhaustion, addExperience, addExperienceLevel, addMovementStat, addScore, addToPlayerScore, attackEntityFrom, attackTargetEntityWithCurrentItem, canAttackPlayer, canEat, canHarvestBlock, canPlayerEdit, clearItemInUse, clonePlayer, destroyCurrentEquippedItem, dropOneItem, dropPlayerItem, dropPlayerItemWithRandomChoice, getAbsorptionAmount, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArmorVisibility, getBedLocation, getBedLocation, getBedOrientationInDegrees, getCommandSenderName, getCurrentArmor, getCurrentEquippedItem, getCurrentItemOrArmor, getCurrentPlayerStrVsBlock, getCurrentPlayerStrVsBlock, getDefaultEyeHeight, getDisplayName, getEntityName, getEntityWorld, getEyeHeight, getFoodStats, getHideCape, getInventoryEnderChest, getItemIcon, getItemInUse, getItemInUseCount, getItemInUseDuration, getLastActiveItems, getMaxInPortalTime, getPortalCooldown, getScore, getSleepTimer, getTeam, getTotalArmorValue, getTranslatedEntityName, getWorldScoreboard, getYOffset, handleHealthUpdate, interactWith, isBlocking, isCurrentToolAdventureModeExempt, isEntityInsideOpaqueBlock, isInvisibleToPlayer, isPlayerFullyAsleep, isPlayerSleeping, isPushedByWater, isSpawnForced, isSpawnForced, isUsingItem, joinEntityItemWithWorld, mountEntity, moveEntityWithHeading, onDeath, onKillEntity, onUpdate, openGui, preparePlayerToSpawn, readEntityFromNBT, refreshDisplayName, respawnPlayer, sendPlayerAbilities, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setGameType, setInWeb, setItemInUse, setScore, setSpawnChunk, setSpawnChunk, shouldHeal, sleepInBedAt, stopUsingItem, triggerAchievement, updateRidden, verifyRespawnCoordinates, wakeUpPlayer, writeEntityToNBT, xpBarCap`

    - ### Methods inherited from class net.minecraft.entity.EntityLivingBase

      `addPotionEffect, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, clearActivePotions, curePotionEffects, dismountEntity, func_110142_aN, func_142015_aE, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getEntityAttribute, getHealth, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getPosition, getRNG, getRotationYawHead, getSwingProgress, heal, isChild, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, knockBack, onEntityUpdate, performHurtAnimation, rayTrace, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAIMoveSpeed, setArrowCountInEntity, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, shouldRiderFaceForward, swingItem`

    - ### Methods inherited from class net.minecraft.entity.Entity

      `addEntityCrashInfo, addVelocity, applyEntityCollision, canAttackWithItem, canRenderOnFire, canRiderInteract, copyDataFrom, copyLocationAndAnglesFrom, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAir, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getExtendedProperties, getMaxSafePointTries, getMountedYOffset, getParts, getPersistentID, getPickedResult, getShadowSize, getTeleportDirection, getUniqueID, handleLavaMovement, handleWaterMovement, hashCode, hitByEntity, interactFirst, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInWater, isOffsetPositionInLiquid, isRiding, isSprinting, isWet, moveEntity, moveFlying, onChunkLoad, onCollideWithPlayer, onStruckByLightning, readFromNBT, registerExtendedProperties, resetEntityId, setAir, setAngles, setEating, setFire, setInPortal, setInvisible, setLocationAndAngles, setPosition, setPositionAndRotation, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldExplodeBlock, shouldRenderInPass, shouldRiderSit, toString, travelToDimension, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### movementInput

          public MovementInput movementInput

    - #### sprintingTicksLeft

          public int sprintingTicksLeft

      Ticks left before sprinting is disabled.

    - #### renderArmYaw

          public float renderArmYaw

    - #### renderArmPitch

          public float renderArmPitch

    - #### prevRenderArmYaw

          public float prevRenderArmYaw

    - #### prevRenderArmPitch

          public float prevRenderArmPitch

    - #### timeInPortal

          public float timeInPortal

      The amount of time an entity has been in a Portal

    - #### prevTimeInPortal

          public float prevTimeInPortal

      The amount of time an entity has been in a Portal the previous tick

  - ### Constructor Detail

    - #### EntityPlayerSP

          public EntityPlayerSP(Minecraft par1Minecraft,
                        World par2World,
                        Session par3Session,
                        int par4)

  - ### Method Detail

    - #### updateEntityActionState

          public void updateEntityActionState()

    - #### 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 `EntityPlayer`

    - #### getFOVMultiplier

          public float getFOVMultiplier()

      Gets the player's field of view multiplier. (ex. when flying)

    - #### closeScreen

          public void closeScreen()

      sets current screen to null (used on escape buttons of GUIs)
      Overrides:
        `closeScreen` in class `EntityPlayer`

    - #### displayGUIEditSign

          public void displayGUIEditSign(TileEntity par1TileEntity)

      Displays the GUI for editing a sign. Args: tileEntitySign
      Overrides:
        `displayGUIEditSign` in class `EntityPlayer`

    - #### displayGUIBook

          public void displayGUIBook(ItemStack par1ItemStack)

      Displays the GUI for interacting with a book.
      Overrides:
        `displayGUIBook` in class `EntityPlayer`

    - #### displayGUIChest

          public void displayGUIChest(IInventory par1IInventory)

      Displays the GUI for interacting with a chest inventory. Args: chestInventory
      Overrides:
        `displayGUIChest` in class `EntityPlayer`

    - #### displayGUIHopper

          public void displayGUIHopper(TileEntityHopper par1TileEntityHopper)

      Overrides:
        `displayGUIHopper` in class `EntityPlayer`

    - #### displayGUIHopperMinecart

          public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)

      Overrides:
        `displayGUIHopperMinecart` in class `EntityPlayer`

    - #### displayGUIHorse

          public void displayGUIHorse(EntityHorse par1EntityHorse,
                             IInventory par2IInventory)

      Overrides:
        `displayGUIHorse` in class `EntityPlayer`

    - #### displayGUIWorkbench

          public void displayGUIWorkbench(int par1,
                                 int par2,
                                 int par3)

      Displays the crafting GUI for a workbench.
      Overrides:
        `displayGUIWorkbench` in class `EntityPlayer`

    - #### displayGUIEnchantment

          public void displayGUIEnchantment(int par1,
                                   int par2,
                                   int par3,
                                   String par4Str)

      Overrides:
        `displayGUIEnchantment` in class `EntityPlayer`

    - #### displayGUIAnvil

          public void displayGUIAnvil(int par1,
                             int par2,
                             int par3)

      Displays the GUI for interacting with an anvil.
      Overrides:
        `displayGUIAnvil` in class `EntityPlayer`

    - #### displayGUIFurnace

          public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)

      Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace
      Overrides:
        `displayGUIFurnace` in class `EntityPlayer`

    - #### displayGUIBrewingStand

          public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)

      Displays the GUI for interacting with a brewing stand.
      Overrides:
        `displayGUIBrewingStand` in class `EntityPlayer`

    - #### displayGUIBeacon

          public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon)

      Displays the GUI for interacting with a beacon.
      Overrides:
        `displayGUIBeacon` in class `EntityPlayer`

    - #### displayGUIDispenser

          public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)

      Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser
      Overrides:
        `displayGUIDispenser` in class `EntityPlayer`

    - #### displayGUIMerchant

          public void displayGUIMerchant(IMerchant par1IMerchant,
                                String par2Str)

      Overrides:
        `displayGUIMerchant` in class `EntityPlayer`

    - #### onCriticalHit

          public void onCriticalHit(Entity par1Entity)

      Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
      Overrides:
        `onCriticalHit` in class `EntityPlayer`

    - #### onEnchantmentCritical

          public void onEnchantmentCritical(Entity par1Entity)

      Overrides:
        `onEnchantmentCritical` in class `EntityPlayer`

    - #### onItemPickup

          public void onItemPickup(Entity par1Entity,
                          int par2)

      Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
      Overrides:
        `onItemPickup` in class `EntityLivingBase`

    - #### isSneaking

          public boolean isSneaking()

      Returns if this entity is sneaking.
      Overrides:
        `isSneaking` in class `Entity`

    - #### setPlayerSPHealth

          public void setPlayerSPHealth(float par1)

      Updates health locally.

    - #### addChatMessage

          public void addChatMessage(String par1Str)

      Add a chat message to the player
      Overrides:
        `addChatMessage` in class `EntityPlayer`

    - #### addStat

          public void addStat(StatBase par1StatBase,
                     int par2)

      Adds a value to a statistic field.
      Overrides:
        `addStat` in class `EntityPlayer`

    - #### setSprinting

          public void setSprinting(boolean par1)

      Set sprinting switch for Entity.
      Overrides:
        `setSprinting` in class `EntityLivingBase`

    - #### setXPStats

          public void setXPStats(float par1,
                        int par2,
                        int par3)

      Sets the current XP, total XP, and level number.

    - #### sendChatToPlayer

          public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)

    - #### canCommandSenderUseCommand

          public boolean canCommandSenderUseCommand(int par1,
                                           String par2Str)

      Returns true if the command sender is allowed to use the given command.

    - #### getPlayerCoordinates

          public ChunkCoordinates getPlayerCoordinates()

      Return the position for this command sender.

    - #### getHeldItem

          public ItemStack getHeldItem()

      Returns the item that this EntityLiving is holding, if any.
      Overrides:
        `getHeldItem` in class `EntityPlayer`

    - #### playSound

          public void playSound(String par1Str,
                       float par2,
                       float par3)

      Overrides:
        `playSound` in class `EntityPlayer`

    - #### isClientWorld

          public boolean isClientWorld()

      Returns whether the entity is in a local (client) world
      Overrides:
        `isClientWorld` in class `EntityLivingBase`

    - #### isRidingHorse

          public boolean isRidingHorse()

    - #### getHorseJumpPower

          public float getHorseJumpPower()