Custom mobs and normal Vexes drop equipped items with looting despite DropChances set to 0
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.
Other info:
- I did not notice this in the 1.4.3 PRE.
/summon bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass_block",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"white_wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}
/give @p minecraft:stick{Enchantments:[{id:sharpness,lvl:32767},{id:looting,lvl:32767}]}
Code analysis by Marcono1234 can be found in this comment.
As of 1.11, this affects Vex swords, since they have a HandDropChance of 0 on the mainhand.
Created Issue:
Custom mobs drop equipped items despite DropChances set to 0
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
- Unresolved
- Open
- Unconfirmed
- custom dropchances equipment mob spawners
- 1.4.4
is duplicated by
Custom mobs drop equipped items with looting despite DropChances set to 0
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
Code analysis by Marcono1234 in this comment
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
Code analysis
byMarcono1234 in thiscommentI'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
Code analysis by Marcono1234 can be found in this comment.
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
Code analysis by Marcono1234 can be found in this comment.
As of 1.11, this affects Vex swords, since they have a HandDropChance of 0 on the mainhand.
Custom mobs and normal Vexes drop equipped items with looting despite DropChances set to 0
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summonBat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @pstick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}
Code analysis by Marcono1234 can be found in this comment.
As of 1.11, this affects Vex swords, since they have a HandDropChance of 0 on the mainhand.
I'm playing around with custom spawners for a combat arena in an adventure map. I noticed that my mobs drop items they have equipped, even if their respective drop chance is set to 0.
I've added the schematics file for a mob spawner, of which the mobs are affected by this issue.
The mob spawned is a PigZombie wearing a pumpkin on its head and a torch with fire aspect 2 in its hand.
They also have a healing potion in their chest slot with dropchance 0.6, which can't be seen. All the other dropchances are 0.
Two potion effects have been applied: weakness and invisibility.
I've seen them drop the healing potions, as intended, but the enchanted torch as well.
I've seen them drop their pumpkin when I started messing around with the spawner, but not (yet?) in the version I've attached.Other info:
- I did not notice this in the 1.4.3 PRE.
Mob command/summon bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass_block",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"white_wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}Looting command/give @p minecraft:stick{Enchantments:[{id:sharpness,lvl:32767},{id:looting,lvl:32767}]}
Code analysis by Marcono1234 can be found in this comment.
As of 1.11, this affects Vex swords, since they have a HandDropChance of 0 on the mainhand.
relates to
It may happen with a looting enchantment :
this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]
par2 is the looting bonus coefficient, so the item can be drop.
If you want to be sure that the item wont spawn : set the drop chance to -2.
(The issue work as intended)
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.
No answer, assuming no longer an issue.
Confirmed for
/summon Bat ~ ~1 ~ {NoAI:1,Equipment:[{id:stone,Count:1},{id:dirt,Count:1},{id:grass,Count:1},{id:glass,Count:1},{id:wool,Count:1}],DropChances:[0f,0f,0f,0f,0f]} /give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}Confirmed for
Please add these commands
/summon Bat ~ ~1 ~ {NoAI:1b,ArmorItems:[{id:"stone",Count:1b},{id:"dirt",Count:1b},{id:"grass",Count:1b},{id:"glass",Count:1b}],HandItems:[{id:"wool",Count:1b},{}],ArmorDropChances:[0f,0f,0f,0f],HandDropChances:[0f,0f]}/give @p stick 1 0 {ench:[{id:16,lvl:32767},{id:21,lvl:32767}]}Confirmed for 1.9
Still in 1.9.1-pre1
Still in 1.9.1-pre3
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the method net.minecraft.entity.EntityLiving.dropEquipment(boolean, int) is only testing if this.rand.nextFloat() - (float)lootingModifier * 0.01F) < d0 (d0 being the drop chance). This means if the looting enchantment is 100 or higher, items will be dropped.
Edit: As said in
MC-114715this calculation defeats the purpose of really rare drops, for example 0.000001% suddenly becomes 1.000001%. It might be better to solve this by multiplying the randomly generated value.changed reported to Marcono1234 since the original reporter, Cat was no longer active
Still in 1.10
Still in 1.14.4, just had 2 swords drop from vexes.