Class LivingEntity

All Implemented Interfaces:
CommandSource, Attackable, EntityAccess, Nameable, ScoreHolder, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, IForgeLivingEntity, INBTSerializable<CompoundTag>
Direct Known Subclasses:
ArmorStand, Mob, Player

public abstract class LivingEntity extends Entity implements Attackable, IForgeLivingEntity
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TAG_ACTIVE_EFFECTS

      private static final String TAG_ACTIVE_EFFECTS
      See Also:
    • SPEED_MODIFIER_SOUL_SPEED_UUID

      private static final UUID SPEED_MODIFIER_SOUL_SPEED_UUID
    • SPEED_MODIFIER_POWDER_SNOW_UUID

      private static final UUID SPEED_MODIFIER_POWDER_SNOW_UUID
    • SLOW_FALLING_ID

      private static final UUID SLOW_FALLING_ID
    • SPEED_MODIFIER_SPRINTING

      private static final AttributeModifier SPEED_MODIFIER_SPRINTING
    • SLOW_FALLING

      private static final AttributeModifier SLOW_FALLING
    • HAND_SLOTS

      public static final int HAND_SLOTS
      See Also:
    • ARMOR_SLOTS

      public static final int ARMOR_SLOTS
      See Also:
    • EQUIPMENT_SLOT_OFFSET

      public static final int EQUIPMENT_SLOT_OFFSET
      See Also:
    • ARMOR_SLOT_OFFSET

      public static final int ARMOR_SLOT_OFFSET
      See Also:
    • SWING_DURATION

      public static final int SWING_DURATION
      See Also:
    • PLAYER_HURT_EXPERIENCE_TIME

      public static final int PLAYER_HURT_EXPERIENCE_TIME
      See Also:
    • DAMAGE_SOURCE_TIMEOUT

      private static final int DAMAGE_SOURCE_TIMEOUT
      See Also:
    • MIN_MOVEMENT_DISTANCE

      public static final double MIN_MOVEMENT_DISTANCE
      See Also:
    • DEFAULT_BASE_GRAVITY

      public static final double DEFAULT_BASE_GRAVITY
      See Also:
    • DEATH_DURATION

      public static final int DEATH_DURATION
      See Also:
    • WAIT_TICKS_BEFORE_ITEM_USE_EFFECTS

      private static final int WAIT_TICKS_BEFORE_ITEM_USE_EFFECTS
      See Also:
    • TICKS_PER_ELYTRA_FREE_FALL_EVENT

      private static final int TICKS_PER_ELYTRA_FREE_FALL_EVENT
      See Also:
    • FREE_FALL_EVENTS_PER_ELYTRA_BREAK

      private static final int FREE_FALL_EVENTS_PER_ELYTRA_BREAK
      See Also:
    • USE_ITEM_INTERVAL

      public static final int USE_ITEM_INTERVAL
      See Also:
    • BASE_JUMP_POWER

      private static final float BASE_JUMP_POWER
      See Also:
    • MAX_LINE_OF_SIGHT_TEST_RANGE

      private static final double MAX_LINE_OF_SIGHT_TEST_RANGE
      See Also:
    • LIVING_ENTITY_FLAG_IS_USING

      protected static final int LIVING_ENTITY_FLAG_IS_USING
      See Also:
    • LIVING_ENTITY_FLAG_OFF_HAND

      protected static final int LIVING_ENTITY_FLAG_OFF_HAND
      See Also:
    • LIVING_ENTITY_FLAG_SPIN_ATTACK

      protected static final int LIVING_ENTITY_FLAG_SPIN_ATTACK
      See Also:
    • DATA_LIVING_ENTITY_FLAGS

      protected static final EntityDataAccessor<Byte> DATA_LIVING_ENTITY_FLAGS
    • DATA_HEALTH_ID

      private static final EntityDataAccessor<Float> DATA_HEALTH_ID
    • DATA_EFFECT_COLOR_ID

      private static final EntityDataAccessor<Integer> DATA_EFFECT_COLOR_ID
    • DATA_EFFECT_AMBIENCE_ID

      private static final EntityDataAccessor<Boolean> DATA_EFFECT_AMBIENCE_ID
    • DATA_ARROW_COUNT_ID

      private static final EntityDataAccessor<Integer> DATA_ARROW_COUNT_ID
    • DATA_STINGER_COUNT_ID

      private static final EntityDataAccessor<Integer> DATA_STINGER_COUNT_ID
    • SLEEPING_POS_ID

      private static final EntityDataAccessor<Optional<BlockPos>> SLEEPING_POS_ID
    • DEFAULT_EYE_HEIGHT

      protected static final float DEFAULT_EYE_HEIGHT
      See Also:
    • SLEEPING_DIMENSIONS

      protected static final EntityDimensions SLEEPING_DIMENSIONS
    • EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT

      public static final float EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT
      See Also:
    • attributes

      private final AttributeMap attributes
    • combatTracker

      private final CombatTracker combatTracker
    • activeEffects

      private final Map<MobEffect,MobEffectInstance> activeEffects
    • lastHandItemStacks

      private final NonNullList<ItemStack> lastHandItemStacks
    • lastArmorItemStacks

      private final NonNullList<ItemStack> lastArmorItemStacks
    • swinging

      public boolean swinging
    • discardFriction

      private boolean discardFriction
    • swingingArm

      public InteractionHand swingingArm
    • swingTime

      public int swingTime
    • removeArrowTime

      public int removeArrowTime
    • removeStingerTime

      public int removeStingerTime
    • hurtTime

      public int hurtTime
    • hurtDuration

      public int hurtDuration
    • deathTime

      public int deathTime
    • oAttackAnim

      public float oAttackAnim
    • attackAnim

      public float attackAnim
    • attackStrengthTicker

      protected int attackStrengthTicker
    • walkAnimation

      public final WalkAnimationState walkAnimation
    • invulnerableDuration

      public final int invulnerableDuration
      See Also:
    • timeOffs

      public final float timeOffs
    • rotA

      public final float rotA
    • yBodyRot

      public float yBodyRot
    • yBodyRotO

      public float yBodyRotO
    • yHeadRot

      public float yHeadRot
    • yHeadRotO

      public float yHeadRotO
    • lastHurtByPlayer

      @Nullable protected Player lastHurtByPlayer
    • lastHurtByPlayerTime

      protected int lastHurtByPlayerTime
    • dead

      protected boolean dead
    • noActionTime

      protected int noActionTime
    • oRun

      protected float oRun
    • run

      protected float run
    • animStep

      protected float animStep
    • animStepO

      protected float animStepO
    • rotOffs

      protected float rotOffs
    • deathScore

      protected int deathScore
    • lastHurt

      protected float lastHurt
    • jumping

      protected boolean jumping
    • xxa

      public float xxa
    • yya

      public float yya
    • zza

      public float zza
    • lerpSteps

      protected int lerpSteps
    • lerpX

      protected double lerpX
    • lerpY

      protected double lerpY
    • lerpZ

      protected double lerpZ
    • lerpYRot

      protected double lerpYRot
    • lerpXRot

      protected double lerpXRot
    • lerpYHeadRot

      protected double lerpYHeadRot
    • lerpHeadSteps

      protected int lerpHeadSteps
    • effectsDirty

      private boolean effectsDirty
    • lastHurtByMob

      @Nullable private LivingEntity lastHurtByMob
    • lastHurtByMobTimestamp

      private int lastHurtByMobTimestamp
    • lastHurtMob

      private LivingEntity lastHurtMob
    • lastHurtMobTimestamp

      private int lastHurtMobTimestamp
    • speed

      private float speed
    • noJumpDelay

      private int noJumpDelay
    • absorptionAmount

      private float absorptionAmount
    • useItem

      protected ItemStack useItem
    • useItemRemaining

      protected int useItemRemaining
    • fallFlyTicks

      protected int fallFlyTicks
    • lastPos

      private BlockPos lastPos
    • lastClimbablePos

      private Optional<BlockPos> lastClimbablePos
    • lastDamageSource

      @Nullable private DamageSource lastDamageSource
    • lastDamageStamp

      private long lastDamageStamp
    • autoSpinAttackTicks

      protected int autoSpinAttackTicks
    • swimAmount

      private float swimAmount
    • swimAmountO

      private float swimAmountO
    • brain

      protected Brain<?> brain
    • skipDropExperience

      private boolean skipDropExperience
    • handlers

      private LazyOptional<?>[] handlers
  • Constructor Details

  • Method Details

    • getBrain

      public Brain<?> getBrain()
    • brainProvider

      protected Brain.Provider<?> brainProvider()
    • makeBrain

      protected Brain<?> makeBrain(com.mojang.serialization.Dynamic<?> p_21069_)
    • kill

      public void kill()
      Overrides:
      kill in class Entity
    • canAttackType

      public boolean canAttackType(EntityType<?> p_21032_)
    • defineSynchedData

      protected void defineSynchedData()
      Specified by:
      defineSynchedData in class Entity
    • createLivingAttributes

      public static AttributeSupplier.Builder createLivingAttributes()
    • checkFallDamage

      protected void checkFallDamage(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_)
      Overrides:
      checkFallDamage in class Entity
    • canBreatheUnderwater

      @Deprecated public final boolean canBreatheUnderwater()
      Deprecated.
    • getSwimAmount

      public float getSwimAmount(float p_20999_)
    • baseTick

      public void baseTick()
      Overrides:
      baseTick in class Entity
    • canSpawnSoulSpeedParticle

      public boolean canSpawnSoulSpeedParticle()
    • spawnSoulSpeedParticle

      protected void spawnSoulSpeedParticle()
    • onSoulSpeedBlock

      protected boolean onSoulSpeedBlock()
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
      Overrides:
      getBlockSpeedFactor in class Entity
    • shouldRemoveSoulSpeed

      protected boolean shouldRemoveSoulSpeed(BlockState p_21140_)
    • removeSoulSpeed

      protected void removeSoulSpeed()
    • tryAddSoulSpeed

      protected void tryAddSoulSpeed()
    • removeFrost

      protected void removeFrost()
    • tryAddFrost

      protected void tryAddFrost()
    • onChangedBlock

      protected void onChangedBlock(BlockPos p_21175_)
    • isBaby

      public boolean isBaby()
    • getScale

      public float getScale()
    • isAffectedByFluids

      protected boolean isAffectedByFluids()
    • tickDeath

      protected void tickDeath()
    • shouldDropExperience

      public boolean shouldDropExperience()
    • shouldDropLoot

      protected boolean shouldDropLoot()
    • decreaseAirSupply

      protected int decreaseAirSupply(int p_21303_)
    • increaseAirSupply

      protected int increaseAirSupply(int p_21307_)
    • getExperienceReward

      public int getExperienceReward()
    • isAlwaysExperienceDropper

      protected boolean isAlwaysExperienceDropper()
    • getRandom

      public RandomSource getRandom()
    • getLastHurtByMob

      @Nullable public LivingEntity getLastHurtByMob()
    • getLastAttacker

      public LivingEntity getLastAttacker()
      Specified by:
      getLastAttacker in interface Attackable
    • getLastHurtByMobTimestamp

      public int getLastHurtByMobTimestamp()
    • setLastHurtByPlayer

      public void setLastHurtByPlayer(@Nullable Player p_21248_)
    • setLastHurtByMob

      public void setLastHurtByMob(@Nullable LivingEntity p_21039_)
    • getLastHurtMob

      @Nullable public LivingEntity getLastHurtMob()
    • getLastHurtMobTimestamp

      public int getLastHurtMobTimestamp()
    • setLastHurtMob

      public void setLastHurtMob(Entity p_21336_)
    • getNoActionTime

      public int getNoActionTime()
    • setNoActionTime

      public void setNoActionTime(int p_21311_)
    • shouldDiscardFriction

      public boolean shouldDiscardFriction()
    • setDiscardFriction

      public void setDiscardFriction(boolean p_147245_)
    • doesEmitEquipEvent

      protected boolean doesEmitEquipEvent(EquipmentSlot p_217035_)
    • onEquipItem

      public void onEquipItem(EquipmentSlot p_238393_, ItemStack p_238394_, ItemStack p_238395_)
    • remove

      public void remove(Entity.RemovalReason p_276115_)
      Overrides:
      remove in class Entity
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag p_21145_)
      Specified by:
      addAdditionalSaveData in class Entity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag p_21096_)
      Specified by:
      readAdditionalSaveData in class Entity
    • tickEffects

      protected void tickEffects()
    • updateInvisibilityStatus

      protected void updateInvisibilityStatus()
    • updateGlowingStatus

      private void updateGlowingStatus()
    • getVisibilityPercent

      public double getVisibilityPercent(@Nullable Entity p_20969_)
    • canAttack

      public boolean canAttack(LivingEntity p_21171_)
    • canAttack

      public boolean canAttack(LivingEntity p_21041_, TargetingConditions p_21042_)
    • canBeSeenAsEnemy

      public boolean canBeSeenAsEnemy()
    • canBeSeenByAnyone

      public boolean canBeSeenByAnyone()
    • areAllEffectsAmbient

      public static boolean areAllEffectsAmbient(Collection<MobEffectInstance> p_21180_)
    • removeEffectParticles

      protected void removeEffectParticles()
    • removeAllEffects

      public boolean removeAllEffects()
    • getActiveEffects

      public Collection<MobEffectInstance> getActiveEffects()
    • getActiveEffectsMap

      public Map<MobEffect,MobEffectInstance> getActiveEffectsMap()
    • hasEffect

      public boolean hasEffect(MobEffect p_21024_)
    • getEffect

      @Nullable public MobEffectInstance getEffect(MobEffect p_21125_)
    • addEffect

      public final boolean addEffect(MobEffectInstance p_21165_)
    • addEffect

      public boolean addEffect(MobEffectInstance p_147208_, @Nullable Entity p_147209_)
    • canBeAffected

      public boolean canBeAffected(MobEffectInstance p_21197_)
    • forceAddEffect

      public void forceAddEffect(MobEffectInstance p_147216_, @Nullable Entity p_147217_)
    • isInvertedHealAndHarm

      public boolean isInvertedHealAndHarm()
    • removeEffectNoUpdate

      @Nullable public MobEffectInstance removeEffectNoUpdate(@Nullable MobEffect p_21164_)
    • removeEffect

      public boolean removeEffect(MobEffect p_21196_)
    • onEffectAdded

      protected void onEffectAdded(MobEffectInstance p_147190_, @Nullable Entity p_147191_)
    • sendEffectToPassengers

      public void sendEffectToPassengers(MobEffectInstance p_289695_)
    • onEffectUpdated

      protected void onEffectUpdated(MobEffectInstance p_147192_, boolean p_147193_, @Nullable Entity p_147194_)
    • onEffectRemoved

      protected void onEffectRemoved(MobEffectInstance p_21126_)
    • refreshDirtyAttributes

      private void refreshDirtyAttributes()
    • onAttributeUpdated

      private void onAttributeUpdated(Attribute p_298194_)
    • heal

      public void heal(float p_21116_)
    • getHealth

      public float getHealth()
    • setHealth

      public void setHealth(float p_21154_)
    • isDeadOrDying

      public boolean isDeadOrDying()
    • hurt

      public boolean hurt(DamageSource p_21016_, float p_21017_)
      Overrides:
      hurt in class Entity
    • blockUsingShield

      protected void blockUsingShield(LivingEntity p_21200_)
    • blockedByShield

      protected void blockedByShield(LivingEntity p_21246_)
    • checkTotemDeathProtection

      private boolean checkTotemDeathProtection(DamageSource p_21263_)
    • getLastDamageSource

      @Nullable public DamageSource getLastDamageSource()
    • playHurtSound

      protected void playHurtSound(DamageSource p_21160_)
    • isDamageSourceBlocked

      public boolean isDamageSourceBlocked(DamageSource p_21276_)
    • breakItem

      private void breakItem(ItemStack p_21279_)
    • die

      public void die(DamageSource p_21014_)
    • createWitherRose

      protected void createWitherRose(@Nullable LivingEntity p_21269_)
    • dropAllDeathLoot

      protected void dropAllDeathLoot(DamageSource p_21192_)
    • dropEquipment

      protected void dropEquipment()
    • dropExperience

      protected void dropExperience()
    • dropCustomDeathLoot

      protected void dropCustomDeathLoot(DamageSource p_21018_, int p_21019_, boolean p_21020_)
    • getLootTable

      public ResourceLocation getLootTable()
    • getLootTableSeed

      public long getLootTableSeed()
    • dropFromLootTable

      protected void dropFromLootTable(DamageSource p_21021_, boolean p_21022_)
    • knockback

      public void knockback(double p_147241_, double p_147242_, double p_147243_)
    • indicateDamage

      public void indicateDamage(double p_270514_, double p_270826_)
    • getHurtSound

      @Nullable protected SoundEvent getHurtSound(DamageSource p_21239_)
    • getDeathSound

      @Nullable protected SoundEvent getDeathSound()
    • getFallDamageSound

      private SoundEvent getFallDamageSound(int p_21313_)
    • skipDropExperience

      public void skipDropExperience()
    • wasExperienceConsumed

      public boolean wasExperienceConsumed()
    • getHurtDir

      public float getHurtDir()
    • getHitbox

      protected AABB getHitbox()
    • getFallSounds

      public LivingEntity.Fallsounds getFallSounds()
    • getDrinkingSound

      protected SoundEvent getDrinkingSound(ItemStack p_21174_)
    • getEatingSound

      public SoundEvent getEatingSound(ItemStack p_21202_)
    • getLastClimbablePos

      public Optional<BlockPos> getLastClimbablePos()
    • onClimbable

      public boolean onClimbable()
    • trapdoorUsableAsLadder

      private boolean trapdoorUsableAsLadder(BlockPos p_21177_, BlockState p_21178_)
    • isAlive

      public boolean isAlive()
      Overrides:
      isAlive in class Entity
    • causeFallDamage

      public boolean causeFallDamage(float p_147187_, float p_147188_, DamageSource p_147189_)
      Overrides:
      causeFallDamage in class Entity
    • calculateFallDamage

      protected int calculateFallDamage(float p_21237_, float p_21238_)
    • playBlockFallSound

      protected void playBlockFallSound()
    • animateHurt

      public void animateHurt(float p_265265_)
      Overrides:
      animateHurt in class Entity
    • getArmorValue

      public int getArmorValue()
    • hurtArmor

      protected void hurtArmor(DamageSource p_21122_, float p_21123_)
    • hurtHelmet

      protected void hurtHelmet(DamageSource p_147213_, float p_147214_)
    • hurtCurrentlyUsedShield

      protected void hurtCurrentlyUsedShield(float p_21316_)
    • getDamageAfterArmorAbsorb

      protected float getDamageAfterArmorAbsorb(DamageSource p_21162_, float p_21163_)
    • getDamageAfterMagicAbsorb

      protected float getDamageAfterMagicAbsorb(DamageSource p_21193_, float p_21194_)
    • actuallyHurt

      protected void actuallyHurt(DamageSource p_21240_, float p_21241_)
    • getCombatTracker

      public CombatTracker getCombatTracker()
    • getKillCredit

      @Nullable public LivingEntity getKillCredit()
    • getMaxHealth

      public final float getMaxHealth()
    • getMaxAbsorption

      public final float getMaxAbsorption()
    • getArrowCount

      public final int getArrowCount()
    • setArrowCount

      public final void setArrowCount(int p_21318_)
    • getStingerCount

      public final int getStingerCount()
    • setStingerCount

      public final void setStingerCount(int p_21322_)
    • getCurrentSwingDuration

      private int getCurrentSwingDuration()
    • swing

      public void swing(InteractionHand p_21007_)
    • swing

      public void swing(InteractionHand p_21012_, boolean p_21013_)
    • handleDamageEvent

      public void handleDamageEvent(DamageSource p_270229_)
      Overrides:
      handleDamageEvent in class Entity
    • handleEntityEvent

      public void handleEntityEvent(byte p_20975_)
      Overrides:
      handleEntityEvent in class Entity
    • makePoofParticles

      private void makePoofParticles()
    • swapHandItems

      private void swapHandItems()
    • onBelowWorld

      protected void onBelowWorld()
      Overrides:
      onBelowWorld in class Entity
    • updateSwingTime

      protected void updateSwingTime()
    • getAttribute

      @Nullable public AttributeInstance getAttribute(Attribute p_21052_)
    • getAttributeValue

      public double getAttributeValue(Holder<Attribute> p_251296_)
    • getAttributeValue

      public double getAttributeValue(Attribute p_21134_)
    • getAttributeBaseValue

      public double getAttributeBaseValue(Holder<Attribute> p_248605_)
    • getAttributeBaseValue

      public double getAttributeBaseValue(Attribute p_21173_)
    • getAttributes

      public AttributeMap getAttributes()
    • getMobType

      public MobType getMobType()
    • getMainHandItem

      public ItemStack getMainHandItem()
    • getOffhandItem

      public ItemStack getOffhandItem()
    • isHolding

      public boolean isHolding(Item p_21056_)
    • isHolding

      public boolean isHolding(Predicate<ItemStack> p_21094_)
    • getItemInHand

      public ItemStack getItemInHand(InteractionHand p_21121_)
    • setItemInHand

      public void setItemInHand(InteractionHand p_21009_, ItemStack p_21010_)
    • hasItemInSlot

      public boolean hasItemInSlot(EquipmentSlot p_21034_)
    • getArmorSlots

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

      public abstract ItemStack getItemBySlot(EquipmentSlot p_21127_)
    • setItemSlot

      public abstract void setItemSlot(EquipmentSlot p_21036_, ItemStack p_21037_)
      Overrides:
      setItemSlot in class Entity
    • verifyEquippedItem

      protected void verifyEquippedItem(ItemStack p_181123_)
    • getArmorCoverPercentage

      public float getArmorCoverPercentage()
    • setSprinting

      public void setSprinting(boolean p_21284_)
      Overrides:
      setSprinting in class Entity
    • getSoundVolume

      protected float getSoundVolume()
    • getVoicePitch

      public float getVoicePitch()
    • isImmobile

      protected boolean isImmobile()
    • push

      public void push(Entity p_21294_)
      Overrides:
      push in class Entity
    • dismountVehicle

      private void dismountVehicle(Entity p_21029_)
    • shouldShowName

      public boolean shouldShowName()
      Overrides:
      shouldShowName in class Entity
    • getJumpPower

      protected float getJumpPower()
    • getJumpBoostPower

      public float getJumpBoostPower()
    • jumpFromGround

      protected void jumpFromGround()
    • goDownInWater

      @Deprecated protected void goDownInWater()
      Deprecated.
    • jumpInLiquid

      @Deprecated protected void jumpInLiquid(TagKey<Fluid> p_204043_)
      Deprecated.
    • getWaterSlowDown

      protected float getWaterSlowDown()
    • canStandOnFluid

      public boolean canStandOnFluid(FluidState p_204042_)
    • travel

      public void travel(Vec3 p_21280_)
    • travelRidden

      private void travelRidden(Player p_278244_, Vec3 p_278231_)
    • tickRidden

      protected void tickRidden(Player p_278262_, Vec3 p_275242_)
    • getRiddenInput

      protected Vec3 getRiddenInput(Player p_278326_, Vec3 p_275300_)
    • getRiddenSpeed

      protected float getRiddenSpeed(Player p_278286_)
    • calculateEntityAnimation

      public void calculateEntityAnimation(boolean p_268129_)
    • updateWalkAnimation

      protected void updateWalkAnimation(float p_268283_)
    • handleRelativeFrictionAndCalculateMovement

      public Vec3 handleRelativeFrictionAndCalculateMovement(Vec3 p_21075_, float p_21076_)
    • getFluidFallingAdjustedMovement

      public Vec3 getFluidFallingAdjustedMovement(double p_20995_, boolean p_20996_, Vec3 p_20997_)
    • handleOnClimbable

      private Vec3 handleOnClimbable(Vec3 p_21298_)
    • getFrictionInfluencedSpeed

      private float getFrictionInfluencedSpeed(float p_21331_)
    • getFlyingSpeed

      protected float getFlyingSpeed()
    • getSpeed

      public float getSpeed()
    • setSpeed

      public void setSpeed(float p_21320_)
    • doHurtTarget

      public boolean doHurtTarget(Entity p_20970_)
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • detectEquipmentUpdates

      private void detectEquipmentUpdates()
    • collectEquipmentChanges

      @Nullable private Map<EquipmentSlot,ItemStack> collectEquipmentChanges()
    • equipmentHasChanged

      public boolean equipmentHasChanged(ItemStack p_252265_, ItemStack p_251043_)
    • handleHandSwap

      private void handleHandSwap(Map<EquipmentSlot,ItemStack> p_21092_)
    • handleEquipmentChanges

      private void handleEquipmentChanges(Map<EquipmentSlot,ItemStack> p_21143_)
    • getLastArmorItem

      private ItemStack getLastArmorItem(EquipmentSlot p_21199_)
    • setLastArmorItem

      private void setLastArmorItem(EquipmentSlot p_21129_, ItemStack p_21130_)
    • getLastHandItem

      private ItemStack getLastHandItem(EquipmentSlot p_21245_)
    • setLastHandItem

      private void setLastHandItem(EquipmentSlot p_21169_, ItemStack p_21170_)
    • tickHeadTurn

      protected float tickHeadTurn(float p_21260_, float p_21261_)
    • getMaxHeadRotationRelativeToBody

      protected float getMaxHeadRotationRelativeToBody()
    • aiStep

      public void aiStep()
    • isSensitiveToWater

      public boolean isSensitiveToWater()
    • updateFallFlying

      private void updateFallFlying()
    • serverAiStep

      protected void serverAiStep()
    • pushEntities

      protected void pushEntities()
    • checkAutoSpinAttack

      protected void checkAutoSpinAttack(AABB p_21072_, AABB p_21073_)
    • doPush

      protected void doPush(Entity p_20971_)
    • doAutoAttackOnTouch

      protected void doAutoAttackOnTouch(LivingEntity p_21277_)
    • isAutoSpinAttack

      public boolean isAutoSpinAttack()
    • stopRiding

      public void stopRiding()
      Overrides:
      stopRiding in class Entity
    • rideTick

      public void rideTick()
      Overrides:
      rideTick in class Entity
    • lerpTo

      public void lerpTo(double p_20977_, double p_20978_, double p_20979_, float p_20980_, float p_20981_, int p_20982_)
      Overrides:
      lerpTo in class Entity
    • lerpTargetX

      public double lerpTargetX()
      Overrides:
      lerpTargetX in class Entity
    • lerpTargetY

      public double lerpTargetY()
      Overrides:
      lerpTargetY in class Entity
    • lerpTargetZ

      public double lerpTargetZ()
      Overrides:
      lerpTargetZ in class Entity
    • lerpTargetXRot

      public float lerpTargetXRot()
      Overrides:
      lerpTargetXRot in class Entity
    • lerpTargetYRot

      public float lerpTargetYRot()
      Overrides:
      lerpTargetYRot in class Entity
    • lerpHeadTo

      public void lerpHeadTo(float p_21005_, int p_21006_)
      Overrides:
      lerpHeadTo in class Entity
    • setJumping

      public void setJumping(boolean p_21314_)
    • onItemPickup

      public void onItemPickup(ItemEntity p_21054_)
    • take

      public void take(Entity p_21030_, int p_21031_)
    • hasLineOfSight

      public boolean hasLineOfSight(Entity p_147185_)
    • getViewYRot

      public float getViewYRot(float p_21286_)
      Overrides:
      getViewYRot in class Entity
    • getAttackAnim

      public float getAttackAnim(float p_21325_)
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class Entity
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class Entity
    • getYHeadRot

      public float getYHeadRot()
      Overrides:
      getYHeadRot in class Entity
    • setYHeadRot

      public void setYHeadRot(float p_21306_)
      Overrides:
      setYHeadRot in class Entity
    • setYBodyRot

      public void setYBodyRot(float p_21309_)
      Overrides:
      setYBodyRot in class Entity
    • getRelativePortalPosition

      protected Vec3 getRelativePortalPosition(Direction.Axis p_21085_, BlockUtil.FoundRectangle p_21086_)
      Overrides:
      getRelativePortalPosition in class Entity
    • resetForwardDirectionOfRelativePortalPosition

      public static Vec3 resetForwardDirectionOfRelativePortalPosition(Vec3 p_21290_)
    • getAbsorptionAmount

      public float getAbsorptionAmount()
    • setAbsorptionAmount

      public final void setAbsorptionAmount(float p_21328_)
    • internalSetAbsorptionAmount

      protected void internalSetAbsorptionAmount(float p_299471_)
    • onEnterCombat

      public void onEnterCombat()
    • onLeaveCombat

      public void onLeaveCombat()
    • updateEffectVisibility

      protected void updateEffectVisibility()
    • getMainArm

      public abstract HumanoidArm getMainArm()
    • isUsingItem

      public boolean isUsingItem()
    • getUsedItemHand

      public InteractionHand getUsedItemHand()
    • updatingUsingItem

      private void updatingUsingItem()
    • updateUsingItem

      protected void updateUsingItem(ItemStack p_147201_)
    • shouldTriggerItemUseEffects

      private boolean shouldTriggerItemUseEffects()
    • updateSwimAmount

      private void updateSwimAmount()
    • setLivingEntityFlag

      protected void setLivingEntityFlag(int p_21156_, boolean p_21157_)
    • startUsingItem

      public void startUsingItem(InteractionHand p_21159_)
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> p_21104_)
      Overrides:
      onSyncedDataUpdated in class Entity
    • lookAt

      public void lookAt(EntityAnchorArgument.Anchor p_21078_, Vec3 p_21079_)
      Overrides:
      lookAt in class Entity
    • triggerItemUseEffects

      protected void triggerItemUseEffects(ItemStack p_21138_, int p_21139_)
    • spawnItemParticles

      private void spawnItemParticles(ItemStack p_21061_, int p_21062_)
    • completeUsingItem

      protected void completeUsingItem()
    • getUseItem

      public ItemStack getUseItem()
    • getUseItemRemainingTicks

      public int getUseItemRemainingTicks()
    • getTicksUsingItem

      public int getTicksUsingItem()
    • releaseUsingItem

      public void releaseUsingItem()
    • stopUsingItem

      public void stopUsingItem()
    • isBlocking

      public boolean isBlocking()
    • isSuppressingSlidingDownLadder

      public boolean isSuppressingSlidingDownLadder()
    • isFallFlying

      public boolean isFallFlying()
    • isVisuallySwimming

      public boolean isVisuallySwimming()
      Overrides:
      isVisuallySwimming in class Entity
    • getFallFlyingTicks

      public int getFallFlyingTicks()
    • randomTeleport

      public boolean randomTeleport(double p_20985_, double p_20986_, double p_20987_, boolean p_20988_)
    • isAffectedByPotions

      public boolean isAffectedByPotions()
    • attackable

      public boolean attackable()
    • setRecordPlayingNearby

      public void setRecordPlayingNearby(BlockPos p_21082_, boolean p_21083_)
    • canTakeItem

      public boolean canTakeItem(ItemStack p_21249_)
    • getDimensions

      public EntityDimensions getDimensions(Pose p_21047_)
      Overrides:
      getDimensions in class Entity
    • getDismountPoses

      public com.google.common.collect.ImmutableList<Pose> getDismountPoses()
    • getLocalBoundsForPose

      public AABB getLocalBoundsForPose(Pose p_21271_)
    • wouldNotSuffocateAtTargetPose

      protected boolean wouldNotSuffocateAtTargetPose(Pose p_297537_)
    • canChangeDimensions

      public boolean canChangeDimensions()
      Overrides:
      canChangeDimensions in class Entity
    • getSleepingPos

      public Optional<BlockPos> getSleepingPos()
    • setSleepingPos

      public void setSleepingPos(BlockPos p_21251_)
    • clearSleepingPos

      public void clearSleepingPos()
    • isSleeping

      public boolean isSleeping()
    • startSleeping

      public void startSleeping(BlockPos p_21141_)
    • setPosToBed

      private void setPosToBed(BlockPos p_21081_)
    • checkBedExists

      private boolean checkBedExists()
    • stopSleeping

      public void stopSleeping()
    • getBedOrientation

      @Nullable public Direction getBedOrientation()
    • isInWall

      public boolean isInWall()
      Overrides:
      isInWall in class Entity
    • getEyeHeight

      protected final float getEyeHeight(Pose p_21049_, EntityDimensions p_21050_)
      Overrides:
      getEyeHeight in class Entity
    • getStandingEyeHeight

      protected float getStandingEyeHeight(Pose p_21131_, EntityDimensions p_21132_)
    • getProjectile

      public ItemStack getProjectile(ItemStack p_21272_)
    • eat

      public ItemStack eat(Level p_21067_, ItemStack p_21068_)
    • addEatEffect

      private void addEatEffect(ItemStack p_21064_, Level p_21065_, LivingEntity p_21066_)
    • entityEventForEquipmentBreak

      private static byte entityEventForEquipmentBreak(EquipmentSlot p_21267_)
    • broadcastBreakEvent

      public void broadcastBreakEvent(EquipmentSlot p_21167_)
    • broadcastBreakEvent

      public void broadcastBreakEvent(InteractionHand p_21191_)
    • curePotionEffects

      public boolean curePotionEffects(ItemStack curativeItem)
      Removes all potion effects that have curativeItem as a curative item for its effect
      Parameters:
      curativeItem - The itemstack we are using to cure potion effects
    • shouldRiderFaceForward

      public boolean shouldRiderFaceForward(Player player)
      Returns true if the entity's rider (EntityPlayer) should face forward when mounted. currently only used in vanilla code by pigs.
      Parameters:
      player - The player who is riding the entity.
      Returns:
      If the player should orient the same direction as this entity.
    • 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 CapabilityProvider<Entity>
      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.
    • invalidateCaps

      public void invalidateCaps()
      Specified by:
      invalidateCaps in interface ICapabilityProviderImpl<Entity>
      Overrides:
      invalidateCaps in class CapabilityProvider<Entity>
    • reviveCaps

      public void reviveCaps()
      Specified by:
      reviveCaps in interface ICapabilityProviderImpl<Entity>
      Overrides:
      reviveCaps in class CapabilityProvider<Entity>
    • getBoundingBoxForCulling

      public AABB getBoundingBoxForCulling()
      Overrides:
      getBoundingBoxForCulling in class Entity
    • getEquipmentSlotForItem

      public static EquipmentSlot getEquipmentSlotForItem(ItemStack p_147234_)
    • createEquipmentSlotAccess

      private static SlotAccess createEquipmentSlotAccess(LivingEntity p_147196_, EquipmentSlot p_147197_)
    • getEquipmentSlot

      @Nullable private static EquipmentSlot getEquipmentSlot(int p_147212_)
    • getSlot

      public SlotAccess getSlot(int p_147238_)
      Overrides:
      getSlot in class Entity
    • canFreeze

      public boolean canFreeze()
      Overrides:
      canFreeze in class Entity
    • isCurrentlyGlowing

      public boolean isCurrentlyGlowing()
      Overrides:
      isCurrentlyGlowing in class Entity
    • getVisualRotationYInDegrees

      public float getVisualRotationYInDegrees()
      Overrides:
      getVisualRotationYInDegrees in class Entity
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket p_217037_)
      Overrides:
      recreateFromPacket in class Entity
    • canDisableShield

      public boolean canDisableShield()
    • maxUpStep

      public float maxUpStep()
      Overrides:
      maxUpStep in class Entity
    • getPassengerRidingPosition

      public Vec3 getPassengerRidingPosition(Entity p_299288_)
      Overrides:
      getPassengerRidingPosition in class Entity
    • getMyRidingOffset

      public float getMyRidingOffset(Entity p_298892_)
      Overrides:
      getMyRidingOffset in class Entity
    • lerpHeadRotationStep

      protected void lerpHeadRotationStep(int p_297258_, double p_301409_)