Class TamableAnimal

All Implemented Interfaces:
CommandSource, SyncedDataHolder, Attackable, EquipmentUser, Leashable, OwnableEntity, Targeting, EntityAccess, Nameable, ScoreHolder, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, IForgeLivingEntity, INBTSerializable<CompoundTag>
Direct Known Subclasses:
Cat, ShoulderRidingEntity, Wolf

public abstract class TamableAnimal extends Animal implements OwnableEntity
  • Field Details

    • TELEPORT_WHEN_DISTANCE_IS_SQ

      public static final int TELEPORT_WHEN_DISTANCE_IS_SQ
      See Also:
    • MIN_HORIZONTAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING

      private static final int MIN_HORIZONTAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING
      See Also:
    • MAX_HORIZONTAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING

      private static final int MAX_HORIZONTAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING
      See Also:
    • MAX_VERTICAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING

      private static final int MAX_VERTICAL_DISTANCE_FROM_TARGET_AFTER_TELEPORTING
      See Also:
    • DATA_FLAGS_ID

      protected static final EntityDataAccessor<Byte> DATA_FLAGS_ID
    • DATA_OWNERUUID_ID

      protected static final EntityDataAccessor<Optional<UUID>> DATA_OWNERUUID_ID
    • orderedToSit

      private boolean orderedToSit
  • Constructor Details

  • Method Details

    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder p_329630_)
      Overrides:
      defineSynchedData in class AgeableMob
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag p_21819_)
      Overrides:
      addAdditionalSaveData in class Animal
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag p_21815_)
      Overrides:
      readAdditionalSaveData in class Animal
    • canBeLeashed

      public boolean canBeLeashed()
      Specified by:
      canBeLeashed in interface Leashable
      Overrides:
      canBeLeashed in class Mob
    • handleLeashAtDistance

      public boolean handleLeashAtDistance(Entity p_344718_, float p_344621_)
      Specified by:
      handleLeashAtDistance in interface Leashable
      Overrides:
      handleLeashAtDistance in class PathfinderMob
    • spawnTamingParticles

      protected void spawnTamingParticles(boolean p_21835_)
    • handleEntityEvent

      public void handleEntityEvent(byte p_21807_)
      Overrides:
      handleEntityEvent in class Animal
    • isTame

      public boolean isTame()
    • setTame

      public void setTame(boolean p_21836_, boolean p_332364_)
    • applyTamingSideEffects

      protected void applyTamingSideEffects()
    • isInSittingPose

      public boolean isInSittingPose()
    • setInSittingPose

      public void setInSittingPose(boolean p_21838_)
    • getOwnerUUID

      @Nullable public UUID getOwnerUUID()
      Specified by:
      getOwnerUUID in interface OwnableEntity
    • setOwnerUUID

      public void setOwnerUUID(@Nullable UUID p_21817_)
    • tame

      public void tame(Player p_21829_)
    • canAttack

      public boolean canAttack(LivingEntity p_21822_)
      Overrides:
      canAttack in class LivingEntity
    • isOwnedBy

      public boolean isOwnedBy(LivingEntity p_21831_)
    • wantsToAttack

      public boolean wantsToAttack(LivingEntity p_21810_, LivingEntity p_21811_)
    • getTeam

      public PlayerTeam getTeam()
      Overrides:
      getTeam in class Entity
    • isAlliedTo

      public boolean isAlliedTo(Entity p_21833_)
      Overrides:
      isAlliedTo in class Entity
    • die

      public void die(DamageSource p_21809_)
      Overrides:
      die in class LivingEntity
    • isOrderedToSit

      public boolean isOrderedToSit()
    • setOrderedToSit

      public void setOrderedToSit(boolean p_21840_)
    • tryToTeleportToOwner

      public void tryToTeleportToOwner()
    • shouldTryTeleportToOwner

      public boolean shouldTryTeleportToOwner()
    • teleportToAroundBlockPos

      private void teleportToAroundBlockPos(BlockPos p_342611_)
    • maybeTeleportTo

      private boolean maybeTeleportTo(int p_344380_, int p_344602_, int p_344979_)
    • canTeleportTo

      private boolean canTeleportTo(BlockPos p_342572_)
    • unableToMoveToOwner

      public final boolean unableToMoveToOwner()
    • canFlyToOwner

      protected boolean canFlyToOwner()