Interface Leashable

All Known Implementing Classes:
AbstractBoat, AbstractChestBoat, AbstractChestedHorse, AbstractCow, AbstractFish, AbstractGolem, AbstractHorse, AbstractIllager, AbstractPiglin, AbstractSchoolingFish, AbstractSkeleton, AbstractVillager, AgeableMob, AgeableWaterCreature, Allay, AmbientCreature, Animal, Armadillo, Axolotl, Bat, Bee, Blaze, Boat, Bogged, Breeze, Camel, Cat, CaveSpider, ChestBoat, ChestRaft, Chicken, Cod, Cow, Creaking, Creeper, Dolphin, Donkey, Drowned, ElderGuardian, EnderDragon, EnderMan, Endermite, Evoker, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Guardian, HappyGhast, Hoglin, Horse, Husk, Illusioner, IronGolem, Llama, MagmaCube, Mob, Monster, Mule, MushroomCow, Ocelot, Panda, Parrot, PathfinderMob, PatrollingMonster, Phantom, Pig, Piglin, PiglinBrute, Pillager, PolarBear, Pufferfish, Rabbit, Raft, Raider, Ravager, Salmon, Sheep, ShoulderRidingEntity, Shulker, Silverfish, Skeleton, SkeletonHorse, Slime, Sniffer, SnowGolem, SpellcasterIllager, Spider, Squid, Stray, Strider, Tadpole, TamableAnimal, TraderLlama, TropicalFish, Turtle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterAnimal, Witch, WitherBoss, WitherSkeleton, Wolf, Zoglin, Zombie, ZombieHorse, ZombieVillager, ZombifiedPiglin

public interface Leashable
  • Field Details

    • LEASH_TAG

      static final String LEASH_TAG
      See Also:
    • LEASH_TOO_FAR_DIST

      static final double LEASH_TOO_FAR_DIST
      See Also:
    • LEASH_ELASTIC_DIST

      static final double LEASH_ELASTIC_DIST
      See Also:
    • MAXIMUM_ALLOWED_LEASHED_DIST

      static final double MAXIMUM_ALLOWED_LEASHED_DIST
      See Also:
    • AXIS_SPECIFIC_ELASTICITY

      static final Vec3 AXIS_SPECIFIC_ELASTICITY
    • SPRING_DAMPENING

      static final float SPRING_DAMPENING
      See Also:
    • TORSIONAL_ELASTICITY

      static final double TORSIONAL_ELASTICITY
      See Also:
    • STIFFNESS

      static final double STIFFNESS
      See Also:
    • ENTITY_ATTACHMENT_POINT

      static final List<Vec3> ENTITY_ATTACHMENT_POINT
    • LEASHER_ATTACHMENT_POINT

      static final List<Vec3> LEASHER_ATTACHMENT_POINT
    • SHARED_QUAD_ATTACHMENT_POINTS

      static final List<Vec3> SHARED_QUAD_ATTACHMENT_POINTS
  • Method Details

    • getLeashData

      @Nullable Leashable.LeashData getLeashData()
    • setLeashData

      void setLeashData(@Nullable Leashable.LeashData pLeashData)
    • isLeashed

      default boolean isLeashed()
    • mayBeLeashed

      default boolean mayBeLeashed()
    • canHaveALeashAttachedTo

      default boolean canHaveALeashAttachedTo(Entity pEntity)
    • leashDistanceTo

      default double leashDistanceTo(Entity pEntity)
    • canBeLeashed

      default boolean canBeLeashed()
    • setDelayedLeashHolderId

      default void setDelayedLeashHolderId(int pDelayedLeashHolderId)
    • readLeashData

      default void readLeashData(ValueInput pInput)
    • writeLeashData

      default void writeLeashData(ValueOutput pOutput, @Nullable Leashable.LeashData pLeashData)
    • restoreLeashFromSave

      private static <E extends Entity & Leashable> void restoreLeashFromSave(E pEntity, Leashable.LeashData pLeashData)
    • dropLeash

      default void dropLeash()
    • removeLeash

      default void removeLeash()
    • onLeashRemoved

      default void onLeashRemoved()
    • dropLeash

      private static <E extends Entity & Leashable> void dropLeash(E pEntity, boolean pBroadcastPacket, boolean pDropItem)
    • tickLeash

      static <E extends Entity & Leashable> void tickLeash(ServerLevel pLevel, E pEntity)
    • onElasticLeashPull

      default void onElasticLeashPull()
    • leashSnapDistance

      default double leashSnapDistance()
    • leashElasticDistance

      default double leashElasticDistance()
    • angularFriction

      static <E extends Entity & Leashable> float angularFriction(E pEntity)
    • whenLeashedTo

      default void whenLeashedTo(Entity pEntity)
    • leashTooFarBehaviour

      default void leashTooFarBehaviour()
    • closeRangeLeashBehaviour

      default void closeRangeLeashBehaviour(Entity pEntity)
    • checkElasticInteractions

      default boolean checkElasticInteractions(Entity pEntity, Leashable.LeashData pLeashData)
    • getHolderMovement

      private static Vec3 getHolderMovement(Entity pHolder)
    • computeElasticInteraction

      private static <E extends Entity & Leashable> List<Leashable.Wrench> computeElasticInteraction(E pEntity, Entity pLeashHolder, List<Vec3> pEntityAttachmentPoint, List<Vec3> pLeasherAttachmentPoint)
    • computeDampenedSpringInteraction

      private static Optional<Leashable.Wrench> computeDampenedSpringInteraction(Vec3 pEntityAttachmentPoint, Vec3 pLeasherAttachmentPoint, double pElasticDistance, Vec3 pKnownMovement, Vec3 pRelativeAttachmentPoint)
    • supportQuadLeash

      default boolean supportQuadLeash()
    • getQuadLeashOffsets

      default Vec3[] getQuadLeashOffsets()
    • createQuadLeashOffsets

      static Vec3[] createQuadLeashOffsets(Entity pEntity, double pZOffset, double pZ, double pX, double pY)
    • getLeashOffset

      default Vec3 getLeashOffset(float pPartialTick)
    • getLeashOffset

      default Vec3 getLeashOffset()
    • setLeashedTo

      default void setLeashedTo(Entity pLeashHolder, boolean pBroadcastPacket)
    • setLeashedTo

      private static <E extends Entity & Leashable> void setLeashedTo(E pEntity, Entity pLeashHolder, boolean pBroadcastPacket)
    • getLeashHolder

      @Nullable default Entity getLeashHolder()
    • getLeashHolder

      @Nullable private static <E extends Entity & Leashable> Entity getLeashHolder(E pEntity)
    • leashableLeashedTo

      static List<Leashable> leashableLeashedTo(Entity pEntity)
    • leashableInArea

      static List<Leashable> leashableInArea(Entity pEntity, Predicate<Leashable> pPredicate)
    • leashableInArea

      static List<Leashable> leashableInArea(Level pLevel, Vec3 pPos, Predicate<Leashable> pPredicate)