Interface PetEquipment
PetVisualSyncer after each spawn.
Not all slots are valid for every pet type — horses use BODY/SADDLE,
zombies use the full humanoid set. Implementations override
getAllowedSlotNames() to declare which slots are available.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanUseSlot(EquipmentSlot slot) Checks if this pet type can use the given equipment slot.voidDrops all equipment as world items at the pet's location.Returns the set of equipment slot names this pet type can use.Returns all currently equipped items, indexed by slot ordinal.getEquipment(EquipmentSlot slot) Returns the item in the given slot, ornullif empty.default booleanWhether MyPet owns this pet's main hand outright: every item, gear or not, is equipped there by the sneak right-click, and the mob's own hand interaction (the allay's take-an-item / give-it-back on a plain right-click) and its item pickup are suppressed on pets.default booleanWhentrue(the default), a wild mob tamed with a lead keeps whatever armor and weapons it was wearing, and that gear becomes real MyPet equipment — readable throughgetEquipment(EquipmentSlot)and dropped bydropEquipment()on death and release.voidsetEquipment(EquipmentSlot slot, ItemStack item) Equips an item in the given slot (persisted across despawns).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
-
getEquipment
ItemStack[] getEquipment()Returns all currently equipped items, indexed by slot ordinal.- Returns:
- every equipped item, indexed by slot
-
getEquipment
Returns the item in the given slot, ornullif empty.- Parameters:
slot- the slot to read- Returns:
- the item in that slot, or
nullwhen empty
-
setEquipment
Equips an item in the given slot (persisted across despawns).- Parameters:
slot- the slot to fillitem- the item to place, ornullto clear
-
dropEquipment
void dropEquipment()Drops all equipment as world items at the pet's location. -
getAllowedSlotNames
Returns the set of equipment slot names this pet type can use. Uses string names instead of EquipmentSlot enum values for version compatibility, since SADDLE and BODY slots don't exist in older Bukkit versions.- Returns:
- set of slot names (e.g., "HAND", "OFF_HAND", "HEAD", "CHEST", "LEGS", "FEET", "SADDLE", "BODY")
-
canUseSlot
Checks if this pet type can use the given equipment slot.- Parameters:
slot- the equipment slot to check- Returns:
- true if the pet can equip items in this slot
-
holdsAnyItem
default boolean holdsAnyItem()Whether MyPet owns this pet's main hand outright: every item, gear or not, is equipped there by the sneak right-click, and the mob's own hand interaction (the allay's take-an-item / give-it-back on a plain right-click) and its item pickup are suppressed on pets.false(the default) keeps the gear-only rule: only items with an equipment slot or durability are equipped, and anything else falls through to vanilla. The allay is the one species whose vanilla hand holds any item, and letting vanilla fill it beside MyPet's own equipment store meant a sneak-equip silently overwrote a vanilla-held item while shears could not strip it.- Returns:
trueif this pet's hand holds any item and vanilla never touches it
-
retainEquipmentOnTame
default boolean retainEquipmentOnTame()Whentrue(the default), a wild mob tamed with a lead keeps whatever armor and weapons it was wearing, and that gear becomes real MyPet equipment — readable throughgetEquipment(EquipmentSlot)and dropped bydropEquipment()on death and release. Whenfalse, the allowed slots are stripped at tame time and the items drop at the mob's location.Only the slots in
getAllowedSlotNames()are affected, vanilla per-slot drop chances are ignored, and pets created by other plugins (source-driven adoptions) are not covered — the flag applies to leash taming only.Reads
MyPet.Pets.<Type>.RetainEquipmentOnTame(defaulttrue), registered for everyPetEquipmenttype inConfigurationLoader.- Returns:
trueif the mob keeps what it was wearing when tamed
-