[MC-4232] SpawnPotentials list working incorrectly Created: 08/Dec/12  Updated: 06/Sep/15  Resolved: 05/Feb/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.5
Fix Version/s: Snapshot 13w05a

Type: Bug
Reporter: Elf Elf Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: mob, spawner
Environment:

Windows 7 Ultimate


Confirmation Status: Unconfirmed

 Description   

The new SpawnPotentials list works about 90% correctly. Mob Spawners with a SpawnPotentials list will properly cycle through the mob types in the list (as can be seen by the mob being displayed in the cage), but are spawned with the wrong EntityId. The spawner's base EntityId tag is used to spawn the entities in the list, instead of the provided Type variable. When saving and closing Minecraft, the current EntityId (depending on which one it is on in the cycle) gets saved to the map data, and is used for spawning new mobs when the map is reloaded. Below is the NBT structure of the spawner I have tested this with:

TAG_Compound({
  "MinSpawnDelay": TAG_Short(20),
  "MaxSpawnDelay": TAG_Short(80),
  "SpawnCount": TAG_Short(4),
  "id": TAG_String(u'MobSpawner'),
  "RequiredPlayerRange": TAG_Short(16),
  "Delay": TAG_Short(21),
  "MaxNearbyEntities": TAG_Short(6),
  "SpawnRange": TAG_Short(4),
  "SpawnPotentials": TAG_List([
    TAG_Compound({
      "Weight": TAG_Int(50),
      "Type": TAG_String(u'Skeleton'),
      "Properties": TAG_Compound({
        "HurtTime": TAG_Short(0),
        "IsVillager": TAG_Byte(0),
        "Air": TAG_Short(300),
        "CanPickUpLoot": TAG_Byte(0),
        "AttackTime": TAG_Short(0),
        "IsBaby": TAG_Byte(0),
        "PersistenceRequired": TAG_Byte(0),
        "Fire": TAG_Short(-1),
        "FallDistance": TAG_Float(0.0),
        "Invulnerable": TAG_Byte(0),
        "EntityId": TAG_String(u'Skeleton'),
      }),
    }),
    TAG_Compound({
      "Weight": TAG_Int(50),
      "Type": TAG_String(u'PigZombie'),
      "Properties": TAG_Compound({
        "DropChances": TAG_List([
          TAG_Float(1.0),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
        ]),
        "Equipment": TAG_List([
          TAG_Compound({
            "id": TAG_Short(276),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "ench": TAG_List([
                TAG_Compound({
                  "id": TAG_Short(16),
                  "lvl": TAG_Short(5),
                }),
              ]),
              "display": TAG_Compound({
                "Name": TAG_String(u'\xa7rRipper'),
                "Lore": TAG_List([
                  TAG_String(u'Of the Jack variety'),
                ]),
              }),
            }),
          }),
          TAG_Compound({
            "id": TAG_Short(301),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "display": TAG_Compound({
                "color": TAG_Int(16776960),
              }),
            }),
          }),
          TAG_Compound({
            "id": TAG_Short(300),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "display": TAG_Compound({
                "color": TAG_Int(255),
              }),
            }),
          }),
          TAG_Compound({}),
          TAG_Compound({}),
        ]),
        "HurtTime": TAG_Short(0),
        "IsVillager": TAG_Byte(0),
        "Air": TAG_Short(300),
        "CanPickUpLoot": TAG_Byte(0),
        "AttackTime": TAG_Short(0),
        "IsBaby": TAG_Byte(0),
        "PersistenceRequired": TAG_Byte(0),
        "Fire": TAG_Short(-1),
        "FallDistance": TAG_Float(0.0),
        "Invulnerable": TAG_Byte(0),
        "EntityId": TAG_String(u'PigZombie'),
      }),
    }),
    TAG_Compound({
      "Weight": TAG_Int(50),
      "Type": TAG_String(u'Zombie'),
      "Properties": TAG_Compound({
        "DropChances": TAG_List([
          TAG_Float(1.0),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
          TAG_Float(0.05000000074505806),
        ]),
        "Equipment": TAG_List([
          TAG_Compound({
            "id": TAG_Short(279),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "ench": TAG_List([
                TAG_Compound({
                  "id": TAG_Short(16),
                  "lvl": TAG_Short(5),
                }),
              ]),
              "display": TAG_Compound({
                "Name": TAG_String(u'\xa7rRipper'),
                "Lore": TAG_List([
                  TAG_String(u'Of the Jack variety'),
                ]),
              }),
            }),
          }),
          TAG_Compound({
            "id": TAG_Short(301),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "display": TAG_Compound({
                "color": TAG_Int(16776960),
              }),
            }),
          }),
          TAG_Compound({}),
          TAG_Compound({}),
          TAG_Compound({
            "id": TAG_Short(298),
            "Damage": TAG_Short(0),
            "Count": TAG_Byte(1),
            "tag": TAG_Compound({
              "display": TAG_Compound({
                "color": TAG_Int(16711680),
              }),
            }),
          }),
        ]),
        "HurtTime": TAG_Short(0),
        "IsVillager": TAG_Byte(1),
        "Air": TAG_Short(300),
        "CanPickUpLoot": TAG_Byte(0),
        "AttackTime": TAG_Short(0),
        "IsBaby": TAG_Byte(1),
        "PersistenceRequired": TAG_Byte(0),
        "Fire": TAG_Short(-1),
        "FallDistance": TAG_Float(0.0),
        "Invulnerable": TAG_Byte(0),
        "EntityId": TAG_String(u'Zombie'),
      }),
    }),
  ]),
  "EntityId": TAG_String(u'Zombie'),
  "x": TAG_Int(44),
  "y": TAG_Int(10),
  "z": TAG_Int(-210),
})


 Comments   
Comment by Tails [ 05/Feb/13 ]

Thanks for the update

Comment by Elf Elf [ 05/Feb/13 ]

It was corrected the same night I told Dinnerbone about it on Twitter; this bug report was submitted at his request. As it's fixed, this report should be resolved.

Comment by Tails [ 05/Feb/13 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Kumasasa [ 08/Dec/12 ]

A "code" tag helps here

Comment by Dean Baset [ 08/Dec/12 ]

Please put the code on pastebin. Kinda hard to read the NBT tags without the spaces/tabs working properly

Generated at Sun Jan 12 12:03:53 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.