Interface Equipable
- All Known Subinterfaces:
Agent
,Allay
,Ambient
,Animal
,Aquatic
,Armadillo
,ArmorEquipable
,ArmorStand
,Axolotl
,Bat
,Bee
,Blaze
,Bogged
,Breeze
,Camel
,Cat
,CaveSpider
,Chicken
,ClientPlayer
,Cod
,Cow
,Creeper
,Dolphin
,Donkey
,Drowned
,ElderGuardian
,EnderDragon
,Enderman
,Endermite
,Evoker
,Fish
,Fox
,Frog
,Ghast
,Giant
,GlowSquid
,Goat
,Golem
,Guardian
,Hoglin
,Horse
,HorseLike
,Human
,Humanoid
,Husk
,Illager
,Illusioner
,IronGolem
,Llama
,LocalPlayer
,MagmaCube
,Monster
,Mooshroom
,Mule
,Ocelot
,PackHorse
,Panda
,Parrot
,PathfinderAgent
,Patroller
,Phantom
,Pig
,Piglin
,PiglinBrute
,PiglinLike
,Pillager
,Player
,PolarBear
,Pufferfish
,Rabbit
,Raider
,RangedAgent
,Ravager
,RemotePlayer
,Salmon
,SchoolingFish
,ServerPlayer
,Sheep
,Shulker
,Silverfish
,Skeleton
,SkeletonHorse
,SkeletonLike
,Slime
,Sniffer
,SnowGolem
,Spellcaster
,Spider
,Squid
,Stray
,Strider
,Tadpole
,TameableAnimal
,TraderLlama
,TropicalFish
,Turtle
,User
,Vex
,Villager
,VillagerLike
,Vindicator
,WanderingTrader
,Warden
,Witch
,Wither
,WitherSkeleton
,Wolf
,Zoglin
,Zombie
,ZombieHorse
,ZombieVillager
,ZombifiedPiglin
public interface Equipable
Represents the holder of a
EquipmentInventory
.-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canEquip
(Supplier<? extends EquipmentType> type) default boolean
canEquip
(Supplier<? extends EquipmentType> type, ItemStackLike equipment) boolean
canEquip
(EquipmentType type) Gets whether thisEquipable
can equip equipment of the specified type (eg.boolean
canEquip
(EquipmentType type, ItemStackLike equipment) Gets whether thisEquipable
can equip the supplied equipment in its slot of the specified type (eg.default boolean
equip
(Supplier<? extends EquipmentType> type, ItemStackLike equipment) boolean
equip
(EquipmentType type, ItemStackLike equipment) Sets the item currently equipped by theEquipable
in the specified slot, if the equipable has such a slot.Returns the EquipmentInventory this is holding.equipped
(Supplier<? extends EquipmentType> type) equipped
(EquipmentType type) Gets the item currently equipped by thisEquipable
in the specified slot.
-
Method Details
-
equipment
EquipmentInventory equipment()Returns the EquipmentInventory this is holding.- Returns:
- The EquipmentInventory this is holding
-
canEquip
Gets whether thisEquipable
can equip equipment of the specified type (eg. whether callingequip(org.spongepowered.api.item.inventory.equipment.EquipmentType, org.spongepowered.api.item.inventory.ItemStackLike)
will fail because the equipable doesn't have this type of slot.- Parameters:
type
- The type of equipment slot to query- Returns:
- true if this equipable can equip items of the specified type
-
canEquip
-
canEquip
Gets whether thisEquipable
can equip the supplied equipment in its slot of the specified type (eg. whether callingequip(org.spongepowered.api.item.inventory.equipment.EquipmentType, org.spongepowered.api.item.inventory.ItemStackLike)
with the specified slot type and item will succeed)- Parameters:
type
- The type of equipment slot to queryequipment
- The equipment to check for- Returns:
- true if can equip the supplied equipment
-
canEquip
-
equipped
Gets the item currently equipped by thisEquipable
in the specified slot.- Parameters:
type
- The type of equipment slot to query- Returns:
- The item in the equipped slot, if available
-
equipped
-
equip
Sets the item currently equipped by theEquipable
in the specified slot, if the equipable has such a slot.- Parameters:
type
- The type of equipment slot to setequipment
- The equipment to set the any equipped item- Returns:
- true if the item was successfully equipped, false if the item could not be equipped because the equipable doesn't support the specified equipment type or because the item was incompatible with the specified slot.
-
equip
-