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 class
static final record
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionangularFriction
(E pEntity) default boolean
default boolean
canHaveALeashAttachedTo
(Entity pEntity) default boolean
checkElasticInteractions
(Entity pEntity, Leashable.LeashData pLeashData) default void
closeRangeLeashBehaviour
(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 void
dropLeash
(E pEntity, boolean pBroadcastPacket, boolean pDropItem) private static Vec3
getHolderMovement
(Entity pHolder) default Entity
getLeashHolder
(E pEntity) default Vec3
default Vec3
getLeashOffset
(float pPartialTick) default Vec3[]
default boolean
leashableInArea
(Entity pEntity, Predicate<Leashable> pPredicate) leashableInArea
(Level pLevel, Vec3 pPos, Predicate<Leashable> pPredicate) leashableLeashedTo
(Entity pEntity) default double
leashDistanceTo
(Entity pEntity) default double
default double
default void
default boolean
default void
default void
default void
readLeashData
(ValueInput pInput) default void
restoreLeashFromSave
(E pEntity, Leashable.LeashData pLeashData) default void
setDelayedLeashHolderId
(int pDelayedLeashHolderId) void
setLeashData
(Leashable.LeashData pLeashData) setLeashedTo
(E pEntity, Entity pLeashHolder, boolean pBroadcastPacket) default void
setLeashedTo
(Entity pLeashHolder, boolean pBroadcastPacket) default boolean
tickLeash
(ServerLevel pLevel, E pEntity) default void
whenLeashedTo
(Entity pEntity) default void
writeLeashData
(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
-