Class Player

All Implemented Interfaces:
CommandSource, SyncedDataHolder, Attackable, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, IPlayerExtension, INBTSerializable<CompoundTag>
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:
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • 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
    • 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
    • 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

    • blockActionRestricted

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

      public static AttributeSupplier.Builder createAttributes()
    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder builder)
      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()
    • turtleHelmetTick

      private void turtleHelmetTick()
    • createItemCooldowns

      protected ItemCooldowns createItemCooldowns()
    • moveCloak

      private void moveCloak()
    • updatePlayerPose

      protected void updatePlayerPose()
    • 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 id)
      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
    • serverAiStep

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

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

      private void playShoulderEntityAmbientSound(@Nullable 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)
      Starts the attack used by the Riptide enchantment.
    • 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()
      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
    • drop

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

      @Nullable public ItemEntity drop(ItemStack droppedItem, boolean dropAround, boolean includeThrowerName)
      Creates and drops the provided item. Depending on the dropAround, it will drop the item around the player, instead of dropping the item from where the player is pointing at. Likewise, if includeThrowerName is true, the dropped item entity will have the thrower set as the player.
    • getDestroySpeed

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

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

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

      public boolean hasCorrectToolForDrops(BlockState p_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(DamageSource source)
      Returns whether this Entity is invulnerable to the given DamageSource.
      Overrides:
      isInvulnerableTo in class LivingEntity
    • hurt

      public boolean hurt(DamageSource source, float amount)
      Called when the entity is attacked.
      Overrides:
      hurt in class LivingEntity
    • blockUsingShield

      protected void blockUsingShield(LivingEntity entity)
      Overrides:
      blockUsingShield 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 damageSource, float damageAmount)
      Overrides:
      hurtHelmet in class LivingEntity
    • hurtCurrentlyUsedShield

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

      protected void actuallyHurt(DamageSource damageSrc, float damageAmount)
      Deals damage to the entity. This will take the armor of the entity into consideration before damaging the health bar.
      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)
    • 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, float 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 target)
      Overrides:
      doAutoAttackOnTouch in class LivingEntity
    • disableShield

      public void disableShield()
    • crit

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

      public void magicCrit(Entity entityHit)
      Called when the entity hit is dealt extra melee damage due to an enchantment.
    • sweepAttack

      public void sweepAttack()
    • respawn

      public void respawn()
    • remove

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

      public boolean isLocalPlayer()
    • getGameProfile

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

      public Inventory getInventory()
    • getAbilities

      public Abilities getAbilities()
    • hasInfiniteMaterials

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

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

      public boolean hasContainerOpen()
    • 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<ResourceLocation> recipes)
    • resetRecipes

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

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

      public void travel(Vec3 travelVector)
      Overrides:
      travel 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(float fallDistance, float multiplier, DamageSource source)
      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
    • playStepSound

      protected void playStepSound(BlockPos pos, BlockState state)
      Overrides:
      playStepSound in class Entity
    • getFallSounds

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

      public boolean killedEntity(ServerLevel level, LivingEntity entity)
      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()
      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()
    • getItemBySlot

      public ItemStack getItemBySlot(EquipmentSlot slot1)
      Specified by:
      getItemBySlot in class LivingEntity
    • doesEmitEquipEvent

      protected boolean doesEmitEquipEvent(EquipmentSlot slot)
      Overrides:
      doesEmitEquipEvent in class LivingEntity
    • setItemSlot

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

      public boolean addItem(ItemStack stack)
    • getHandSlots

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

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

      public boolean canUseSlot(EquipmentSlot slot)
      Overrides:
      canUseSlot in class LivingEntity
    • setEntityOnShoulder

      public boolean setEntityOnShoulder(CompoundTag entityCompound)
    • removeEntitiesOnShoulder

      protected void removeEntitiesOnShoulder()
    • respawnEntityOnShoulder

      private void respawnEntityOnShoulder(CompoundTag entityCompound)
    • isSpectator

      public abstract 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 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
      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 absorptionAmount)
      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 slot)
      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()
    • canUseGameMasterBlocks

      public boolean canUseGameMasterBlocks()
    • canTakeItem

      public boolean canTakeItem(ItemStack itemstack)
      Overrides:
      canTakeItem in class LivingEntity
    • getDefaultDimensions

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

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

      public ItemStack getProjectile(ItemStack shootable)
      Gets an item stack available to this entity to be loaded into the provided weapon, or an empty item stack if no such item stack is available.
      Overrides:
      getProjectile in class LivingEntity
    • eat

      public ItemStack eat(Level level, ItemStack food, FoodProperties foodProperties)
      Overrides:
      eat 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 yaw)
      Overrides:
      animateHurt in class LivingEntity
    • canSprint

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

      protected float getFlyingSpeed()
      Overrides:
      getFlyingSpeed in class LivingEntity
    • 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()
    • 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