1.21.9/10: Mannequin equipment not working

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • This server is running CraftBukkit version 4541-Spigot-6e369ba-aa5381f (MC: 1.21.10) (Implementing API version 1.21.10-R0.1-SNAPSHOT)
    • Yes

      Code:

      @Nullable EntityEquipment entityEquipment = entity.getEquipment();
      if (entityEquipment == null) return;
      
      /* .. apply equipment via entityEquipment.setItem(slot, itemToSet); */ 

      Might be that we need to handle mannequin here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java#119

      Or just always return the underlying equipment of Minecraft's LivingEntity? I am not sure why Bukkit's LivingEntity.getEquipment is nullable in the first place (I don't think there is any LivingEntity subtype that does not return something for getEquipment, except for mannequin currently)

       

            Assignee:
            Unassigned
            Reporter:
            blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: