Class LocalPlayer

All Implemented Interfaces:
CommandSource, EntityAccess, Nameable, ICapabilityProvider, ICapabilitySerializable<CompoundTag>, IForgeEntity, INBTSerializable<CompoundTag>

public class LocalPlayer extends AbstractClientPlayer
  • Field Details

    • POSITION_REMINDER_INTERVAL

      private static final int POSITION_REMINDER_INTERVAL
      See Also:
      Constant Field Values
    • WATER_VISION_MAX_TIME

      private static final int WATER_VISION_MAX_TIME
      See Also:
      Constant Field Values
    • WATER_VISION_QUICK_TIME

      private static final int WATER_VISION_QUICK_TIME
      See Also:
      Constant Field Values
    • WATER_VISION_QUICK_PERCENT

      private static final float WATER_VISION_QUICK_PERCENT
      See Also:
      Constant Field Values
    • SUFFOCATING_COLLISION_CHECK_SCALE

      private static final double SUFFOCATING_COLLISION_CHECK_SCALE
      See Also:
      Constant Field Values
    • connection

      public final ClientPacketListener connection
    • stats

      private final StatsCounter stats
    • recipeBook

      private final ClientRecipeBook recipeBook
    • ambientSoundHandlers

      private final List<AmbientSoundHandler> ambientSoundHandlers
    • permissionLevel

      private int permissionLevel
    • xLast

      private double xLast
    • yLast1

      private double yLast1
    • zLast

      private double zLast
    • yRotLast

      private float yRotLast
    • xRotLast

      private float xRotLast
    • lastOnGround

      private boolean lastOnGround
    • crouching

      private boolean crouching
    • wasShiftKeyDown

      private boolean wasShiftKeyDown
    • wasSprinting

      private boolean wasSprinting
    • positionReminder

      private int positionReminder
    • flashOnSetHealth

      private boolean flashOnSetHealth
    • serverBrand

      private String serverBrand
    • input

      public Input input
    • minecraft

      protected final Minecraft minecraft
    • sprintTriggerTime

      protected int sprintTriggerTime
    • sprintTime

      public int sprintTime
    • yBob

      public float yBob
    • xBob

      public float xBob
    • yBobO

      public float yBobO
    • xBobO

      public float xBobO
    • jumpRidingTicks

      private int jumpRidingTicks
    • jumpRidingScale

      private float jumpRidingScale
    • portalTime

      public float portalTime
    • oPortalTime

      public float oPortalTime
    • startedUsingItem

      private boolean startedUsingItem
    • usingItemHand

      private InteractionHand usingItemHand
    • handsBusy

      private boolean handsBusy
    • autoJumpEnabled

      private boolean autoJumpEnabled
    • autoJumpTime

      private int autoJumpTime
    • wasFallFlying

      private boolean wasFallFlying
    • waterVisionTime

      private int waterVisionTime
    • showDeathScreen

      private boolean showDeathScreen
  • Constructor Details

  • Method Details

    • hurt

      public boolean hurt(DamageSource p_108662_, float p_108663_)
      Overrides:
      hurt in class Player
    • heal

      public void heal(float p_108708_)
      Overrides:
      heal in class LivingEntity
    • startRiding

      public boolean startRiding(Entity p_108667_, boolean p_108668_)
      Overrides:
      startRiding in class Entity
    • removeVehicle

      public void removeVehicle()
      Overrides:
      removeVehicle in class Player
    • getViewXRot

      public float getViewXRot(float p_108742_)
      Overrides:
      getViewXRot in class Entity
    • getViewYRot

      public float getViewYRot(float p_108753_)
      Overrides:
      getViewYRot in class LivingEntity
    • tick

      public void tick()
      Overrides:
      tick in class Player
    • getCurrentMood

      public float getCurrentMood()
    • sendPosition

      private void sendPosition()
    • drop

      public boolean drop(boolean p_108701_)
    • chat

      public void chat(String p_108740_)
    • swing

      public void swing(InteractionHand p_108660_)
      Overrides:
      swing in class LivingEntity
    • respawn

      public void respawn()
      Overrides:
      respawn in class Player
    • actuallyHurt

      protected void actuallyHurt(DamageSource p_108729_, float p_108730_)
      Overrides:
      actuallyHurt in class Player
    • closeContainer

      public void closeContainer()
      Overrides:
      closeContainer in class Player
    • clientSideCloseContainer

      public void clientSideCloseContainer()
    • hurtTo

      public void hurtTo(float p_108761_)
    • onUpdateAbilities

      public void onUpdateAbilities()
      Overrides:
      onUpdateAbilities in class Player
    • isLocalPlayer

      public boolean isLocalPlayer()
      Overrides:
      isLocalPlayer in class Player
    • isSuppressingSlidingDownLadder

      public boolean isSuppressingSlidingDownLadder()
      Overrides:
      isSuppressingSlidingDownLadder in class LivingEntity
    • canSpawnSprintParticle

      public boolean canSpawnSprintParticle()
      Overrides:
      canSpawnSprintParticle in class Entity
    • canSpawnSoulSpeedParticle

      public boolean canSpawnSoulSpeedParticle()
      Overrides:
      canSpawnSoulSpeedParticle in class LivingEntity
    • sendRidingJump

      protected void sendRidingJump()
    • sendOpenInventory

      public void sendOpenInventory()
    • setServerBrand

      public void setServerBrand(String p_108749_)
    • getServerBrand

      public String getServerBrand()
    • getStats

      public StatsCounter getStats()
    • getRecipeBook

      public ClientRecipeBook getRecipeBook()
    • removeRecipeHighlight

      public void removeRecipeHighlight(Recipe<?> p_108676_)
    • getPermissionLevel

      protected int getPermissionLevel()
      Overrides:
      getPermissionLevel in class Entity
    • setPermissionLevel

      public void setPermissionLevel(int p_108649_)
    • displayClientMessage

      public void displayClientMessage(Component p_108696_, boolean p_108697_)
      Overrides:
      displayClientMessage in class Player
    • moveTowardsClosestSpace

      private void moveTowardsClosestSpace(double p_108705_, double p_108706_)
    • suffocatesAt

      private boolean suffocatesAt(BlockPos p_108747_)
    • setSprinting

      public void setSprinting(boolean p_108751_)
      Overrides:
      setSprinting in class LivingEntity
    • setExperienceValues

      public void setExperienceValues(float p_108645_, int p_108646_, int p_108647_)
    • sendMessage

      public void sendMessage(Component p_108693_, UUID p_108694_)
      Specified by:
      sendMessage in interface CommandSource
      Overrides:
      sendMessage in class Entity
    • handleEntityEvent

      public void handleEntityEvent(byte p_108643_)
      Overrides:
      handleEntityEvent in class Player
    • setShowDeathScreen

      public void setShowDeathScreen(boolean p_108712_)
    • shouldShowDeathScreen

      public boolean shouldShowDeathScreen()
    • playSound

      public void playSound(SoundEvent p_108651_, float p_108652_, float p_108653_)
      Overrides:
      playSound in class Player
    • playNotifySound

      public void playNotifySound(SoundEvent p_108655_, SoundSource p_108656_, float p_108657_, float p_108658_)
      Overrides:
      playNotifySound in class Player
    • isEffectiveAi

      public boolean isEffectiveAi()
      Overrides:
      isEffectiveAi in class LivingEntity
    • startUsingItem

      public void startUsingItem(InteractionHand p_108718_)
      Overrides:
      startUsingItem in class LivingEntity
    • isUsingItem

      public boolean isUsingItem()
      Overrides:
      isUsingItem in class LivingEntity
    • stopUsingItem

      public void stopUsingItem()
      Overrides:
      stopUsingItem in class LivingEntity
    • getUsedItemHand

      public InteractionHand getUsedItemHand()
      Overrides:
      getUsedItemHand in class LivingEntity
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> p_108699_)
      Overrides:
      onSyncedDataUpdated in class LivingEntity
    • isRidingJumpable

      public boolean isRidingJumpable()
    • getJumpRidingScale

      public float getJumpRidingScale()
    • openTextEdit

      public void openTextEdit(SignBlockEntity p_108684_)
      Overrides:
      openTextEdit in class Player
    • openMinecartCommandBlock

      public void openMinecartCommandBlock(BaseCommandBlock p_108678_)
      Overrides:
      openMinecartCommandBlock in class Player
    • openCommandBlock

      public void openCommandBlock(CommandBlockEntity p_108680_)
      Overrides:
      openCommandBlock in class Player
    • openStructureBlock

      public void openStructureBlock(StructureBlockEntity p_108686_)
      Overrides:
      openStructureBlock in class Player
    • openJigsawBlock

      public void openJigsawBlock(JigsawBlockEntity p_108682_)
      Overrides:
      openJigsawBlock in class Player
    • openItemGui

      public void openItemGui(ItemStack p_108673_, InteractionHand p_108674_)
      Overrides:
      openItemGui in class Player
    • crit

      public void crit(Entity p_108665_)
      Overrides:
      crit in class Player
    • magicCrit

      public void magicCrit(Entity p_108710_)
      Overrides:
      magicCrit in class Player
    • isShiftKeyDown

      public boolean isShiftKeyDown()
      Overrides:
      isShiftKeyDown in class Entity
    • isCrouching

      public boolean isCrouching()
      Overrides:
      isCrouching in class Entity
    • isMovingSlowly

      public boolean isMovingSlowly()
    • serverAiStep

      public void serverAiStep()
      Overrides:
      serverAiStep in class Player
    • isControlledCamera

      protected boolean isControlledCamera()
    • resetPos

      public void resetPos()
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class Player
    • tickDeath

      protected void tickDeath()
      Overrides:
      tickDeath in class LivingEntity
    • handleNetherPortalClient

      private void handleNetherPortalClient()
    • rideTick

      public void rideTick()
      Overrides:
      rideTick in class Player
    • isHandsBusy

      public boolean isHandsBusy()
    • removeEffectNoUpdate

      @Nullable public MobEffectInstance removeEffectNoUpdate(@Nullable MobEffect p_108720_)
      Overrides:
      removeEffectNoUpdate in class LivingEntity
    • move

      public void move(MoverType p_108670_, Vec3 p_108671_)
      Overrides:
      move in class Entity
    • isAutoJumpEnabled

      public boolean isAutoJumpEnabled()
    • updateAutoJump

      protected void updateAutoJump(float p_108744_, float p_108745_)
    • canAutoJump

      private boolean canAutoJump()
    • isMoving

      private boolean isMoving()
    • hasEnoughImpulseToStartSprinting

      private boolean hasEnoughImpulseToStartSprinting()
    • getWaterVision

      public float getWaterVision()
    • isUnderWater

      public boolean isUnderWater()
      Overrides:
      isUnderWater in class Entity
    • updateIsUnderwater

      protected boolean updateIsUnderwater()
      Overrides:
      updateIsUnderwater in class Player
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float p_108758_)
      Overrides:
      getRopeHoldPosition in class Player
    • updateSyncFields

      public void updateSyncFields(LocalPlayer old)
    • updateTutorialInventoryAction

      public void updateTutorialInventoryAction(ItemStack p_172532_, ItemStack p_172533_, ClickAction p_172534_)
      Overrides:
      updateTutorialInventoryAction in class Player