Class EntityPlayerSP

All Implemented Interfaces:
ICommandSender
Direct Known Subclasses:
EntityClientPlayerMP

@Environment(CLIENT) public class EntityPlayerSP extends AbstractClientPlayer
  • Field Details

    • movementInput

      public MovementInput movementInput
    • mc

      protected Minecraft mc
    • sprintToggleTimer

      protected int sprintToggleTimer
      Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable sprinting.
    • 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
    • exhaustionAddedSinceLastGuiUpdate

      public boolean exhaustionAddedSinceLastGuiUpdate
  • Constructor Details

    • EntityPlayerSP

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

    • updateEntityActionState

      public void updateEntityActionState()
      Overrides:
      updateEntityActionState in class EntityPlayer
    • 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
    • displayGUIHorse

      public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory)
      Overrides:
      displayGUIHorse in class EntityPlayer
    • displayGUIHopperMinecart

      public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
      Overrides:
      displayGUIHopperMinecart 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
    • isUsingSpecialKey

      public boolean isUsingSpecialKey()
      Overrides:
      isUsingSpecialKey in class EntityPlayer
    • 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
    • pushOutOfBlocks

      protected boolean pushOutOfBlocks(double par1, double par3, double par5)
      Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z
      Overrides:
      pushOutOfBlocks in class Entity
    • 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)
      Description copied from class: EntityPlayer
      /* the playSound function both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same player
      Overrides:
      playSound in class EntityPlayer
    • addExhaustion

      public void addExhaustion(float fAmount)
      Description copied from class: EntityPlayer
      increases exhaustion level by supplied amount
      Overrides:
      addExhaustion in class EntityPlayer
    • addExhaustionWithoutVisualFeedback

      public void addExhaustionWithoutVisualFeedback(float fAmount)
      Overrides:
      addExhaustionWithoutVisualFeedback in class EntityPlayer
    • updateGloomState

      protected void updateGloomState()
      Overrides:
      updateGloomState in class EntityPlayer
    • playSoundInRandomDirection

      public void playSoundInRandomDirection(String sSoundName, float fVolume, float fPitch, double dDistance)
    • 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()
    • func_110318_g

      protected void func_110318_g()
    • isLocalPlayerAndHittingBlock

      public boolean isLocalPlayerAndHittingBlock()
      Overrides:
      isLocalPlayerAndHittingBlock in class EntityPlayer
    • getData

      public <T> T getData(DataEntry.PlayerDataEntry<T> entry)
      Specified by:
      getData in class EntityPlayer
    • setData

      public <T> void setData(DataEntry.PlayerDataEntry<T> entry, T value)
      Specified by:
      setData in class EntityPlayer