Package net.minecraft.world.entity
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
-
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 entity, Leashable.LeashData leashData) default voidcloseRangeLeashBehaviour(Entity entity) private static Optional<Leashable.Wrench> computeDampenedSpringInteraction(Vec3 entityAttachmentPoint, Vec3 leasherAttachmentPoint, double elasticDistance, Vec3 knownMovement, Vec3 relativeAttachmentPoint) private static <E extends Entity & Leashable>
List<Leashable.Wrench> computeElasticInteraction(E entity, Entity leashHolder, List<Vec3> entityAttachmentPoint, List<Vec3> leasherAttachmentPoint) static Vec3[]createQuadLeashOffsets(Entity entity, double zOffset, double z, double x, double y) default voiddropLeash(E entity, boolean broadcastPacket, boolean dropItem) private static Vec3getHolderMovement(Entity holder) default EntitygetLeashHolder(E entity) default Vec3default Vec3getLeashOffset(float partialTick) default Vec3[]default booleanleashableInArea(Entity entity, Predicate<Leashable> predicate) leashableInArea(Level level, Vec3 pos, Predicate<Leashable> predicate) 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 delayedLeashHolderId) voidsetLeashData(Leashable.LeashData leashData) setLeashedTo(E entity, Entity leashHolder, boolean broadcastPacket) default voidsetLeashedTo(Entity leashHolder, boolean broadcastPacket) default booleantickLeash(ServerLevel level, E entity) default voidwhenLeashedTo(Entity entity) default voidwriteLeashData(ValueOutput output, 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
-
setLeashData
-
isLeashed
default boolean isLeashed() -
mayBeLeashed
default boolean mayBeLeashed() -
canHaveALeashAttachedTo
-
leashDistanceTo
-
canBeLeashed
default boolean canBeLeashed() -
setDelayedLeashHolderId
default void setDelayedLeashHolderId(int delayedLeashHolderId) -
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
-