Class AbstractHorseEntity

All Implemented Interfaces:
ICommandSource, IEquipable, IJumpingMount, IInventoryChangedListener, INameable, ICapabilityProvider, ICapabilitySerializable<CompoundNBT>, IForgeEntity, INBTSerializable<CompoundNBT>
Direct Known Subclasses:
AbstractChestedHorseEntity, HorseEntity, SkeletonHorseEntity, ZombieHorseEntity

public abstract class AbstractHorseEntity extends AnimalEntity implements IInventoryChangedListener, IJumpingMount, IEquipable
  • Field Details

    • PARENT_HORSE_SELECTOR

      private static final Predicate<LivingEntity> PARENT_HORSE_SELECTOR
    • MOMMY_TARGETING

      private static final EntityPredicate MOMMY_TARGETING
    • FOOD_ITEMS

      private static final Ingredient FOOD_ITEMS
    • DATA_ID_FLAGS

      private static final DataParameter<Byte> DATA_ID_FLAGS
    • DATA_ID_OWNER_UUID

      private static final DataParameter<Optional<UUID>> DATA_ID_OWNER_UUID
    • eatingCounter

      private int eatingCounter
    • mouthCounter

      private int mouthCounter
    • standCounter

      private int standCounter
    • tailCounter

      public int tailCounter
    • sprintCounter

      public int sprintCounter
    • isJumping

      protected boolean isJumping
    • inventory

      protected Inventory inventory
    • temper

      protected int temper
    • playerJumpPendingScale

      protected float playerJumpPendingScale
    • allowStandSliding

      private boolean allowStandSliding
    • eatAnim

      private float eatAnim
    • eatAnimO

      private float eatAnimO
    • standAnim

      private float standAnim
    • standAnimO

      private float standAnimO
    • mouthAnim

      private float mouthAnim
    • mouthAnimO

      private float mouthAnimO
    • canGallop

      protected boolean canGallop
    • gallopSoundCounter

      protected int gallopSoundCounter
    • itemHandler

      private LazyOptional<?> itemHandler
  • Constructor Details

  • Method Details

    • registerGoals

      protected void registerGoals()
      Overrides:
      registerGoals in class MobEntity
    • addBehaviourGoals

      protected void addBehaviourGoals()
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class AgeableEntity
    • getFlag

      protected boolean getFlag(int p_110233_1_)
    • setFlag

      protected void setFlag(int p_110208_1_, boolean p_110208_2_)
    • isTamed

      public boolean isTamed()
    • getOwnerUUID

      @Nullable public UUID getOwnerUUID()
    • setOwnerUUID

      public void setOwnerUUID(@Nullable UUID p_184779_1_)
    • isJumping

      public boolean isJumping()
    • setTamed

      public void setTamed(boolean p_110234_1_)
    • setIsJumping

      public void setIsJumping(boolean p_110255_1_)
    • onLeashDistance

      protected void onLeashDistance(float p_142017_1_)
      Overrides:
      onLeashDistance in class CreatureEntity
    • isEating

      public boolean isEating()
    • isStanding

      public boolean isStanding()
    • isBred

      public boolean isBred()
    • setBred

      public void setBred(boolean p_110242_1_)
    • isSaddleable

      public boolean isSaddleable()
      Specified by:
      isSaddleable in interface IEquipable
    • equipSaddle

      public void equipSaddle(@Nullable SoundCategory p_230266_1_)
      Specified by:
      equipSaddle in interface IEquipable
    • isSaddled

      public boolean isSaddled()
      Specified by:
      isSaddled in interface IEquipable
    • getTemper

      public int getTemper()
    • setTemper

      public void setTemper(int p_110238_1_)
    • modifyTemper

      public int modifyTemper(int p_110198_1_)
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class LivingEntity
    • eating

      private void eating()
    • causeFallDamage

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

      protected int calculateFallDamage(float p_225508_1_, float p_225508_2_)
      Overrides:
      calculateFallDamage in class LivingEntity
    • getInventorySize

      protected int getInventorySize()
    • createInventory

      protected void createInventory()
    • updateContainerEquipment

      protected void updateContainerEquipment()
    • containerChanged

      public void containerChanged(IInventory p_76316_1_)
      Specified by:
      containerChanged in interface IInventoryChangedListener
    • getCustomJump

      public double getCustomJump()
    • getEatingSound

      @Nullable protected SoundEvent getEatingSound()
    • getDeathSound

      @Nullable protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class LivingEntity
    • getHurtSound

      @Nullable protected SoundEvent getHurtSound(DamageSource p_184601_1_)
      Overrides:
      getHurtSound in class LivingEntity
    • getAmbientSound

      @Nullable protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class MobEntity
    • getAngrySound

      @Nullable protected SoundEvent getAngrySound()
    • playStepSound

      protected void playStepSound(BlockPos p_180429_1_, BlockState p_180429_2_)
      Overrides:
      playStepSound in class Entity
    • playGallopSound

      protected void playGallopSound(SoundType p_190680_1_)
    • createBaseHorseAttributes

      public static AttributeModifierMap.MutableAttribute createBaseHorseAttributes()
    • getMaxSpawnClusterSize

      public int getMaxSpawnClusterSize()
      Overrides:
      getMaxSpawnClusterSize in class MobEntity
    • getMaxTemper

      public int getMaxTemper()
    • getSoundVolume

      protected float getSoundVolume()
      Overrides:
      getSoundVolume in class LivingEntity
    • getAmbientSoundInterval

      public int getAmbientSoundInterval()
      Overrides:
      getAmbientSoundInterval in class AnimalEntity
    • openInventory

      public void openInventory(PlayerEntity p_110199_1_)
    • fedFood

      public ActionResultType fedFood(PlayerEntity p_241395_1_, ItemStack p_241395_2_)
    • handleEating

      protected boolean handleEating(PlayerEntity p_190678_1_, ItemStack p_190678_2_)
    • doPlayerRide

      protected void doPlayerRide(PlayerEntity p_110237_1_)
    • isImmobile

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

      public boolean isFood(ItemStack p_70877_1_)
      Overrides:
      isFood in class AnimalEntity
    • moveTail

      private void moveTail()
    • dropEquipment

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

      public void aiStep()
      Overrides:
      aiStep in class AnimalEntity
    • followMommy

      protected void followMommy()
    • canEatGrass

      public boolean canEatGrass()
    • tick

      public void tick()
      Overrides:
      tick in class MobEntity
    • openMouth

      private void openMouth()
    • setEating

      public void setEating(boolean p_110227_1_)
    • setStanding

      public void setStanding(boolean p_110219_1_)
    • stand

      private void stand()
    • makeMad

      public void makeMad()
    • tameWithName

      public boolean tameWithName(PlayerEntity p_110263_1_)
    • travel

      public void travel(Vector3d p_213352_1_)
      Overrides:
      travel in class LivingEntity
    • playJumpSound

      protected void playJumpSound()
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundNBT p_213281_1_)
      Overrides:
      addAdditionalSaveData in class AnimalEntity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundNBT p_70037_1_)
      Overrides:
      readAdditionalSaveData in class AnimalEntity
    • canMate

      public boolean canMate(AnimalEntity p_70878_1_)
      Overrides:
      canMate in class AnimalEntity
    • canParent

      protected boolean canParent()
    • getBreedOffspring

      @Nullable public AgeableEntity getBreedOffspring(ServerWorld p_241840_1_, AgeableEntity p_241840_2_)
      Specified by:
      getBreedOffspring in class AgeableEntity
    • setOffspringAttributes

      protected void setOffspringAttributes(AgeableEntity p_190681_1_, AbstractHorseEntity p_190681_2_)
    • canBeControlledByRider

      public boolean canBeControlledByRider()
      Overrides:
      canBeControlledByRider in class MobEntity
    • getEatAnim

      public float getEatAnim(float p_110258_1_)
    • getStandAnim

      public float getStandAnim(float p_110223_1_)
    • getMouthAnim

      public float getMouthAnim(float p_110201_1_)
    • onPlayerJump

      public void onPlayerJump(int p_110206_1_)
      Specified by:
      onPlayerJump in interface IJumpingMount
    • canJump

      public boolean canJump()
      Specified by:
      canJump in interface IJumpingMount
    • handleStartJump

      public void handleStartJump(int p_184775_1_)
      Specified by:
      handleStartJump in interface IJumpingMount
    • handleStopJump

      public void handleStopJump()
      Specified by:
      handleStopJump in interface IJumpingMount
    • spawnTamingParticles

      protected void spawnTamingParticles(boolean p_110216_1_)
    • handleEntityEvent

      public void handleEntityEvent(byte p_70103_1_)
      Overrides:
      handleEntityEvent in class AnimalEntity
    • positionRider

      public void positionRider(Entity p_184232_1_)
      Overrides:
      positionRider in class Entity
    • generateRandomMaxHealth

      protected float generateRandomMaxHealth()
    • generateRandomJumpStrength

      protected double generateRandomJumpStrength()
    • generateRandomSpeed

      protected double generateRandomSpeed()
    • onClimbable

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

      protected float getStandingEyeHeight(Pose p_213348_1_, EntitySize p_213348_2_)
      Overrides:
      getStandingEyeHeight in class LivingEntity
    • canWearArmor

      public boolean canWearArmor()
    • isWearingArmor

      public boolean isWearingArmor()
    • isArmor

      public boolean isArmor(ItemStack p_190682_1_)
    • setSlot

      public boolean setSlot(int p_174820_1_, ItemStack p_174820_2_)
      Overrides:
      setSlot in class MobEntity
    • getControllingPassenger

      @Nullable public Entity getControllingPassenger()
      Overrides:
      getControllingPassenger in class Entity
    • getDismountLocationInDirection

      @Nullable private Vector3d getDismountLocationInDirection(Vector3d p_234236_1_, LivingEntity p_234236_2_)
    • getDismountLocationForPassenger

      public Vector3d getDismountLocationForPassenger(LivingEntity p_230268_1_)
      Overrides:
      getDismountLocationForPassenger in class Entity
    • randomizeAttributes

      protected void randomizeAttributes()
    • finalizeSpawn

      @Nullable public ILivingEntityData finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, @Nullable ILivingEntityData p_213386_4_, @Nullable CompoundNBT p_213386_5_)
      Overrides:
      finalizeSpawn in class AgeableEntity
    • 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.
    • invalidateCaps

      protected void invalidateCaps()
      Overrides:
      invalidateCaps in class LivingEntity