Class PlayerEntity

    • Field Detail

      • PERSISTED_NBT_TAG

        public static final java.lang.String PERSISTED_NBT_TAG
        See Also:
        Constant Field Values
      • STANDING_DIMENSIONS

        public static final EntitySize STANDING_DIMENSIONS
      • DATA_PLAYER_ABSORPTION_ID

        private static final DataParameter<java.lang.Float> DATA_PLAYER_ABSORPTION_ID
      • DATA_SCORE_ID

        private static final DataParameter<java.lang.Integer> DATA_SCORE_ID
      • DATA_PLAYER_MODE_CUSTOMISATION

        protected static final DataParameter<java.lang.Byte> DATA_PLAYER_MODE_CUSTOMISATION
      • DATA_PLAYER_MAIN_HAND

        protected static final DataParameter<java.lang.Byte> DATA_PLAYER_MAIN_HAND
      • timeEntitySatOnShoulder

        private long timeEntitySatOnShoulder
      • containerMenu

        public Container containerMenu
      • 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
      • experienceLevel

        public int experienceLevel
      • totalExperience

        public int totalExperience
      • experienceProgress

        public float experienceProgress
      • enchantmentSeed

        protected int enchantmentSeed
      • lastLevelUpTime

        private int lastLevelUpTime
      • gameProfile

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

        private boolean reducedDebugInfo
      • lastItemInMainHand

        private ItemStack lastItemInMainHand
      • forcedPose

        @Nullable
        private Pose forcedPose
    • Constructor Detail

      • PlayerEntity

        public PlayerEntity​(World p_i241920_1_,
                            BlockPos p_i241920_2_,
                            float p_i241920_3_,
                            com.mojang.authlib.GameProfile p_i241920_4_)
    • Method Detail

      • blockActionRestricted

        public boolean blockActionRestricted​(World p_223729_1_,
                                             BlockPos p_223729_2_,
                                             GameType p_223729_3_)
      • isSecondaryUseActive

        public boolean isSecondaryUseActive()
      • wantsToStopRiding

        protected boolean wantsToStopRiding()
      • isStayingOnGroundSurface

        protected boolean isStayingOnGroundSurface()
      • updateIsUnderwater

        protected boolean updateIsUnderwater()
      • turtleHelmetTick

        private void turtleHelmetTick()
      • moveCloak

        private void moveCloak()
      • updatePlayerPose

        protected void updatePlayerPose()
      • playSound

        public void playSound​(SoundEvent p_184185_1_,
                              float p_184185_2_,
                              float p_184185_3_)
        Overrides:
        playSound in class Entity
      • playNotifySound

        public void playNotifySound​(SoundEvent p_213823_1_,
                                    SoundCategory p_213823_2_,
                                    float p_213823_3_,
                                    float p_213823_4_)
      • addParticlesAroundSelf

        private void addParticlesAroundSelf​(IParticleData p_213824_1_)
      • closeContainer

        public void closeContainer()
      • resetPos

        public void resetPos()
        Overrides:
        resetPos in class Entity
      • playShoulderEntityAmbientSound

        private void playShoulderEntityAmbientSound​(@Nullable
                                                    CompoundNBT p_192028_1_)
      • touch

        private void touch​(Entity p_71044_1_)
      • getScore

        public int getScore()
      • setScore

        public void setScore​(int p_85040_1_)
      • increaseScore

        public void increaseScore​(int p_85039_1_)
      • destroyVanishingCursedItems

        protected void destroyVanishingCursedItems()
      • drop

        public boolean drop​(boolean p_225609_1_)
      • drop

        @Nullable
        public ItemEntity drop​(ItemStack p_146097_1_,
                               boolean p_146097_2_,
                               boolean p_146097_3_)
      • getDestroySpeed

        @Deprecated
        public float getDestroySpeed​(BlockState p_184813_1_)
        Deprecated.
      • getDigSpeed

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

        public boolean hasCorrectToolForDrops​(BlockState p_234569_1_)
      • canHarmPlayer

        public boolean canHarmPlayer​(PlayerEntity p_96122_1_)
      • openTextEdit

        public void openTextEdit​(SignTileEntity p_175141_1_)
      • openMinecartCommandBlock

        public void openMinecartCommandBlock​(CommandBlockLogic p_184809_1_)
      • openJigsawBlock

        public void openJigsawBlock​(JigsawTileEntity p_213826_1_)
      • sendMerchantOffers

        public void sendMerchantOffers​(int p_213818_1_,
                                       MerchantOffers p_213818_2_,
                                       int p_213818_3_,
                                       int p_213818_4_,
                                       boolean p_213818_5_,
                                       boolean p_213818_6_)
      • openItemGui

        public void openItemGui​(ItemStack p_184814_1_,
                                Hand p_184814_2_)
      • isAboveGround

        private boolean isAboveGround()
      • attack

        public void attack​(Entity p_71059_1_)
      • disableShield

        public void disableShield​(boolean p_190777_1_)
      • crit

        public void crit​(Entity p_71009_1_)
      • magicCrit

        public void magicCrit​(Entity p_71047_1_)
      • sweepAttack

        public void sweepAttack()
      • respawn

        public void respawn()
      • remove

        public void remove​(boolean keepData)
        Overrides:
        remove in class Entity
      • isLocalPlayer

        public boolean isLocalPlayer()
      • getGameProfile

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

        public void stopSleepInBed​(boolean p_225652_1_,
                                   boolean p_225652_2_)
      • findRespawnPositionAndUseSpawnBlock

        public static java.util.Optional<Vector3d> findRespawnPositionAndUseSpawnBlock​(ServerWorld p_242374_0_,
                                                                                       BlockPos p_242374_1_,
                                                                                       float p_242374_2_,
                                                                                       boolean p_242374_3_,
                                                                                       boolean p_242374_4_)
      • isSleepingLongEnough

        public boolean isSleepingLongEnough()
      • getSleepTimer

        public int getSleepTimer()
      • displayClientMessage

        public void displayClientMessage​(ITextComponent p_146105_1_,
                                         boolean p_146105_2_)
      • awardStat

        public void awardStat​(ResourceLocation p_195067_1_,
                              int p_195067_2_)
      • awardStat

        public void awardStat​(Stat<?> p_71029_1_)
      • awardStat

        public void awardStat​(Stat<?> p_71064_1_,
                              int p_71064_2_)
      • resetStat

        public void resetStat​(Stat<?> p_175145_1_)
      • awardRecipes

        public int awardRecipes​(java.util.Collection<IRecipe<?>> p_195065_1_)
      • awardRecipesByKey

        public void awardRecipesByKey​(ResourceLocation[] p_193102_1_)
      • resetRecipes

        public int resetRecipes​(java.util.Collection<IRecipe<?>> p_195069_1_)
      • freeAt

        protected boolean freeAt​(BlockPos p_207401_1_)
      • checkMovementStatistics

        public void checkMovementStatistics​(double p_71000_1_,
                                            double p_71000_3_,
                                            double p_71000_5_)
      • checkRidingStatistics

        private void checkRidingStatistics​(double p_71015_1_,
                                           double p_71015_3_,
                                           double p_71015_5_)
      • causeFallDamage

        public boolean causeFallDamage​(float p_225503_1_,
                                       float p_225503_2_)
        Overrides:
        causeFallDamage in class LivingEntity
      • tryToStartFallFlying

        public boolean tryToStartFallFlying()
      • startFallFlying

        public void startFallFlying()
      • stopFallFlying

        public void stopFallFlying()
      • giveExperiencePoints

        public void giveExperiencePoints​(int p_195068_1_)
      • getEnchantmentSeed

        public int getEnchantmentSeed()
      • onEnchantmentPerformed

        public void onEnchantmentPerformed​(ItemStack p_192024_1_,
                                           int p_192024_2_)
      • giveExperienceLevels

        public void giveExperienceLevels​(int p_82242_1_)
      • getXpNeededForNextLevel

        public int getXpNeededForNextLevel()
      • causeFoodExhaustion

        public void causeFoodExhaustion​(float p_71020_1_)
      • getFoodData

        public FoodStats getFoodData()
      • canEat

        public boolean canEat​(boolean p_71043_1_)
      • isHurt

        public boolean isHurt()
      • mayBuild

        public boolean mayBuild()
      • onUpdateAbilities

        public void onUpdateAbilities()
      • setGameMode

        public void setGameMode​(GameType p_71033_1_)
      • addItem

        public boolean addItem​(ItemStack p_191521_1_)
      • setEntityOnShoulder

        public boolean setEntityOnShoulder​(CompoundNBT p_192027_1_)
      • removeEntitiesOnShoulder

        protected void removeEntitiesOnShoulder()
      • respawnEntityOnShoulder

        private void respawnEntityOnShoulder​(CompoundNBT p_192026_1_)
      • isSpectator

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

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

        public abstract boolean isCreative()
      • getScoreboard

        public Scoreboard getScoreboard()
      • createPlayerUUID

        public static java.util.UUID createPlayerUUID​(com.mojang.authlib.GameProfile p_146094_0_)
      • createPlayerUUID

        public static java.util.UUID createPlayerUUID​(java.lang.String p_175147_0_)
      • isModelPartShown

        public boolean isModelPartShown​(PlayerModelPart p_175148_1_)
      • setSlot

        public boolean setSlot​(int p_174820_1_,
                               ItemStack p_174820_2_)
        Overrides:
        setSlot in class Entity
      • isReducedDebugInfo

        public boolean isReducedDebugInfo()
      • setReducedDebugInfo

        public void setReducedDebugInfo​(boolean p_175150_1_)
      • setMainArm

        public void setMainArm​(HandSide p_184819_1_)
      • getShoulderEntityLeft

        public CompoundNBT getShoulderEntityLeft()
      • setShoulderEntityLeft

        protected void setShoulderEntityLeft​(CompoundNBT p_192029_1_)
      • getShoulderEntityRight

        public CompoundNBT getShoulderEntityRight()
      • setShoulderEntityRight

        protected void setShoulderEntityRight​(CompoundNBT p_192031_1_)
      • getCurrentItemAttackStrengthDelay

        public float getCurrentItemAttackStrengthDelay()
      • getAttackStrengthScale

        public float getAttackStrengthScale​(float p_184825_1_)
      • resetAttackStrengthTicker

        public void resetAttackStrengthTicker()
      • getLuck

        public float getLuck()
      • canUseGameMasterBlocks

        public boolean canUseGameMasterBlocks()
      • 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
        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