Class HorseBaseEntity

All Implemented Interfaces:
JumpingMount, Saddleable, InventoryChangedListener, CommandOutput, Nameable
Direct Known Subclasses:
AbstractDonkeyEntity, HorseEntity, SkeletonHorseEntity, ZombieHorseEntity

public abstract class HorseBaseEntity
extends AnimalEntity
implements InventoryChangedListener, JumpingMount, Saddleable
  • Field Details

    • IS_BRED_HORSE

      private static final Predicate<LivingEntity> IS_BRED_HORSE
    • PARENT_HORSE_PREDICATE

      private static final TargetPredicate PARENT_HORSE_PREDICATE
    • field_25374

      private static final Ingredient field_25374
    • HORSE_FLAGS

      private static final TrackedData<Byte> HORSE_FLAGS
    • OWNER_UUID

      private static final TrackedData<Optional<UUID>> OWNER_UUID
    • eatingGrassTicks

      private int eatingGrassTicks
    • eatingTicks

      private int eatingTicks
    • angryTicks

      private int angryTicks
    • tailWagTicks

      public int tailWagTicks
    • field_6958

      public int field_6958
    • inAir

      protected boolean inAir
    • items

      protected SimpleInventory items
    • temper

      protected int temper
    • jumpStrength

      protected float jumpStrength
    • jumping

      private boolean jumping
    • eatingGrassAnimationProgress

      private float eatingGrassAnimationProgress
    • lastEatingGrassAnimationProgress

      private float lastEatingGrassAnimationProgress
    • angryAnimationProgress

      private float angryAnimationProgress
    • lastAngryAnimationProgress

      private float lastAngryAnimationProgress
    • eatingAnimationProgress

      private float eatingAnimationProgress
    • lastEatingAnimationProgress

      private float lastEatingAnimationProgress
    • playExtraHorseSounds

      protected boolean playExtraHorseSounds
    • soundTicks

      protected int soundTicks
  • Constructor Details

  • Method Details

    • initGoals

      protected void initGoals()
      Overrides:
      initGoals in class MobEntity
    • initCustomGoals

      protected void initCustomGoals()
    • initDataTracker

      protected void initDataTracker()
      Overrides:
      initDataTracker in class PassiveEntity
    • getHorseFlag

      protected boolean getHorseFlag​(int bitmask)
    • setHorseFlag

      protected void setHorseFlag​(int bitmask, boolean flag)
    • isTame

      public boolean isTame()
    • getOwnerUuid

      @Nullable public UUID getOwnerUuid()
    • setOwnerUuid

      public void setOwnerUuid​(@Nullable UUID uuid)
    • isInAir

      public boolean isInAir()
    • setTame

      public void setTame​(boolean tame)
    • setInAir

      public void setInAir​(boolean inAir)
    • updateForLeashLength

      protected void updateForLeashLength​(float leashLength)
      Overrides:
      updateForLeashLength in class PathAwareEntity
    • isEatingGrass

      public boolean isEatingGrass()
    • isAngry

      public boolean isAngry()
    • isBred

      public boolean isBred()
    • setBred

      public void setBred​(boolean bred)
    • canBeSaddled

      public boolean canBeSaddled()
      Specified by:
      canBeSaddled in interface Saddleable
    • saddle

      public void saddle​(@Nullable SoundCategory sound)
      Specified by:
      saddle in interface Saddleable
    • isSaddled

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

      public int getTemper()
    • setTemper

      public void setTemper​(int temper)
    • addTemper

      public int addTemper​(int difference)
    • isPushable

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

      private void playEatingAnimation()
    • handleFallDamage

      public boolean handleFallDamage​(float fallDistance, float damageMultiplier)
      Overrides:
      handleFallDamage in class LivingEntity
    • computeFallDamage

      protected int computeFallDamage​(float fallDistance, float damageMultiplier)
      Overrides:
      computeFallDamage in class LivingEntity
    • getInventorySize

      protected int getInventorySize()
    • onChestedStatusChanged

      protected void onChestedStatusChanged()
    • updateSaddle

      protected void updateSaddle()
    • onInventoryChanged

      public void onInventoryChanged​(Inventory sender)
      Specified by:
      onInventoryChanged in interface InventoryChangedListener
    • getJumpStrength

      public double getJumpStrength()
    • getEatSound

      @Nullable protected SoundEvent getEatSound()
    • getDeathSound

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

      @Nullable protected SoundEvent getHurtSound​(DamageSource source)
      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 pos, BlockState state)
      Overrides:
      playStepSound in class Entity
    • playWalkSound

      protected void playWalkSound​(BlockSoundGroup group)
    • createBaseHorseAttributes

      public static DefaultAttributeContainer.Builder createBaseHorseAttributes()
    • getLimitPerChunk

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

      public int getMaxTemper()
    • getSoundVolume

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

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

      public void openInventory​(PlayerEntity player)
    • method_30009

      public ActionResult method_30009​(PlayerEntity playerEntity, ItemStack itemStack)
    • receiveFood

      protected boolean receiveFood​(PlayerEntity player, ItemStack item)
    • putPlayerOnBack

      protected void putPlayerOnBack​(PlayerEntity player)
    • isImmobile

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

      public boolean isBreedingItem​(ItemStack stack)
      Overrides:
      isBreedingItem in class AnimalEntity
    • wagTail

      private void wagTail()
    • dropInventory

      protected void dropInventory()
      Overrides:
      dropInventory in class LivingEntity
    • tickMovement

      public void tickMovement()
      Overrides:
      tickMovement in class AnimalEntity
    • walkToParent

      protected void walkToParent()
    • eatsGrass

      public boolean eatsGrass()
    • tick

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

      private void setEating()
    • setEatingGrass

      public void setEatingGrass​(boolean eatingGrass)
    • setAngry

      public void setAngry​(boolean angry)
    • updateAnger

      private void updateAnger()
    • playAngrySound

      public void playAngrySound()
    • bondWithPlayer

      public boolean bondWithPlayer​(PlayerEntity player)
    • travel

      public void travel​(Vec3d movementInput)
      Overrides:
      travel in class LivingEntity
    • playJumpSound

      protected void playJumpSound()
    • writeCustomDataToTag

      public void writeCustomDataToTag​(CompoundTag tag)
      Overrides:
      writeCustomDataToTag in class AnimalEntity
    • readCustomDataFromTag

      public void readCustomDataFromTag​(CompoundTag tag)
      Overrides:
      readCustomDataFromTag in class AnimalEntity
    • canBreedWith

      public boolean canBreedWith​(AnimalEntity other)
      Overrides:
      canBreedWith in class AnimalEntity
    • canBreed

      protected boolean canBreed()
    • createChild

      @Nullable public PassiveEntity createChild​(ServerWorld world, PassiveEntity entity)
      Specified by:
      createChild in class PassiveEntity
    • setChildAttributes

      protected void setChildAttributes​(PassiveEntity mate, HorseBaseEntity child)
    • canBeControlledByRider

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

      @Environment(CLIENT) public float getEatingGrassAnimationProgress​(float tickDelta)
    • getAngryAnimationProgress

      @Environment(CLIENT) public float getAngryAnimationProgress​(float tickDelta)
    • getEatingAnimationProgress

      @Environment(CLIENT) public float getEatingAnimationProgress​(float tickDelta)
    • setJumpStrength

      @Environment(CLIENT) public void setJumpStrength​(int strength)
      Specified by:
      setJumpStrength in interface JumpingMount
    • canJump

      public boolean canJump()
      Specified by:
      canJump in interface JumpingMount
    • startJumping

      public void startJumping​(int height)
      Specified by:
      startJumping in interface JumpingMount
    • stopJumping

      public void stopJumping()
      Specified by:
      stopJumping in interface JumpingMount
    • spawnPlayerReactionParticles

      @Environment(CLIENT) protected void spawnPlayerReactionParticles​(boolean positive)
    • handleStatus

      @Environment(CLIENT) public void handleStatus​(byte status)
      Overrides:
      handleStatus in class AnimalEntity
    • updatePassengerPosition

      public void updatePassengerPosition​(Entity passenger)
      Overrides:
      updatePassengerPosition in class Entity
    • getChildHealthBonus

      protected float getChildHealthBonus()
    • getChildJumpStrengthBonus

      protected double getChildJumpStrengthBonus()
    • getChildMovementSpeedBonus

      protected double getChildMovementSpeedBonus()
    • isClimbing

      public boolean isClimbing()
      Overrides:
      isClimbing in class LivingEntity
    • getActiveEyeHeight

      protected float getActiveEyeHeight​(EntityPose pose, EntityDimensions dimensions)
      Overrides:
      getActiveEyeHeight in class LivingEntity
    • hasArmorSlot

      public boolean hasArmorSlot()
      Whether this horse has a slot for custom equipment besides a saddle.

      In the item slot argument type, the slot is referred to as horse.armor. In this horse's screen, it appears in the middle of the left side, and right below the saddle slot if this horse has a saddle slot.

      This is used by horse armors and llama carpets, but can be refitted to any purpose.

    • hasArmorInSlot

      public boolean hasArmorInSlot()
      Whether this horse already has an item stack in its horse armor slot.
      See Also:
      hasArmorSlot()
    • isHorseArmor

      public boolean isHorseArmor​(ItemStack item)
      Whether the given item stack is valid for this horse's armor slot.
      See Also:
      hasArmorSlot()
    • equip

      public boolean equip​(int slot, ItemStack item)
      Overrides:
      equip in class MobEntity
    • getPrimaryPassenger

      @Nullable public Entity getPrimaryPassenger()
      Overrides:
      getPrimaryPassenger in class Entity
    • method_27930

      @Nullable private Vec3d method_27930​(Vec3d vec3d, LivingEntity livingEntity)
    • updatePassengerForDismount

      public Vec3d updatePassengerForDismount​(LivingEntity passenger)
      Overrides:
      updatePassengerForDismount in class Entity
    • initAttributes

      protected void initAttributes()
    • initialize

      @Nullable public EntityData initialize​(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)
      Overrides:
      initialize in class PassiveEntity