Interface Equipable
- All Known Subinterfaces:
Aerial
,Ageable
,Agent
,Ambient
,Animal
,Aquatic
,ArmorEquipable
,ArmorStand
,Axolotl
,Bat
,Bee
,Blaze
,Boss
,Cat
,CaveSpider
,Chicken
,ClientPlayer
,Cod
,Cow
,Creature
,Creeper
,Dolphin
,Donkey
,Drowned
,ElderGuardian
,EnderDragon
,Enderman
,Endermite
,Evoker
,Fish
,Fox
,Ghast
,Giant
,GlowSquid
,Goat
,Golem
,Guardian
,Hoglin
,Horse
,HorseLike
,Hostile
,Human
,Humanoid
,Husk
,Illager
,Illusioner
,IronGolem
,Llama
,LlamaLike
,LocalPlayer
,MagmaCube
,Monster
,Mooshroom
,Mule
,Ocelot
,PackHorse
,Panda
,Parrot
,Patroller
,Phantom
,Pig
,Piglin
,PiglinBrute
,PiglinLike
,Pillager
,Player
,PolarBear
,Pufferfish
,Rabbit
,Raider
,Ranger
,Ravager
,RemotePlayer
,Salmon
,SchoolingFish
,ServerPlayer
,Sheep
,Shulker
,Silverfish
,Skeleton
,SkeletonHorse
,SkeletonLike
,Slime
,SnowGolem
,Spellcaster
,Spider
,Squid
,Stray
,Strider
,TameableAnimal
,TameableHorse
,Trader
,TraderLlama
,TropicalFish
,Turtle
,User
,Vex
,Villager
,Vindicator
,WanderingTrader
,Witch
,Wither
,WitherSkeleton
,Wolf
,Zoglin
,Zombie
,ZombieHorse
,ZombieLike
,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, ItemStack equipment) boolean
canEquip
(EquipmentType type) Gets whether thisEquipable
can equip equipment of the specified type (eg.boolean
canEquip
(EquipmentType type, ItemStack equipment) Gets whether thisEquipable
can equip the supplied equipment in its slot of the specified type (eg.default boolean
equip
(Supplier<? extends EquipmentType> type, ItemStack equipment) boolean
equip
(EquipmentType type, ItemStack 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.ItemStack)
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.ItemStack)
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
-