Interface PetBaby

All Superinterfaces:
Pet, Scheduler, StoredPet

public interface PetBaby extends Pet
Marker for pet types that have a baby/adult form. For Ageable mobs (animals, zombies, piglins, etc.), the visual syncer uses vanilla setAdult()/setBaby(). For other mobs without native baby state (e.g. Wither), PetBabyAppearance persists a mypet:baby marker and shrinks the mob via the minecraft:scale attribute by @DefaultInfo#babyScale().

Also gates UI features: pets implementing this marker appear in the "babies" section of ShopInfo-driven shops, and the DefaultInfo.growUpItem() interaction is only offered to types that implement this interface.

  • Method Details

    • isBaby

      boolean isBaby()
      Returns true if this pet is currently in its baby form.
      Returns:
      true if this pet is currently a baby
    • setBaby

      void setBaby(boolean flag)
      Sets the baby/adult state. For Ageable mobs, the visual syncer pushes this to the Bukkit entity's setAdult()/setBaby(). For other mobs, the state is persisted as a mypet:baby marker and enforced via the minecraft:scale attribute.
      Parameters:
      flag - true to make the pet a baby
    • preventNaturalGrowup

      default boolean preventNaturalGrowup()
      When true (the default), this pet type's vanilla aging timer is locked so it never grows up on its own; the grow-up item still matures it. When false, the pet ages naturally like a vanilla mob. An owner's per-pet golden-dandelion override (if set) takes precedence over this. Reads MyPet.Pets.<Type>.PreventNaturalGrowup (default true), registered for every PetBaby type in ConfigurationLoader.
      Returns:
      true if the pet should stay a baby on its own