Package de.Keyle.MyPet.api.entity
Interface PetBaby
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
Modifier and TypeMethodDescriptionbooleanisBaby()Returnstrueif this pet is currently in its baby form.default booleanWhentrue(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.voidsetBaby(boolean flag) Sets the baby/adult state.Methods inherited from interface de.Keyle.MyPet.api.entity.Pet
autoAssignSkilltree, callToOwner, canMove, consumePendingSnapshot, createEntity, createEntity, decreaseSaturation, forgetTarget, getBukkitEntity, getCachedStatus, getDamage, getExperience, getLocation, getMaxHealth, getPetNavigation, getPetTarget, getRangedDamage, getSkills, getStatus, getTargetPriority, hasPetRider, hasTarget, hidePotionParticles, isHostAwaitingAdoption, isPassive, isSitting, makeSound, onInteract, onMeleeHitLanded, removeEntity, removePet, removePet, sendAway, setBukkitEntity, setExp, setHealth, setHostAwaitingAdoption, setLastUsed, setLocation, setMaxDistanceStep, setMinDistanceStep, setOwner, setPetName, setPetType, setRespawnTime, setSaturation, setSitting, setSkilltree, setSkilltree, setStatus, setTarget, setTarget, setUUID, setVolume, setWantsToRespawn, setWorldGroup, showPotionParticles, tickRespawnTimer, updateNameTag, updateVisualsMethods inherited from interface de.Keyle.MyPet.api.entity.StoredPet
getDisplayName, getExp, getHealth, getLastUsed, getLevel, getMaxDistanceStep, getMinDistanceStep, getOwner, getPetName, getPetType, getRespawnTime, getSaturation, getSkilltree, getUUID, getVolume, getWorldGroup, skillState, wantsToRespawn
-
Method Details
-
isBaby
boolean isBaby()Returnstrueif this pet is currently in its baby form.- Returns:
trueif this pet is currently a baby
-
setBaby
void setBaby(boolean flag) Sets the baby/adult state. ForAgeablemobs, the visual syncer pushes this to the Bukkit entity'ssetAdult()/setBaby(). For other mobs, the state is persisted as amypet:babymarker and enforced via theminecraft:scaleattribute.- Parameters:
flag-trueto make the pet a baby
-
preventNaturalGrowup
default boolean preventNaturalGrowup()Whentrue(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. Whenfalse, the pet ages naturally like a vanilla mob. An owner's per-pet golden-dandelion override (if set) takes precedence over this. ReadsMyPet.Pets.<Type>.PreventNaturalGrowup(defaulttrue), registered for everyPetBabytype inConfigurationLoader.- Returns:
trueif the pet should stay a baby on its own
-