public interface Equipable extends Identifiable, Carrier
Modifier and Type | Method and Description |
---|---|
boolean |
canEquip(EquipmentType type)
Gets whether this entity can equip equipment of the specified type (eg.
|
boolean |
canEquip(EquipmentType type,
ItemStack equipment)
Gets whether this entity can equip the supplied equipment in its slot of
the specified type (eg.
|
boolean |
equip(EquipmentType type,
ItemStack equipment)
Sets the item currently equipped by the entity in the specified slot, if
the entity has such a slot.
|
Optional<ItemStack> |
getEquipped(EquipmentType type)
Gets the item currently equipped by this entity in the specified slot.
|
getUniqueId
getInventory
boolean canEquip(EquipmentType type)
equip(org.spongepowered.api.item.inventory.equipment.EquipmentType, org.spongepowered.api.item.inventory.ItemStack)
will fail because the entity doesn't
have this type of slot.type
- The type of equipment slot to queryboolean canEquip(EquipmentType type, @Nullable ItemStack equipment)
equip(org.spongepowered.api.item.inventory.equipment.EquipmentType, org.spongepowered.api.item.inventory.ItemStack)
with the specified
slot type and item will succeed)type
- The type of equipment slot to queryequipment
- The equipment to check forOptional<ItemStack> getEquipped(EquipmentType type)
type
- The type of equipment slot to queryboolean equip(EquipmentType type, @Nullable ItemStack equipment)
Supplying null will unequip any currently equipped item.
type
- The type of equipment slot to setequipment
- The equipment to set or null to remove any equipped item