Package de.Keyle.MyPet.api.entity
Interface PetSunSensitive
Marker for pet types whose underlying vanilla mob combusts in direct
sunlight — the cohort whose Mojang counterpart returns
true from
Mob#isSunSensitive() (zombies, skeletons, and their variants) plus
Phantom (which has its own sunlight check on aiStep).
The preventDaylightBurn() default consults the per-pet
preference loaded from MyPet.Pets.<Type>.PreventDaylightBurn in
pet-config.yml. The YAML row is auto-registered for every type that
implements this marker — adding a new sun-sensitive pet only requires
implementing this interface. Wiring lives in PetSurvivalListener's
EntityCombustEvent arm: when the flag is true the natural
combust is canceled before the visible flame appears. This flag does not
gate block-caused combust (lava, magma) and entity-caused combust (flame arrows).
Husk, ZombifiedPiglin, and WitherSkeleton are deliberately omitted —
vanilla overrides isSunSensitive() to false for those
types, so the event never fires and the knob would be misleading.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether MyPet stops this pet burning in daylight.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
-
preventDaylightBurn
default boolean preventDaylightBurn()Whether MyPet stops this pet burning in daylight.- Returns:
trueto suppress sunlight burning
-