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

Only if Health is provided maxHealth attribute is used as maximum Health value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 15w49b, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      When you summon a mob only with a given value for the generic.maxHealth attribute the value for the Health tag is the default health value of this mob which can be higher than the value of the attribute generic.maxHealth. If you however provide the Health tag, the attribute value is used as maximum value.

      How to reproduce

      1. Use the following command
        /summon Wolf ~ ~ ~ {Attributes:[{Name:"generic.maxHealth",Base:0.1d}]}
        
      2. Inspect the NBT data, you will see that its Health value is the default 8f
      3. Use the following code
        Health provided
        /summon Wolf ~ ~ ~ {Attributes:[{Name:"generic.maxHealth",Base:0.1d}],Health:8f}
        
      4. Inspect the NBT data, you will see that its Health value is now the value of the generic.maxHealth attribute.

      Wrong maxHealth value is used

      Based on Skylinerw's comment on MC-93830 it also appears that the game is not using the value for the generic.maxHealth attribute the mob has at the end.

      The following command will cause Health to be set to the maximum value defined by the generic.maxHealth attribute in the command, however the game overrides this value with the default 20d. This means the Health value of 2f would have been valid.

      /summon Wolf ~ ~1 ~ {OwnerUUID:"00000000-0000-0000-0000-000000000000",Attributes:[{Name:"generic.maxHealth",Base:0.1d}],Health:2f}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                marcono1234 [Mod] Marcono1234
              • Votes:
                3 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: