Interface Equipable

All Known Subinterfaces:
Agent, Allay, Ambient, Animal, Aquatic, Armadillo, ArmorEquipable, ArmorStand, Axolotl, Bat, Bee, Blaze, Bogged, Breeze, Camel, CamelHusk, Cat, CaveSpider, Chicken, ClientPlayer, Cod, CopperGolem, Cow, Creaking, Creeper, Dolphin, Donkey, Drowned, ElderGuardian, EnderDragon, Enderman, Endermite, Evoker, Fish, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, HappyGhast, Hoglin, Horse, HorseLike, Human, Humanoid, Husk, Illager, Illusioner, IronGolem, Llama, LocalPlayer, MagmaCube, Monster, Mooshroom, Mule, Nautilus, NautilusLike, Ocelot, PackHorse, Panda, Parched, 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, ZombieNautilus, ZombieVillager, ZombifiedPiglin

public interface Equipable
Represents the holder of a EquipmentInventory.
  • Method Details

    • equipment

      EquipmentInventory equipment()
      Returns the EquipmentInventory this is holding.
      Returns:
      The EquipmentInventory this is holding
    • canEquip

      boolean canEquip(EquipmentType type)
      Gets whether this Equipable can equip equipment of the specified type (eg. whether calling equip(EquipmentType, 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

      default boolean canEquip(Supplier<? extends EquipmentType> type)
    • canEquip

      boolean canEquip(EquipmentType type, ItemStackLike equipment)
      Gets whether this Equipable can equip the supplied equipment in its slot of the specified type (eg. whether calling equip(EquipmentType, ItemStackLike) with the specified slot type and item will succeed)
      Parameters:
      type - The type of equipment slot to query
      equipment - The equipment to check for
      Returns:
      true if can equip the supplied equipment
    • canEquip

      default boolean canEquip(Supplier<? extends EquipmentType> type, ItemStackLike equipment)
    • equipped

      Optional<ItemStack> equipped(EquipmentType type)
      Gets the item currently equipped by this Equipable in the specified slot.
      Parameters:
      type - The type of equipment slot to query
      Returns:
      The item in the equipped slot, if available
    • equipped

      default Optional<ItemStack> equipped(Supplier<? extends EquipmentType> type)
    • equip

      boolean equip(EquipmentType type, ItemStackLike equipment)
      Sets the item currently equipped by the Equipable in the specified slot, if the equipable has such a slot.
      Parameters:
      type - The type of equipment slot to set
      equipment - 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

      default boolean equip(Supplier<? extends EquipmentType> type, ItemStackLike equipment)