mojira.dev
MC-36941

Custom "Damage" tag fails to work / randomize anyway when items with durability are dropped

The code below is supposed to spawn a powered Creeper, then Zombies holding 2 pieces of Lapis-Lazuli, geared with 10 pumpkin helmets at once facing to their right, a highly damaged leather tunic and undamaged leather boots and leather pants :

setblock ~ ~ ~ minecraft:mob_spawner 0 replace {
EntityId:Creeper,
SpawnData:{powered:1},
SpawnPotentials:[
    {Type:Zombie,Weight:1,Properties:{
        Equipment:[
        {id:351,Count:2,Damage:4},
        {id:301,Count:1,Damage:0},
        {id:300,Count:1,Damage:0},
        {id:299,Count:1,Damage:76},
        {id:86,Count:10,Damage:1}
        ],
        DropChances:[1.0f,1.0f,1.0f,1.0f,1.0f],
        CanPickUpLoot:0,
	PersistenceRequired:1
    }}
],
Delay:0,
SpawnCount:1,
RequiredPlayerRange:16,
SpawnRange:6,
MaxNearbyEntities:1,
MinSpawnDelay:0,
MaxSpawnDelay:1
}

DropChances is set to force these Zombies to drop all their gear when killed.

However, when killed, even by drowning or any other mean that doesn't affect the durbility of the armor, here is what I got :
_some Rotten Flesh (as expected)
_10 pumpkins with unusual data value (as expected)
_2 pieces of Lapis-Lazuli (as expected)
_Moderately damaged Leather Boots, Leather Pants and Leather Tunic (I expected untouched boots and pants and nearly worn out tunic. Please note that the dropped Leather Tunic is actually less damaged than expected)

Note : the damage on this pieces of dropped armor seems to be often the same but not always. May be related to MC-36927

Comments 5

Intended. Those mobs USE the items.

OK. Fair enough.
I edited the code so it will gear them up with a nearly worn out leather tunic instead (like this one : /give @p 199 1 76) and guess what ? The dropped tunic is actually less damaged than it should be. Your argument is invalid 😛

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

This is intentional. DropChances at 1.0 or lower will randomize the durability. If the DropChances value is greater than 1.0, the durability will be what it has been set to. This is used for when mobs pick up player items, so the players aren't getting random durability damage to their items when they reobtain their stuff.

So changing the value to 1.1f will work.

Yup. This did work, Skylinerw. Thank you very much. You can close this issue, moderators 🙂

Missingno_26

(Unassigned)

Unconfirmed

Minecraft 1.7.1, Minecraft 1.7.2

Retrieved