Class Player

All Implemented Interfaces:
DataComponentGetter, SyncedDataHolder, Attackable, EntityAccess, UniquelyIdentifyable, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, IPlayerExtension
Direct Known Subclasses:
AbstractClientPlayer, ServerPlayer

public abstract class Player extends LivingEntity implements IPlayerExtension
  • Field Details

    • PERSISTED_NBT_TAG

      public static final String PERSISTED_NBT_TAG
      See Also:
    • DEFAULT_MAIN_HAND

      public static final HumanoidArm DEFAULT_MAIN_HAND
    • DEFAULT_MODEL_CUSTOMIZATION

      public static final int DEFAULT_MODEL_CUSTOMIZATION
      See Also:
    • MAX_HEALTH

      public static final int MAX_HEALTH
      See Also:
    • SLEEP_DURATION

      public static final int SLEEP_DURATION
      See Also:
    • WAKE_UP_DURATION

      public static final int WAKE_UP_DURATION
      See Also:
    • ENDER_SLOT_OFFSET

      public static final int ENDER_SLOT_OFFSET
      See Also:
    • HELD_ITEM_SLOT

      public static final int HELD_ITEM_SLOT
      See Also:
    • CRAFTING_SLOT_OFFSET

      public static final int CRAFTING_SLOT_OFFSET
      See Also:
    • DEFAULT_BLOCK_INTERACTION_RANGE

      public static final float DEFAULT_BLOCK_INTERACTION_RANGE
      See Also:
    • DEFAULT_ENTITY_INTERACTION_RANGE

      public static final float DEFAULT_ENTITY_INTERACTION_RANGE
      See Also:
    • CROUCH_BB_HEIGHT

      public static final float CROUCH_BB_HEIGHT
      See Also:
    • SWIMMING_BB_WIDTH

      public static final float SWIMMING_BB_WIDTH
      See Also:
    • SWIMMING_BB_HEIGHT

      public static final float SWIMMING_BB_HEIGHT
      See Also:
    • DEFAULT_EYE_HEIGHT

      public static final float DEFAULT_EYE_HEIGHT
      See Also:
    • CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS

      private static final int CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS
      See Also:
    • DEFAULT_VEHICLE_ATTACHMENT

      public static final Vec3 DEFAULT_VEHICLE_ATTACHMENT
    • STANDING_DIMENSIONS

      public static final EntityDimensions STANDING_DIMENSIONS
    • POSES

      private static final Map<Pose,EntityDimensions> POSES
    • DATA_PLAYER_ABSORPTION_ID

      private static final EntityDataAccessor<Float> DATA_PLAYER_ABSORPTION_ID
    • DATA_SCORE_ID

      private static final EntityDataAccessor<Integer> DATA_SCORE_ID
    • DATA_PLAYER_MODE_CUSTOMISATION

      protected static final EntityDataAccessor<Byte> DATA_PLAYER_MODE_CUSTOMISATION
    • DATA_PLAYER_MAIN_HAND

      protected static final EntityDataAccessor<Byte> DATA_PLAYER_MAIN_HAND
    • DATA_SHOULDER_LEFT

      protected static final EntityDataAccessor<CompoundTag> DATA_SHOULDER_LEFT
    • DATA_SHOULDER_RIGHT

      protected static final EntityDataAccessor<CompoundTag> DATA_SHOULDER_RIGHT
    • CLIENT_LOADED_TIMEOUT_TIME

      public static final int CLIENT_LOADED_TIMEOUT_TIME
      See Also:
    • DEFAULT_SLEEP_TIMER

      private static final short DEFAULT_SLEEP_TIMER
      See Also:
    • DEFAULT_EXPERIENCE_PROGRESS

      private static final float DEFAULT_EXPERIENCE_PROGRESS
      See Also:
    • DEFAULT_EXPERIENCE_LEVEL

      private static final int DEFAULT_EXPERIENCE_LEVEL
      See Also:
    • DEFAULT_TOTAL_EXPERIENCE

      private static final int DEFAULT_TOTAL_EXPERIENCE
      See Also:
    • NO_ENCHANTMENT_SEED

      private static final int NO_ENCHANTMENT_SEED
      See Also:
    • DEFAULT_SELECTED_SLOT

      private static final int DEFAULT_SELECTED_SLOT
      See Also:
    • DEFAULT_SCORE

      private static final int DEFAULT_SCORE
      See Also:
    • DEFAULT_IGNORE_FALL_DAMAGE_FROM_CURRENT_IMPULSE

      private static final boolean DEFAULT_IGNORE_FALL_DAMAGE_FROM_CURRENT_IMPULSE
      See Also:
    • DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME

      private static final int DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME
      See Also:
    • timeEntitySatOnShoulder

      private long timeEntitySatOnShoulder
    • inventory

      final Inventory inventory
    • enderChestInventory

      protected PlayerEnderChestContainer enderChestInventory
    • inventoryMenu

      public final InventoryMenu inventoryMenu
    • containerMenu

      public AbstractContainerMenu containerMenu
    • foodData

      protected FoodData foodData
    • jumpTriggerTime

      protected int jumpTriggerTime
    • clientLoaded

      private boolean clientLoaded
    • clientLoadedTimeoutTimer

      protected int clientLoadedTimeoutTimer
    • oBob

      public float oBob
    • bob

      public float bob
    • takeXpDelay

      public int takeXpDelay
    • xCloakO

      public double xCloakO
    • yCloakO

      public double yCloakO
    • zCloakO

      public double zCloakO
    • xCloak

      public double xCloak
    • yCloak

      public double yCloak
    • zCloak

      public double zCloak
    • sleepCounter

      private int sleepCounter
    • wasUnderwater

      protected boolean wasUnderwater
    • abilities

      private final Abilities abilities
    • experienceLevel

      public int experienceLevel
    • totalExperience

      public int totalExperience
    • experienceProgress

      public float experienceProgress
    • enchantmentSeed

      protected int enchantmentSeed
    • defaultFlySpeed

      protected final float defaultFlySpeed
      See Also:
    • lastLevelUpTime

      private int lastLevelUpTime
    • gameProfile

      private final com.mojang.authlib.GameProfile gameProfile
      The player's unique game profile
    • reducedDebugInfo

      private boolean reducedDebugInfo
    • lastItemInMainHand

      private ItemStack lastItemInMainHand
    • cooldowns

      private final ItemCooldowns cooldowns
    • lastDeathLocation

      private Optional<GlobalPos> lastDeathLocation
    • fishing

      @Nullable public FishingHook fishing
    • hurtDir

      protected float hurtDir
    • currentImpulseImpactPos

      @Nullable public Vec3 currentImpulseImpactPos
    • currentExplosionCause

      @Nullable public Entity currentExplosionCause
    • ignoreFallDamageFromCurrentImpulse

      private boolean ignoreFallDamageFromCurrentImpulse
    • currentImpulseContextResetGraceTime

      private int currentImpulseContextResetGraceTime
    • prefixes

      private final Collection<MutableComponent> prefixes
    • suffixes

      private final Collection<MutableComponent> suffixes
    • forcedPose

      @Nullable private Pose forcedPose
    • lastDayTimeTick

      private long lastDayTimeTick
    • displayname

      private Component displayname
  • Constructor Details

    • Player

      public Player(Level level, BlockPos pos, float yRot, com.mojang.authlib.GameProfile gameProfile)
  • Method Details

    • createEquipment

      protected EntityEquipment createEquipment()
      Overrides:
      createEquipment in class LivingEntity
    • blockActionRestricted

      public boolean blockActionRestricted(Level level, BlockPos pos, GameType gameMode)
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder p_326117_)
      Overrides:
      defineSynchedData in class LivingEntity
    • tick

      public void tick()
      Overrides:
      tick in class LivingEntity
    • getMaxHeadRotationRelativeToBody

      protected float getMaxHeadRotationRelativeToBody()
      Overrides:
      getMaxHeadRotationRelativeToBody in class LivingEntity
    • isSecondaryUseActive

      public boolean isSecondaryUseActive()
    • wantsToStopRiding

      protected boolean wantsToStopRiding()
    • isStayingOnGroundSurface

      protected boolean isStayingOnGroundSurface()
    • updateIsUnderwater

      protected boolean updateIsUnderwater()
    • onAboveBubbleColumn

      public void onAboveBubbleColumn(boolean p_368525_, BlockPos p_393868_)
      Overrides:
      onAboveBubbleColumn in class Entity
    • onInsideBubbleColumn

      public void onInsideBubbleColumn(boolean p_368607_)
      Overrides:
      onInsideBubbleColumn in class Entity
    • turtleHelmetTick

      private void turtleHelmetTick()
    • isEquipped

      private boolean isEquipped(Item item)
    • createItemCooldowns

      protected ItemCooldowns createItemCooldowns()
    • moveCloak

      private void moveCloak()
    • updatePlayerPose

      protected void updatePlayerPose()
    • getDesiredPose

      private Pose getDesiredPose()
    • canPlayerFitWithinBlocksAndEntitiesWhen

      protected boolean canPlayerFitWithinBlocksAndEntitiesWhen(Pose pose)
    • getSwimSound

      protected SoundEvent getSwimSound()
      Overrides:
      getSwimSound in class Entity
    • getSwimSplashSound

      protected SoundEvent getSwimSplashSound()
      Overrides:
      getSwimSplashSound in class Entity
    • getSwimHighSpeedSplashSound

      protected SoundEvent getSwimHighSpeedSplashSound()
      Overrides:
      getSwimHighSpeedSplashSound in class Entity
    • getDimensionChangingDelay

      public int getDimensionChangingDelay()
      Overrides:
      getDimensionChangingDelay in class Entity
    • playSound

      public void playSound(SoundEvent sound, float volume, float pitch)
      Overrides:
      playSound in class Entity
    • playNotifySound

      public void playNotifySound(SoundEvent sound, SoundSource source, float volume, float pitch)
    • getSoundSource

      public SoundSource getSoundSource()
      Overrides:
      getSoundSource in class Entity
    • getFireImmuneTicks

      protected int getFireImmuneTicks()
      Overrides:
      getFireImmuneTicks in class Entity
    • handleEntityEvent

      public void handleEntityEvent(byte p_36120_)
      Description copied from class: LivingEntity
      Handler for
      invalid reference
      World#setEntityState
      Overrides:
      handleEntityEvent in class LivingEntity
    • closeContainer

      public void closeContainer()
    • doCloseContainer

      protected void doCloseContainer()
    • rideTick

      public void rideTick()
      Overrides:
      rideTick in class LivingEntity
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class LivingEntity
    • tickRegeneration

      protected void tickRegeneration()
    • playShoulderEntityAmbientSound

      private void playShoulderEntityAmbientSound(CompoundTag entityCompound)
    • touch

      private void touch(Entity entity)
    • getScore

      public int getScore()
    • setScore

      public void setScore(int score)
      Set player's score
    • increaseScore

      public void increaseScore(int score)
      Add to player's score
    • startAutoSpinAttack

      public void startAutoSpinAttack(int ticks, float damage, ItemStack itemStack)
    • getWeaponItem

      @Nonnull public ItemStack getWeaponItem()
      Overrides:
      getWeaponItem in class LivingEntity
    • die

      public void die(DamageSource cause)
      Called when the mob's health reaches 0.
      Overrides:
      die in class LivingEntity
    • dropEquipment

      protected void dropEquipment(ServerLevel p_376325_)
      Overrides:
      dropEquipment in class LivingEntity
    • destroyVanishingCursedItems

      protected void destroyVanishingCursedItems()
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource damageSource)
      Overrides:
      getHurtSound in class LivingEntity
    • getDeathSound

      protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class LivingEntity
    • handleCreativeModeItemDrop

      public void handleCreativeModeItemDrop(ItemStack stack)
    • drop

      @Nullable public ItemEntity drop(ItemStack itemStack, boolean includeThrowerName)
      Drops an item into the world.
    • getDestroySpeed

      @Deprecated public float getDestroySpeed(BlockState state)
      Deprecated.
    • getDestroySpeed

      public float getDestroySpeed(BlockState state, @Nullable BlockPos pos)
    • hasCorrectToolForDrops

      @Deprecated public boolean hasCorrectToolForDrops(BlockState state)
      Deprecated.
    • hasCorrectToolForDrops

      public boolean hasCorrectToolForDrops(BlockState state, Level level, BlockPos pos)
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag compound)
      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
      readAdditionalSaveData in class LivingEntity
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag compound)
      Overrides:
      addAdditionalSaveData in class LivingEntity
    • isInvulnerableTo

      public boolean isInvulnerableTo(ServerLevel p_376263_, DamageSource p_36249_)
      Overrides:
      isInvulnerableTo in class LivingEntity
    • hurtServer

      public boolean hurtServer(ServerLevel p_376451_, DamageSource p_376171_, float p_376389_)
      Overrides:
      hurtServer in class LivingEntity
    • blockUsingItem

      protected void blockUsingItem(ServerLevel p_400223_, LivingEntity p_399637_)
      Overrides:
      blockUsingItem in class LivingEntity
    • canBeSeenAsEnemy

      public boolean canBeSeenAsEnemy()
      Overrides:
      canBeSeenAsEnemy in class LivingEntity
    • canHarmPlayer

      public boolean canHarmPlayer(Player other)
    • hurtArmor

      protected void hurtArmor(DamageSource damageSource, float damage)
      Overrides:
      hurtArmor in class LivingEntity
    • hurtHelmet

      protected void hurtHelmet(DamageSource p_150103_, float p_150104_)
      Overrides:
      hurtHelmet in class LivingEntity
    • actuallyHurt

      protected void actuallyHurt(ServerLevel p_376500_, DamageSource p_36312_, float p_36313_)
      Overrides:
      actuallyHurt in class LivingEntity
    • isTextFilteringEnabled

      public boolean isTextFilteringEnabled()
    • openTextEdit

      public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText)
    • openMinecartCommandBlock

      public void openMinecartCommandBlock(BaseCommandBlock commandEntity)
    • openCommandBlock

      public void openCommandBlock(CommandBlockEntity commandBlockEntity)
    • openStructureBlock

      public void openStructureBlock(StructureBlockEntity structureEntity)
    • openTestBlock

      public void openTestBlock(TestBlockEntity testBlockEntity)
    • openTestInstanceBlock

      public void openTestInstanceBlock(TestInstanceBlockEntity testInstanceBlockEntity)
    • openJigsawBlock

      public void openJigsawBlock(JigsawBlockEntity jigsawBlockEntity)
    • openHorseInventory

      public void openHorseInventory(AbstractHorse horse, Container inventory)
    • openMenu

      public OptionalInt openMenu(@Nullable MenuProvider menu)
    • sendMerchantOffers

      public void sendMerchantOffers(int containerId, MerchantOffers offers, int villagerLevel, int villagerXp, boolean showProgress, boolean canRestock)
    • openItemGui

      public void openItemGui(ItemStack stack, InteractionHand hand)
    • interactOn

      public InteractionResult interactOn(Entity entityToInteractOn, InteractionHand hand)
    • removeVehicle

      public void removeVehicle()
      Overrides:
      removeVehicle in class Entity
    • isImmobile

      protected boolean isImmobile()
      Overrides:
      isImmobile in class LivingEntity
    • isAffectedByFluids

      public boolean isAffectedByFluids()
      Overrides:
      isAffectedByFluids in class LivingEntity
    • maybeBackOffFromEdge

      protected Vec3 maybeBackOffFromEdge(Vec3 vec, MoverType mover)
      Overrides:
      maybeBackOffFromEdge in class Entity
    • isAboveGround

      private boolean isAboveGround(float maxUpStep)
    • canFallAtLeast

      private boolean canFallAtLeast(double x, double z, double distance)
    • attack

      public void attack(Entity target)
      Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called on it. Args: targetEntity
    • getEnchantedDamage

      protected float getEnchantedDamage(Entity entity, float damage, DamageSource damageSource)
    • doAutoAttackOnTouch

      protected void doAutoAttackOnTouch(LivingEntity p_36355_)
      Overrides:
      doAutoAttackOnTouch in class LivingEntity
    • crit

      public void crit(Entity entityHit)
      Called when the entity is dealt a critical hit.
    • magicCrit

      public void magicCrit(Entity entityHit)
    • sweepAttack

      public void sweepAttack()
    • respawn

      public void respawn()
    • remove

      public void remove(Entity.RemovalReason p_150097_)
      Overrides:
      remove in class LivingEntity
    • isClientAuthoritative

      public boolean isClientAuthoritative()
      Overrides:
      isClientAuthoritative in class Entity
    • isLocalClientAuthoritative

      protected boolean isLocalClientAuthoritative()
      Overrides:
      isLocalClientAuthoritative in class Entity
    • isLocalPlayer

      public boolean isLocalPlayer()
    • canSimulateMovement

      public boolean canSimulateMovement()
      Overrides:
      canSimulateMovement in class Entity
    • isEffectiveAi

      public boolean isEffectiveAi()
      Overrides:
      isEffectiveAi in class Entity
    • getGameProfile

      public com.mojang.authlib.GameProfile getGameProfile()
    • getInventory

      public Inventory getInventory()
    • getAbilities

      public Abilities getAbilities()
    • hasInfiniteMaterials

      public boolean hasInfiniteMaterials()
      Overrides:
      hasInfiniteMaterials in class LivingEntity
    • preventsBlockDrops

      public boolean preventsBlockDrops()
    • updateTutorialInventoryAction

      public void updateTutorialInventoryAction(ItemStack carried, ItemStack clicked, ClickAction action)
    • hasContainerOpen

      public boolean hasContainerOpen()
    • canDropItems

      public boolean canDropItems()
    • startSleepInBed

      public com.mojang.datafixers.util.Either<Player.BedSleepingProblem,Unit> startSleepInBed(BlockPos bedPos)
    • stopSleepInBed

      public void stopSleepInBed(boolean wakeImmediately, boolean updateLevelForSleepingPlayers)
    • stopSleeping

      public void stopSleeping()
      Overrides:
      stopSleeping in class LivingEntity
    • isSleepingLongEnough

      public boolean isSleepingLongEnough()
    • getSleepTimer

      public int getSleepTimer()
    • displayClientMessage

      public void displayClientMessage(Component chatComponent, boolean actionBar)
    • awardStat

      public void awardStat(ResourceLocation statKey)
    • awardStat

      public void awardStat(ResourceLocation stat, int increment)
    • awardStat

      public void awardStat(Stat<?> stat)
      Add a stat once
    • awardStat

      public void awardStat(Stat<?> stat, int increment)
      Adds a value to a statistic field.
    • resetStat

      public void resetStat(Stat<?> stat)
    • awardRecipes

      public int awardRecipes(Collection<RecipeHolder<?>> recipes)
    • triggerRecipeCrafted

      public void triggerRecipeCrafted(RecipeHolder<?> recipe, List<ItemStack> items)
    • awardRecipesByKey

      public void awardRecipesByKey(List<ResourceKey<Recipe<?>>> recipes)
    • resetRecipes

      public int resetRecipes(Collection<RecipeHolder<?>> recipes)
    • travel

      public void travel(Vec3 travelVector)
      Overrides:
      travel in class LivingEntity
    • canGlide

      protected boolean canGlide()
      Overrides:
      canGlide in class LivingEntity
    • updateSwimming

      public void updateSwimming()
      Overrides:
      updateSwimming in class Entity
    • freeAt

      protected boolean freeAt(BlockPos pos)
    • getSpeed

      public float getSpeed()
      Overrides:
      getSpeed in class LivingEntity
    • causeFallDamage

      public boolean causeFallDamage(double p_397701_, float p_150093_, DamageSource p_150095_)
      Overrides:
      causeFallDamage in class LivingEntity
    • tryToStartFallFlying

      public boolean tryToStartFallFlying()
    • startFallFlying

      public void startFallFlying()
    • doWaterSplashEffect

      protected void doWaterSplashEffect()
      Overrides:
      doWaterSplashEffect in class Entity
    • playStepSound

      protected void playStepSound(BlockPos p_282121_, BlockState p_282194_)
      Overrides:
      playStepSound in class Entity
    • getFallSounds

      public LivingEntity.Fallsounds getFallSounds()
      Overrides:
      getFallSounds in class LivingEntity
    • killedEntity

      public boolean killedEntity(ServerLevel p_219735_, LivingEntity p_219736_)
      Overrides:
      killedEntity in class Entity
    • makeStuckInBlock

      public void makeStuckInBlock(BlockState state, Vec3 motionMultiplier)
      Overrides:
      makeStuckInBlock in class Entity
    • giveExperiencePoints

      public void giveExperiencePoints(int xpPoints)
    • getEnchantmentSeed

      public int getEnchantmentSeed()
    • onEnchantmentPerformed

      public void onEnchantmentPerformed(ItemStack enchantedItem, int levelCost)
    • giveExperienceLevels

      public void giveExperienceLevels(int levels)
      Add experience levels to this player.
    • getXpNeededForNextLevel

      public int getXpNeededForNextLevel()
    • causeFoodExhaustion

      public void causeFoodExhaustion(float exhaustion)
      Increases exhaustion level by the supplied amount.
    • getWardenSpawnTracker

      public Optional<WardenSpawnTracker> getWardenSpawnTracker()
    • getFoodData

      public FoodData getFoodData()
    • canEat

      public boolean canEat(boolean canAlwaysEat)
    • isHurt

      public boolean isHurt()
    • mayBuild

      public boolean mayBuild()
    • mayUseItemAt

      public boolean mayUseItemAt(BlockPos pos, Direction facing, ItemStack stack)
      Returns whether this player can modify the block at a certain location with the given stack.

      The position being queried is pos.offset(facing.getOpposite()).

      Returns:
      Whether this player may modify the queried location in the current world
      See Also:
      • invalid reference
        ItemStack#canPlaceOn(Block)
      • invalid reference
        ItemStack#canEditBlocks()
      • invalid reference
        PlayerCapabilities#allowEdit
    • getBaseExperienceReward

      protected int getBaseExperienceReward(ServerLevel p_376359_)
      Overrides:
      getBaseExperienceReward in class LivingEntity
    • isAlwaysExperienceDropper

      protected boolean isAlwaysExperienceDropper()
      Overrides:
      isAlwaysExperienceDropper in class LivingEntity
    • shouldShowName

      public boolean shouldShowName()
      Overrides:
      shouldShowName in class LivingEntity
    • getMovementEmission

      protected Entity.MovementEmission getMovementEmission()
      Overrides:
      getMovementEmission in class Entity
    • onUpdateAbilities

      public void onUpdateAbilities()
    • getName

      public Component getName()
      Specified by:
      getName in interface Nameable
      Overrides:
      getName in class Entity
    • getEnderChestInventory

      public PlayerEnderChestContainer getEnderChestInventory()
    • doesEmitEquipEvent

      protected boolean doesEmitEquipEvent(EquipmentSlot p_219741_)
      Overrides:
      doesEmitEquipEvent in class LivingEntity
    • addItem

      public boolean addItem(ItemStack stack)
    • setEntityOnShoulder

      public boolean setEntityOnShoulder(CompoundTag entityCompound)
    • removeEntitiesOnShoulder

      protected void removeEntitiesOnShoulder()
    • respawnEntityOnShoulder

      private void respawnEntityOnShoulder(CompoundTag entityCompound)
    • gameMode

      @Nullable public abstract GameType gameMode()
    • isSpectator

      public boolean isSpectator()
      Overrides:
      isSpectator in class Entity
    • canBeHitByProjectile

      public boolean canBeHitByProjectile()
      Overrides:
      canBeHitByProjectile in class Entity
    • isSwimming

      public boolean isSwimming()
      Overrides:
      isSwimming in class Entity
    • isCreative

      public boolean isCreative()
    • isPushedByFluid

      public boolean isPushedByFluid()
      Overrides:
      isPushedByFluid in class Entity
    • getScoreboard

      public Scoreboard getScoreboard()
    • getDisplayName

      public Component getDisplayName()
      Specified by:
      getDisplayName in interface Nameable
      Specified by:
      getDisplayName in interface ScoreHolder
      Overrides:
      getDisplayName in class Entity
    • decorateDisplayNameComponent

      private MutableComponent decorateDisplayNameComponent(MutableComponent displayName)
    • getScoreboardName

      public String getScoreboardName()
      Specified by:
      getScoreboardName in interface ScoreHolder
      Overrides:
      getScoreboardName in class Entity
    • internalSetAbsorptionAmount

      protected void internalSetAbsorptionAmount(float p_296426_)
      Overrides:
      internalSetAbsorptionAmount in class LivingEntity
    • getAbsorptionAmount

      public float getAbsorptionAmount()
      Overrides:
      getAbsorptionAmount in class LivingEntity
    • isModelPartShown

      public boolean isModelPartShown(PlayerModelPart part)
    • getSlot

      public SlotAccess getSlot(int p_150112_)
      Overrides:
      getSlot in class LivingEntity
    • isReducedDebugInfo

      public boolean isReducedDebugInfo()
    • setReducedDebugInfo

      public void setReducedDebugInfo(boolean reducedDebugInfo)
    • setRemainingFireTicks

      public void setRemainingFireTicks(int ticks)
      Overrides:
      setRemainingFireTicks in class Entity
    • getMainArm

      public HumanoidArm getMainArm()
      Specified by:
      getMainArm in class LivingEntity
    • setMainArm

      public void setMainArm(HumanoidArm hand)
    • getShoulderEntityLeft

      public CompoundTag getShoulderEntityLeft()
    • setShoulderEntityLeft

      protected void setShoulderEntityLeft(CompoundTag entityCompound)
    • getShoulderEntityRight

      public CompoundTag getShoulderEntityRight()
    • setShoulderEntityRight

      protected void setShoulderEntityRight(CompoundTag entityCompound)
    • getCurrentItemAttackStrengthDelay

      public float getCurrentItemAttackStrengthDelay()
    • getAttackStrengthScale

      public float getAttackStrengthScale(float adjustTicks)
      Returns the percentage of attack power available based on the cooldown (zero to one).
    • resetAttackStrengthTicker

      public void resetAttackStrengthTicker()
    • getCooldowns

      public ItemCooldowns getCooldowns()
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
      Overrides:
      getBlockSpeedFactor in class LivingEntity
    • getLuck

      public float getLuck()
      Overrides:
      getLuck in class LivingEntity
    • canUseGameMasterBlocks

      public boolean canUseGameMasterBlocks()
    • getPermissionLevel

      public int getPermissionLevel()
    • hasPermissions

      public boolean hasPermissions(int permissionLevel)
    • getDefaultDimensions

      public EntityDimensions getDefaultDimensions(Pose p_36166_)
      Overrides:
      getDefaultDimensions in class LivingEntity
    • getDismountPoses

      public ImmutableList<Pose> getDismountPoses()
      Overrides:
      getDismountPoses in class LivingEntity
    • getProjectile

      public ItemStack getProjectile(ItemStack shootable)
      Overrides:
      getProjectile in class LivingEntity
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float partialTicks)
      Overrides:
      getRopeHoldPosition in class Entity
    • isAlwaysTicking

      public boolean isAlwaysTicking()
      Specified by:
      isAlwaysTicking in interface EntityAccess
      Overrides:
      isAlwaysTicking in class Entity
    • isScoping

      public boolean isScoping()
    • shouldBeSaved

      public boolean shouldBeSaved()
      Specified by:
      shouldBeSaved in interface EntityAccess
      Overrides:
      shouldBeSaved in class Entity
    • getLastDeathLocation

      public Optional<GlobalPos> getLastDeathLocation()
    • setLastDeathLocation

      public void setLastDeathLocation(Optional<GlobalPos> lastDeathLocation)
    • getHurtDir

      public float getHurtDir()
      Overrides:
      getHurtDir in class LivingEntity
    • animateHurt

      public void animateHurt(float p_265280_)
      Overrides:
      animateHurt in class LivingEntity
    • canSprint

      public boolean canSprint()
      Overrides:
      canSprint in class Entity
    • getFlyingSpeed

      protected float getFlyingSpeed()
      Overrides:
      getFlyingSpeed in class LivingEntity
    • hasClientLoaded

      public boolean hasClientLoaded()
    • tickClientLoadTimeout

      public void tickClientLoadTimeout()
    • setClientLoaded

      public void setClientLoaded(boolean clientLoaded)
    • blockInteractionRange

      public double blockInteractionRange()
    • entityInteractionRange

      public double entityInteractionRange()
    • canInteractWithEntity

      public boolean canInteractWithEntity(Entity entity, double distance)
    • canInteractWithEntity

      public boolean canInteractWithEntity(AABB boundingBox, double distance)
    • canInteractWithBlock

      public boolean canInteractWithBlock(BlockPos pos, double distance)
    • setIgnoreFallDamageFromCurrentImpulse

      public void setIgnoreFallDamageFromCurrentImpulse(boolean ignoreFallDamageFromCurrentImpulse)
    • isIgnoringFallDamageFromCurrentImpulse

      public boolean isIgnoringFallDamageFromCurrentImpulse()
    • tryResetCurrentImpulseContext

      public void tryResetCurrentImpulseContext()
    • resetCurrentImpulseContext

      public void resetCurrentImpulseContext()
    • shouldRotateWithMinecart

      public boolean shouldRotateWithMinecart()
    • onClimbable

      public boolean onClimbable()
      Overrides:
      onClimbable in class LivingEntity
    • debugInfo

      public String debugInfo()
    • getPrefixes

      public Collection<MutableComponent> getPrefixes()
    • getSuffixes

      public Collection<MutableComponent> getSuffixes()
    • refreshDisplayName

      public void refreshDisplayName()
      Neo: Force the displayed name to refresh, by firing PlayerEvent.NameFormat, using the real player name as event parameter.
    • setForcedPose

      public void setForcedPose(@Nullable Pose pose)
      Neo: Force a pose for the player. If set, the vanilla pose determination and clearance check is skipped. Make sure the pose is clear yourself (e.g. in PlayerTick). This has to be set just once, do not set it every tick. Make sure to clear (null) the pose if not required anymore and only use if necessary.
    • getForcedPose

      @Nullable public Pose getForcedPose()
      Neo:
      Returns:
      The forced pose if set, null otherwise