PetControl

public final class PetControl

The live state of one pet body: who owns it, whether it is told to stay, where it idles, and the timers taming and breeding run on. Owned by PetManager; the Mind behaviors read it every tick on the server thread, so nothing here needs synchronization.

Functions

Link copied to clipboard
public LivingEntity body()
Link copied to clipboard
public boolean canBreed()
Adults breed again once the cooldown on their record has run out.
Link copied to clipboard
public List<Player> drainContacts()
The players that touched the model since the last call, within CONTACT_TICKS, and are still online.
Link copied to clipboard
public Location home()
Link copied to clipboard
public boolean isBaby()
Link copied to clipboard
public boolean isInLove(long tick)
Link copied to clipboard
public boolean isOwnedBy(Player player)
Link copied to clipboard
public boolean isStaying()
Link copied to clipboard
public boolean isWild()
Link copied to clipboard
public String model()
Link copied to clipboard
Link copied to clipboard
public Optional<Player> owner()
The owner while they are online and alive in a world.
Link copied to clipboard
public double ownerDistance(LivingEntity body)
Distance to the owner, or infinity when the owner is away or in another world.
Link copied to clipboard
public UUID ownerId()
The owning player's id, or null for a wild pet.
Link copied to clipboard
public PetRecord record()
The collection entry behind an owned pet; null for a wild one.
Link copied to clipboard
public void recordContact(Player player)
A player's touch reached this wild pet's model.
Link copied to clipboard
The migration this wild pet is flying, or null.
Link copied to clipboard
public void setStay(boolean stay, Location at)
Link copied to clipboard
Link copied to clipboard
public Location stayAnchor()