Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-93255

Using "generic.maxHealth" attribute doesn't add health properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 15w47c
    • None
    • Windows 7
    • Unconfirmed

      I am trying to create an armor set that gives the player extra health, the more armor they have equipped. However, it is not adding up the attributes properly.

      If 1 piece of armor gives +2 to health (1 heart), and another piece of armor gives +10 (5 hearts), that should be a total of +12 to health (6 hearts). However, it only takes the highest attribute, which is +10, and nothing more. What's more annoying, is when you remove a piece of this custom armor, it doesn't matter which, it removes all armor and extra health.

      I don't remember which version of Minecraft specifically, but I remember when giving a custom attribute to armor, like that, actually added all the attributes together, and would give me the full +12 health.

      Duplicating this is quite simple:

      1. You need to be in creative Mode
      2. give yourself a command block, and place two of them down.

      3. In one of the command blocks, use this code:

      /give @p minecraft:leather_leggings 1 0 {AttributeModifiers:[

      {AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:2,Operation:0,UUIDLeast:777399,UUIDMost:33681,Slot:"legs"}

      ,

      {AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:100,Operation:0,UUIDLeast:427736,UUIDMost:900539}

      ,

      {AttributeName:"generic.armor",Name:"generic.armor",Amount:5,Operation:0,UUIDLeast:879936,UUIDMost:188373}

      ],Unbreakable:1,ench:[

      {id:0,lvl:100}

      ,

      {id:1,lvl:100}

      ,

      {id:7,lvl:100}

      ],display:{color:0}}

      4. In the second command block use this code:

      /give @p minecraft:leather_helmet 1 0 {AttributeModifiers:[

      {AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:10,Operation:0,UUIDLeast:777399,UUIDMost:33681,Slot:"head"}

      ,

      {AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:100,Operation:0,UUIDLeast:427736,UUIDMost:900539}

      ,

      {AttributeName:"generic.armor",Name:"generic.armor",Amount:10,Operation:0,UUIDLeast:879936,UUIDMost:188373}

      ],Unbreakable:1,ench:[

      {id:0,lvl:100}

      ,

      {id:1,lvl:100}

      ,

      {id:5,lvl:100}

      ,

      {id:6,lvl:100}

      ],display:{color:0}}

      5. Power each command block to receive the two items.

      6. Go into survival, or adventure mode, and equip both pieces.

      You'll notice that the helmet has +10 armor, and +10 health. The leggings has +2 health, and +5 armor. A grand total of +15 armor, and +12 health.

      However, it goes to the attributes of the last piece you equipped. Equip the leggings last, you only have +5 armor, and +2 health. Equip the helmet last, and you'll have +10 armor, +10 health. Remove either piece, and you'll lose the bonus all together.

            Unassigned Unassigned
            night_sage matthew lewis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: