Package de.Keyle.MyPet.api.entity
Interface PetInteractionGate
Marker for pet types whose underlying vanilla mob has a per-tick item-driven
right-click interaction (cow + bucket → milk, sheep and shears → wool, etc.).
In v4 pets are real vanilla mobs, so these interactions happen for free on
every tame pet. Implementers expose two pieces of metadata that
PetInteractionGateListener uses to decide whether to cancel the
upstream PlayerInteractEntityEvent (which short-circuits vanilla's
interaction handler before it can run):
gatedInteractionItems()— the set ofMaterials in the player's hand that trigger this pet's gated interaction. Most pets gate one material; some (e.g., mooshroom: bowl and shears) may eventually gate two.isInteractionSuppressed()— reads the implementer's own per-pet config flag (e.g.PetCow.CAN_GIVE_MILK). Returnstruewhen the admin has disabled the interaction.
Per-pet flag names stay semantically rich (CanGiveMilk,
CanBeSheared, CanGiveStew) because each implementer reads
its own ConfigKey static field. The listener never names them.
Mirrors PetNaturalDrop for the drop-event family.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
Modifier and TypeMethodDescriptionThe set of held-item materials that trigger this pet's gated vanilla interaction (e.g.booleanReturnstrueif the admin has disabled this pet type's vanilla interaction via the per-type config flag.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
-
gatedInteractionItems
The set of held-item materials that trigger this pet's gated vanilla interaction (e.g.BUCKETfor cow milking,SHEARSfor sheep shearing).- Returns:
- the items that trigger the vanilla interaction
-
isInteractionSuppressed
boolean isInteractionSuppressed()Returnstrueif the admin has disabled this pet type's vanilla interaction via the per-type config flag.- Returns:
trueif the interaction is currently blocked
-