Interface Leashable
- All Known Implementing Classes:
AbstractBoat, AbstractChestBoat, AbstractChestedHorse, AbstractCow, AbstractFish, AbstractGolem, AbstractHorse, AbstractIllager, AbstractNautilus, AbstractPiglin, AbstractSchoolingFish, AbstractSkeleton, AbstractVillager, AgeableMob, AgeableWaterCreature, Allay, AmbientCreature, Animal, Armadillo, Axolotl, Bat, Bee, Blaze, Boat, Bogged, Breeze, Camel, CamelHusk, Cat, CaveSpider, ChestBoat, ChestRaft, Chicken, Cod, CopperGolem, 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, Nautilus, Ocelot, Panda, Parched, 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, ZombieNautilus, ZombieVillager, ZombifiedPiglin
public interface Leashable
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final record -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionangularFriction(E entity) default booleandefault booleancanHaveALeashAttachedTo(Entity entity) default booleancheckElasticInteractions(Entity leashHolder, Leashable.LeashData leashData) default voidcloseRangeLeashBehaviour(Entity leashHolder) private static Optional<Leashable.Wrench> computeDampenedSpringInteraction(Vec3 pivotPoint, Vec3 objectPosition, double springSlack, Vec3 objectMotion, Vec3 leverArm) private static <E extends Entity & Leashable>
List<Leashable.Wrench> computeElasticInteraction(E entity, Entity leashHolder, List<Vec3> entityAttachmentPoints, List<Vec3> leasherAttachmentPoints) static Vec3[]createQuadLeashOffsets(Entity entity, double frontOffset, double frontBack, double leftRight, double height) default voiddropLeash(E entity, boolean sendPacket, boolean dropLead) private static Vec3getHolderMovement(Entity leashHolder) @Nullable Leashable.LeashDatadefault @Nullable EntitygetLeashHolder(E entity) default Vec3default Vec3getLeashOffset(float partialTicks) default Vec3[]default booleanleashableInArea(Entity entity, Predicate<Leashable> test) leashableInArea(Level level, Vec3 pos, Predicate<Leashable> test) leashableLeashedTo(Entity entity) default doubleleashDistanceTo(Entity entity) default doubledefault doubledefault voiddefault booleandefault voiddefault voiddefault voidreadLeashData(ValueInput input) default voidrestoreLeashFromSave(E entity, Leashable.LeashData leashData) default voidsetDelayedLeashHolderId(int entityId) voidsetLeashData(@Nullable Leashable.LeashData leashData) setLeashedTo(E entity, Entity holder, boolean synch) default voidsetLeashedTo(Entity holder, boolean synch) default booleantickLeash(ServerLevel level, E entity) default voidwhenLeashedTo(Entity leashHolder) default voidwriteLeashData(ValueOutput output, @Nullable Leashable.LeashData leashData)
-
Field Details
-
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
-
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
-
LEASHER_ATTACHMENT_POINT
-
SHARED_QUAD_ATTACHMENT_POINTS
-
-
Method Details
-
getLeashData
@Nullable Leashable.LeashData getLeashData() -
setLeashData
-
isLeashed
default boolean isLeashed() -
mayBeLeashed
default boolean mayBeLeashed() -
canHaveALeashAttachedTo
-
leashDistanceTo
-
canBeLeashed
default boolean canBeLeashed() -
setDelayedLeashHolderId
default void setDelayedLeashHolderId(int entityId) -
readLeashData
-
writeLeashData
-
restoreLeashFromSave
private static <E extends Entity & Leashable> void restoreLeashFromSave(E entity, Leashable.LeashData leashData) -
dropLeash
default void dropLeash() -
removeLeash
default void removeLeash() -
onLeashRemoved
default void onLeashRemoved() -
dropLeash
-
tickLeash
-
onElasticLeashPull
default void onElasticLeashPull() -
leashSnapDistance
default double leashSnapDistance() -
leashElasticDistance
default double leashElasticDistance() -
angularFriction
-
whenLeashedTo
-
leashTooFarBehaviour
default void leashTooFarBehaviour() -
closeRangeLeashBehaviour
-
checkElasticInteractions
-
getHolderMovement
-
computeElasticInteraction
-
computeDampenedSpringInteraction
-
supportQuadLeash
default boolean supportQuadLeash() -
getQuadLeashOffsets
-
createQuadLeashOffsets
-
getLeashOffset
-
getLeashOffset
-
setLeashedTo
-
setLeashedTo
-
getLeashHolder
-
getLeashHolder
-
leashableLeashedTo
-
leashableInArea
-
leashableInArea
-