Class Player

All Implemented Interfaces:
CommandSource, EntityAccess, Nameable, ICapabilityProvider, ICapabilitySerializable<CompoundTag>, IForgeEntity, INBTSerializable<CompoundTag>
Direct Known Subclasses:
AbstractClientPlayer, ServerPlayer

public abstract class Player extends LivingEntity
  • Field Details

    • PERSISTED_NBT_TAG

      public static final String PERSISTED_NBT_TAG
      See Also:
      Constant Field Values
    • UUID_PREFIX_OFFLINE_PLAYER

      public static final String UUID_PREFIX_OFFLINE_PLAYER
      See Also:
      Constant Field Values
    • MAX_NAME_LENGTH

      public static final int MAX_NAME_LENGTH
      See Also:
      Constant Field Values
    • MAX_HEALTH

      public static final int MAX_HEALTH
      See Also:
      Constant Field Values
    • SLEEP_DURATION

      public static final int SLEEP_DURATION
      See Also:
      Constant Field Values
    • WAKE_UP_DURATION

      public static final int WAKE_UP_DURATION
      See Also:
      Constant Field Values
    • ENDER_SLOT_OFFSET

      public static final int ENDER_SLOT_OFFSET
      See Also:
      Constant Field Values
    • CROUCH_BB_HEIGHT

      public static final float CROUCH_BB_HEIGHT
      See Also:
      Constant Field Values
    • SWIMMING_BB_WIDTH

      public static final float SWIMMING_BB_WIDTH
      See Also:
      Constant Field Values
    • SWIMMING_BB_HEIGHT

      public static final float SWIMMING_BB_HEIGHT
      See Also:
      Constant Field Values
    • DEFAULT_EYE_HEIGHT

      public static final float DEFAULT_EYE_HEIGHT
      See Also:
      Constant Field Values
    • STANDING_DIMENSIONS

      public static final EntityDimensions STANDING_DIMENSIONS
    • POSES

      private static final Map<Pose,​EntityDimensions> POSES
    • FLY_ACHIEVEMENT_SPEED

      private static final int FLY_ACHIEVEMENT_SPEED
      See Also:
      Constant Field Values
    • 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
    • timeEntitySatOnShoulder

      private long timeEntitySatOnShoulder
    • inventory

      private final Inventory inventory
    • enderChestInventory

      protected PlayerEnderChestContainer enderChestInventory
    • inventoryMenu

      public final InventoryMenu inventoryMenu
    • containerMenu

      public AbstractContainerMenu containerMenu
    • foodData

      protected FoodData foodData
    • jumpTriggerTime

      protected int jumpTriggerTime
    • 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:
      Constant Field Values
    • lastLevelUpTime

      private int lastLevelUpTime
    • gameProfile

      private final com.mojang.authlib.GameProfile gameProfile
    • reducedDebugInfo

      private boolean reducedDebugInfo
    • lastItemInMainHand

      private ItemStack lastItemInMainHand
    • cooldowns

      private final ItemCooldowns cooldowns
    • fishing

      @Nullable public FishingHook fishing
    • prefixes

      private final Collection<MutableComponent> prefixes
    • suffixes

      private final Collection<MutableComponent> suffixes
    • forcedPose

      @Nullable private Pose forcedPose
    • displayname

      private Component displayname
    • playerMainHandler

      private final LazyOptional<IItemHandler> playerMainHandler
    • playerEquipmentHandler

      private final LazyOptional<IItemHandler> playerEquipmentHandler
    • playerJoinedHandler

      private final LazyOptional<IItemHandler> playerJoinedHandler
  • Constructor Details

    • Player

      public Player(Level p_36114_, BlockPos p_36115_, float p_36116_, com.mojang.authlib.GameProfile p_36117_)
  • Method Details

    • blockActionRestricted

      public boolean blockActionRestricted(Level p_36188_, BlockPos p_36189_, GameType p_36190_)
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class LivingEntity
    • tick

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

      public boolean isSecondaryUseActive()
    • wantsToStopRiding

      protected boolean wantsToStopRiding()
    • isStayingOnGroundSurface

      protected boolean isStayingOnGroundSurface()
    • updateIsUnderwater

      protected boolean updateIsUnderwater()
    • turtleHelmetTick

      private void turtleHelmetTick()
    • createItemCooldowns

      protected ItemCooldowns createItemCooldowns()
    • moveCloak

      private void moveCloak()
    • updatePlayerPose

      protected void updatePlayerPose()
    • getPortalWaitTime

      public int getPortalWaitTime()
      Overrides:
      getPortalWaitTime in class Entity
    • 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 p_36137_, float p_36138_, float p_36139_)
      Overrides:
      playSound in class Entity
    • playNotifySound

      public void playNotifySound(SoundEvent p_36140_, SoundSource p_36141_, float p_36142_, float p_36143_)
    • 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_)
      Overrides:
      handleEntityEvent in class LivingEntity
    • addParticlesAroundSelf

      private void addParticlesAroundSelf(ParticleOptions p_36209_)
    • closeContainer

      public void closeContainer()
    • rideTick

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

      protected void serverAiStep()
      Overrides:
      serverAiStep in class LivingEntity
    • aiStep

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

      private void playShoulderEntityAmbientSound(@Nullable CompoundTag p_36368_)
    • touch

      private void touch(Entity p_36278_)
    • getScore

      public int getScore()
    • setScore

      public void setScore(int p_36398_)
    • increaseScore

      public void increaseScore(int p_36402_)
    • die

      public void die(DamageSource p_36152_)
      Overrides:
      die in class LivingEntity
    • dropEquipment

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

      protected void destroyVanishingCursedItems()
    • getHurtSound

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

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

      @Nullable public ItemEntity drop(ItemStack p_36177_, boolean p_36178_)
    • drop

      @Nullable public ItemEntity drop(ItemStack p_36179_, boolean p_36180_, boolean p_36181_)
    • getDestroySpeed

      @Deprecated public float getDestroySpeed(BlockState p_36282_)
      Deprecated.
    • getDigSpeed

      public float getDigSpeed(BlockState p_36282_, @Nullable BlockPos pos)
    • hasCorrectToolForDrops

      public boolean hasCorrectToolForDrops(BlockState p_36299_)
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag p_36215_)
      Overrides:
      readAdditionalSaveData in class LivingEntity
    • addAdditionalSaveData

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

      public boolean isInvulnerableTo(DamageSource p_36249_)
      Overrides:
      isInvulnerableTo in class Entity
    • hurt

      public boolean hurt(DamageSource p_36154_, float p_36155_)
      Overrides:
      hurt in class LivingEntity
    • blockUsingShield

      protected void blockUsingShield(LivingEntity p_36295_)
      Overrides:
      blockUsingShield in class LivingEntity
    • canBeSeenAsEnemy

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

      public boolean canHarmPlayer(Player p_36169_)
    • hurtArmor

      protected void hurtArmor(DamageSource p_36251_, float p_36252_)
      Overrides:
      hurtArmor in class LivingEntity
    • hurtHelmet

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

      protected void hurtCurrentlyUsedShield(float p_36383_)
      Overrides:
      hurtCurrentlyUsedShield in class LivingEntity
    • actuallyHurt

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

      protected boolean onSoulSpeedBlock()
      Overrides:
      onSoulSpeedBlock in class LivingEntity
    • openTextEdit

      public void openTextEdit(SignBlockEntity p_36193_)
    • openMinecartCommandBlock

      public void openMinecartCommandBlock(BaseCommandBlock p_36182_)
    • openCommandBlock

      public void openCommandBlock(CommandBlockEntity p_36191_)
    • openStructureBlock

      public void openStructureBlock(StructureBlockEntity p_36194_)
    • openJigsawBlock

      public void openJigsawBlock(JigsawBlockEntity p_36192_)
    • openHorseInventory

      public void openHorseInventory(AbstractHorse p_36167_, Container p_36168_)
    • openMenu

      public OptionalInt openMenu(@Nullable MenuProvider p_36150_)
    • sendMerchantOffers

      public void sendMerchantOffers(int p_36121_, MerchantOffers p_36122_, int p_36123_, int p_36124_, boolean p_36125_, boolean p_36126_)
    • openItemGui

      public void openItemGui(ItemStack p_36174_, InteractionHand p_36175_)
    • interactOn

      public InteractionResult interactOn(Entity p_36158_, InteractionHand p_36159_)
    • getMyRidingOffset

      public double getMyRidingOffset()
      Overrides:
      getMyRidingOffset in class Entity
    • 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 p_36201_, MoverType p_36202_)
      Overrides:
      maybeBackOffFromEdge in class Entity
    • isAboveGround

      private boolean isAboveGround()
    • attack

      public void attack(Entity p_36347_)
    • doAutoAttackOnTouch

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

      public void disableShield(boolean p_36385_)
    • crit

      public void crit(Entity p_36156_)
    • magicCrit

      public void magicCrit(Entity p_36253_)
    • sweepAttack

      public void sweepAttack()
    • respawn

      public void respawn()
    • remove

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

      public boolean isLocalPlayer()
    • getGameProfile

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

      public Inventory getInventory()
    • getAbilities

      public Abilities getAbilities()
    • updateTutorialInventoryAction

      public void updateTutorialInventoryAction(ItemStack p_150098_, ItemStack p_150099_, ClickAction p_150100_)
    • startSleepInBed

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

      public void stopSleepInBed(boolean p_36226_, boolean p_36227_)
    • stopSleeping

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

      public static Optional<Vec3> findRespawnPositionAndUseSpawnBlock(ServerLevel p_36131_, BlockPos p_36132_, float p_36133_, boolean p_36134_, boolean p_36135_)
    • isSleepingLongEnough

      public boolean isSleepingLongEnough()
    • getSleepTimer

      public int getSleepTimer()
    • displayClientMessage

      public void displayClientMessage(Component p_36216_, boolean p_36217_)
    • awardStat

      public void awardStat(ResourceLocation p_36221_)
    • awardStat

      public void awardStat(ResourceLocation p_36223_, int p_36224_)
    • awardStat

      public void awardStat(Stat<?> p_36247_)
    • awardStat

      public void awardStat(Stat<?> p_36145_, int p_36146_)
    • resetStat

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

      public int awardRecipes(Collection<Recipe<?>> p_36213_)
    • awardRecipesByKey

      public void awardRecipesByKey(ResourceLocation[] p_36228_)
    • resetRecipes

      public int resetRecipes(Collection<Recipe<?>> p_36263_)
    • jumpFromGround

      public void jumpFromGround()
      Overrides:
      jumpFromGround in class LivingEntity
    • travel

      public void travel(Vec3 p_36359_)
      Overrides:
      travel in class LivingEntity
    • updateSwimming

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

      protected boolean freeAt(BlockPos p_36351_)
    • getSpeed

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

      public void checkMovementStatistics(double p_36379_, double p_36380_, double p_36381_)
    • checkRidingStatistics

      private void checkRidingStatistics(double p_36388_, double p_36389_, double p_36390_)
    • causeFallDamage

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

      public boolean tryToStartFallFlying()
    • startFallFlying

      public void startFallFlying()
    • stopFallFlying

      public void stopFallFlying()
    • doWaterSplashEffect

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

      protected SoundEvent getFallDamageSound(int p_36376_)
      Overrides:
      getFallDamageSound in class LivingEntity
    • killed

      public void killed(ServerLevel p_36128_, LivingEntity p_36129_)
      Overrides:
      killed in class Entity
    • makeStuckInBlock

      public void makeStuckInBlock(BlockState p_36196_, Vec3 p_36197_)
      Overrides:
      makeStuckInBlock in class Entity
    • giveExperiencePoints

      public void giveExperiencePoints(int p_36291_)
    • getEnchantmentSeed

      public int getEnchantmentSeed()
    • onEnchantmentPerformed

      public void onEnchantmentPerformed(ItemStack p_36172_, int p_36173_)
    • giveExperienceLevels

      public void giveExperienceLevels(int p_36276_)
    • getXpNeededForNextLevel

      public int getXpNeededForNextLevel()
    • causeFoodExhaustion

      public void causeFoodExhaustion(float p_36400_)
    • getFoodData

      public FoodData getFoodData()
    • canEat

      public boolean canEat(boolean p_36392_)
    • isHurt

      public boolean isHurt()
    • mayBuild

      public boolean mayBuild()
    • mayUseItemAt

      public boolean mayUseItemAt(BlockPos p_36205_, Direction p_36206_, ItemStack p_36207_)
    • getExperienceReward

      protected int getExperienceReward(Player p_36297_)
      Overrides:
      getExperienceReward 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()
    • getItemBySlot

      public ItemStack getItemBySlot(EquipmentSlot p_36257_)
      Specified by:
      getItemBySlot in class LivingEntity
    • setItemSlot

      public void setItemSlot(EquipmentSlot p_36161_, ItemStack p_36162_)
      Specified by:
      setItemSlot in class LivingEntity
    • addItem

      public boolean addItem(ItemStack p_36357_)
    • getHandSlots

      public Iterable<ItemStack> getHandSlots()
      Overrides:
      getHandSlots in class Entity
    • getArmorSlots

      public Iterable<ItemStack> getArmorSlots()
      Specified by:
      getArmorSlots in class LivingEntity
    • setEntityOnShoulder

      public boolean setEntityOnShoulder(CompoundTag p_36361_)
    • removeEntitiesOnShoulder

      protected void removeEntitiesOnShoulder()
    • respawnEntityOnShoulder

      private void respawnEntityOnShoulder(CompoundTag p_36371_)
    • isSpectator

      public abstract boolean isSpectator()
      Overrides:
      isSpectator in class Entity
    • isSwimming

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

      public abstract 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
      Overrides:
      getDisplayName in class Entity
    • decorateDisplayNameComponent

      private MutableComponent decorateDisplayNameComponent(MutableComponent p_36219_)
    • getScoreboardName

      public String getScoreboardName()
      Overrides:
      getScoreboardName in class Entity
    • getStandingEyeHeight

      public float getStandingEyeHeight(Pose p_36259_, EntityDimensions p_36260_)
      Overrides:
      getStandingEyeHeight in class LivingEntity
    • setAbsorptionAmount

      public void setAbsorptionAmount(float p_36396_)
      Overrides:
      setAbsorptionAmount in class LivingEntity
    • getAbsorptionAmount

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

      public static UUID createPlayerUUID(com.mojang.authlib.GameProfile p_36199_)
    • createPlayerUUID

      public static UUID createPlayerUUID(String p_36284_)
    • isModelPartShown

      public boolean isModelPartShown(PlayerModelPart p_36171_)
    • getSlot

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

      public boolean isReducedDebugInfo()
    • setReducedDebugInfo

      public void setReducedDebugInfo(boolean p_36394_)
    • setRemainingFireTicks

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

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

      public void setMainArm(HumanoidArm p_36164_)
    • getShoulderEntityLeft

      public CompoundTag getShoulderEntityLeft()
    • setShoulderEntityLeft

      protected void setShoulderEntityLeft(CompoundTag p_36363_)
    • getShoulderEntityRight

      public CompoundTag getShoulderEntityRight()
    • setShoulderEntityRight

      protected void setShoulderEntityRight(CompoundTag p_36365_)
    • getCurrentItemAttackStrengthDelay

      public float getCurrentItemAttackStrengthDelay()
    • getAttackStrengthScale

      public float getAttackStrengthScale(float p_36404_)
    • resetAttackStrengthTicker

      public void resetAttackStrengthTicker()
    • getCooldowns

      public ItemCooldowns getCooldowns()
    • getBlockSpeedFactor

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

      public float getLuck()
    • canUseGameMasterBlocks

      public boolean canUseGameMasterBlocks()
    • canTakeItem

      public boolean canTakeItem(ItemStack p_36315_)
      Overrides:
      canTakeItem in class LivingEntity
    • getDimensions

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

      public com.google.common.collect.ImmutableList<Pose> getDismountPoses()
      Overrides:
      getDismountPoses in class LivingEntity
    • getProjectile

      public ItemStack getProjectile(ItemStack p_36349_)
      Overrides:
      getProjectile in class LivingEntity
    • eat

      public ItemStack eat(Level p_36185_, ItemStack p_36186_)
      Overrides:
      eat in class LivingEntity
    • shouldRemoveSoulSpeed

      protected boolean shouldRemoveSoulSpeed(BlockState p_36262_)
      Overrides:
      shouldRemoveSoulSpeed in class LivingEntity
    • getRopeHoldPosition

      public Vec3 getRopeHoldPosition(float p_36374_)
      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
    • getPrefixes

      public Collection<MutableComponent> getPrefixes()
    • getSuffixes

      public Collection<MutableComponent> getSuffixes()
    • refreshDisplayName

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

      public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing)
      Description copied from interface: ICapabilityProvider
      Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.
      Specified by:
      getCapability in interface ICapabilityProvider
      Overrides:
      getCapability in class LivingEntity
      Parameters:
      capability - The capability to check
      facing - The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'
      Returns:
      The requested an optional holding the requested capability.
    • setForcedPose

      public void setForcedPose(@Nullable Pose pose)
      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()
      Returns:
      The forced pose if set, null otherwise