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 pEntity) default booleandefault booleancanHaveALeashAttachedTo(Entity pEntity) default booleancheckElasticInteractions(Entity pEntity, Leashable.LeashData pLeashData) default voidcloseRangeLeashBehaviour(Entity pEntity) private static Optional<Leashable.Wrench> computeDampenedSpringInteraction(Vec3 pEntityAttachmentPoint, Vec3 pLeasherAttachmentPoint, double pElasticDistance, Vec3 pKnownMovement, Vec3 pRelativeAttachmentPoint) private static <E extends Entity & Leashable>
List<Leashable.Wrench> computeElasticInteraction(E pEntity, Entity pLeashHolder, List<Vec3> pEntityAttachmentPoint, List<Vec3> pLeasherAttachmentPoint) static Vec3[]createQuadLeashOffsets(Entity pEntity, double pZOffset, double pZ, double pX, double pY) default voiddropLeash(E pEntity, boolean pBroadcastPacket, boolean pDropItem) private static Vec3getHolderMovement(Entity pHolder) default EntitygetLeashHolder(E pEntity) default Vec3default Vec3getLeashOffset(float pPartialTick) default Vec3[]default booleanleashableInArea(Entity pEntity, Predicate<Leashable> pPredicate) leashableInArea(Level pLevel, Vec3 pPos, Predicate<Leashable> pPredicate) leashableLeashedTo(Entity pEntity) default doubleleashDistanceTo(Entity pEntity) default doubledefault doubledefault voiddefault booleandefault voiddefault voiddefault voidreadLeashData(ValueInput pInput) default voidrestoreLeashFromSave(E pEntity, Leashable.LeashData pLeashData) default voidsetDelayedLeashHolderId(int pDelayedLeashHolderId) voidsetLeashData(Leashable.LeashData pLeashData) setLeashedTo(E pEntity, Entity pLeashHolder, boolean pBroadcastPacket) default voidsetLeashedTo(Entity pLeashHolder, boolean pBroadcastPacket) default booleantickLeash(ServerLevel pLevel, E pEntity) default voidwhenLeashedTo(Entity pEntity) default voidwriteLeashData(ValueOutput pOutput, Leashable.LeashData pLeashData)
-
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 pDelayedLeashHolderId) -
readLeashData
-
writeLeashData
-
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
-
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
-