Class LocalPlayer

All Implemented Interfaces:
CommandSource, Attackable, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, IPlayerExtension, INBTSerializable<CompoundTag>

public class LocalPlayer extends AbstractClientPlayer
  • Field Details

    • LOGGER

      public static final org.slf4j.Logger LOGGER
    • POSITION_REMINDER_INTERVAL

      private static final int POSITION_REMINDER_INTERVAL
      See Also:
    • WATER_VISION_MAX_TIME

      private static final int WATER_VISION_MAX_TIME
      See Also:
    • WATER_VISION_QUICK_TIME

      private static final int WATER_VISION_QUICK_TIME
      See Also:
    • WATER_VISION_QUICK_PERCENT

      private static final float WATER_VISION_QUICK_PERCENT
      See Also:
    • SUFFOCATING_COLLISION_CHECK_SCALE

      private static final double SUFFOCATING_COLLISION_CHECK_SCALE
      See Also:
    • MINOR_COLLISION_ANGLE_THRESHOLD_RADIAN

      private static final double MINOR_COLLISION_ANGLE_THRESHOLD_RADIAN
      See Also:
    • DEFAULT_SNEAKING_MOVEMENT_FACTOR

      private static final float DEFAULT_SNEAKING_MOVEMENT_FACTOR
      See Also:
    • 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
    • input

      public Input input
    • minecraft

      protected final Minecraft minecraft
    • sprintTriggerTime

      protected int sprintTriggerTime
    • yBob

      public float yBob
    • xBob

      public float xBob
    • yBobO

      public float yBobO
    • xBobO

      public float xBobO
    • jumpRidingTicks

      private int jumpRidingTicks
    • jumpRidingScale

      private float jumpRidingScale
    • spinningEffectIntensity

      public float spinningEffectIntensity
    • oSpinningEffectIntensity

      public float oSpinningEffectIntensity
    • startedUsingItem

      private boolean startedUsingItem
    • usingItemHand

      @Nullable 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
    • doLimitedCrafting

      private boolean doLimitedCrafting
  • 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 AbstractClientPlayer
    • getCurrentMood

      public float getCurrentMood()
    • sendPosition

      private void sendPosition()
    • sendIsSprintingIfNeeded

      private void sendIsSprintingIfNeeded()
    • drop

      public boolean drop(boolean p_108701_)
    • 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()
    • getStats

      public StatsCounter getStats()
    • getRecipeBook

      public ClientRecipeBook getRecipeBook()
    • removeRecipeHighlight

      public void removeRecipeHighlight(RecipeHolder<?> p_300983_)
    • getPermissionLevel

      public 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_)
    • setExperienceValues

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

      public void sendSystemMessage(Component p_234129_)
      Specified by:
      sendSystemMessage in interface CommandSource
      Overrides:
      sendSystemMessage 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()
    • setDoLimitedCrafting

      public void setDoLimitedCrafting(boolean p_302021_)
    • getDoLimitedCrafting

      public boolean getDoLimitedCrafting()
    • 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 Entity
    • 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
    • jumpableVehicle

      @Nullable public PlayerRideableJumping jumpableVehicle()
    • getJumpRidingScale

      public float getJumpRidingScale()
    • isTextFilteringEnabled

      public boolean isTextFilteringEnabled()
      Overrides:
      isTextFilteringEnabled in class Player
    • openTextEdit

      public void openTextEdit(SignBlockEntity p_277970_, boolean p_277980_)
      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_)
    • isHorizontalCollisionMinor

      protected boolean isHorizontalCollisionMinor(Vec3 p_197411_)
      Overrides:
      isHorizontalCollisionMinor in class Entity
    • canAutoJump

      private boolean canAutoJump()
    • isMoving

      private boolean isMoving()
    • canStartSprinting

      private boolean canStartSprinting()
    • vehicleCanSprint

      private boolean vehicleCanSprint(Entity p_265184_)
    • hasEnoughImpulseToStartSprinting

      private boolean hasEnoughImpulseToStartSprinting()
    • hasEnoughFoodToStartSprinting

      private boolean hasEnoughFoodToStartSprinting()
    • getWaterVision

      public float getWaterVision()
    • onGameModeChanged

      public void onGameModeChanged(GameType p_287675_)
    • 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
    • updateTutorialInventoryAction

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

      public float getVisualRotationYInDegrees()
      Overrides:
      getVisualRotationYInDegrees in class LivingEntity