Mobs lose Attribute Modifiers when the player ventures too far from them
When a mob is given a weapon, they inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers. However, when a player ventures too far from that mob, these modifiers are lost.
Steps to Reproduce:
- Give a zombie a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- When it attacks you, you should experience normal damage - on Normal difficulty, this will be 5 hearts.
- Move far away from this mob. Using "/tp ~0 ~150 ~0" and letting yourself fall (in Creative!) will distance you enough for this bug to occur.
- When you let the mob attack you again, it will deal only 1.5 hearts instead of the previous 5.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword but not bearing its effects. The zombie picked up this sword in-game, and I ventured too far from it. I have also attached a test world of zombies which have lost their Attribute Modifiers for the same reason.
Linked Issues
Created Issue:
Item Attributes are not Applied to Mobs - Even Vanilla Weapons don't work
When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
1. Give a zombie a diamond sword
2. Observe that, when it attacks you, it still does its ordinary damage.I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword and yet failing to inherit any effects.
- Unresolved
- Open
- Unconfirmed
- Armor Attribute Bug Item Mob Modifier Weapon
- 13w21a
is duplicated by
Item Attributes are not Applied to Mobs when they pick up the item ingame - Even Vanilla Weapons don't work
When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
1. Give a zombie a diamond sword
2. Observe that, when it attacks you, it still does its ordinary damage.I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword and yet failing to inherit any effects.
When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
- Give a zombie or zombie pigman a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- Observe that, when it attacks you, it still does its ordinary damage. For a zombie on Normal, this will be 1.5 hearts. On Minecraft 1.5.2, it will deal 5 hearts, the correct amount.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword and yet failing to inherit any effects.
When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
- Give a zombie or zombie pigman a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- Observe that, when it attacks you, it still does its ordinary damage. For a zombie on Normal, this will be 1.5 hearts. On Minecraft 1.5.2, it will deal 5 hearts, the correct amount.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword and yet failing to inherit any effects. The zombie picked up this sword in-game, rather than having it edited into its posession.
ItemAttributes are not Applied to Mobs when theypick up the item ingame - Even Vanilla Weapons don't workMobs lose Attribute Modifiers when the player ventures too far from them
When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
- Give a zombie
or zombie pigmana diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.Observe that, when it attacks you,it still does its ordinary damage. For a zombie on Normal, this will be 1.5 hearts. On Minecraft 1.5.2, itwilldeal5 hearts, the correct amount.I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword
and yet failing to inherit anyeffects. The zombie picked up this sword in-game,rather than having it edited into its posession.When a mob is given a weapon, they do not inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.
Steps to Reproduce:
- Give a zombie a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- When it attacks you, you should experience normal damage - on Normal difficulty, this will be 5 hearts.
- Move far away from this mob. Using "/tp ~0 ~150 ~0" and letting yourself fall (in Creative!) will distance you enough for this bug to occur.
- When you let the mob attack you again, it will deal only 1.5 hearts instead of the previous 5.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword but not bearing its effects. The zombie picked up this sword in-game, and I ventured too far from it. I have also attached a test world of zombies which have lost their Attribute Modifiers for the same reason.
When a mob is given a weapon, they
do notinherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers.Steps to Reproduce:
- Give a zombie a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- When it attacks you, you should experience normal damage - on Normal difficulty, this will be 5 hearts.
- Move far away from this mob. Using "/tp ~0 ~150 ~0" and letting yourself fall (in Creative!) will distance you enough for this bug to occur.
- When you let the mob attack you again, it will deal only 1.5 hearts instead of the previous 5.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword but not bearing its effects. The zombie picked up this sword in-game, and I ventured too far from it. I have also attached a test world of zombies which have lost their Attribute Modifiers for the same reason.
When a mob is given a weapon, they inherit the Attribute Modifiers on it. This includes the vanilla modifier for weapon strength, and any custom modifiers. However, when a player ventures too far from that mob, these modifiers are lost.
Steps to Reproduce:
- Give a zombie a diamond sword. You must have mobGriefing set to true, and must be playing in Normal or Hard mode.
- When it attacks you, you should experience normal damage - on Normal difficulty, this will be 5 hearts.
- Move far away from this mob. Using "/tp ~0 ~150 ~0" and letting yourself fall (in Creative!) will distance you enough for this bug to occur.
- When you let the mob attack you again, it will deal only 1.5 hearts instead of the previous 5.
I have attached a schematic of a bugged zombie, holding an AttributeModifier-laden sword but not bearing its effects. The zombie picked up this sword in-game, and I ventured too far from it. I have also attached a test world of zombies which have lost their Attribute Modifiers for the same reason.
duplicates
is duplicated by
Duplicate of MC-16279, please use the search function to see if your bug has already been submitted. Currently over 56% of tickets are being closed as duplicate.
This is a separate and unrelated bug. Attributes, Potion Effects, and Enchantments are all different things.
However, I cannot reproduce in 13w24b; the zombie sets the villager on fire even if the zombie has a helmet and is not burning.
MC-16279, on the other hand, was not fixed.
I can not confirm this in 13w21a and 13w21b. I did not laod your shematic, i modified some swords via mcedit and gave it to zombies. I added modifier for speed and damage. I can tell it is working by the speed of the zombie, but also by the damage the zombie is dealing. Operation:0 Amount:20 and u are a one hit kill. But i found out, that these modifiers sometimes losing their effect, so the zombie return to his normal speed and damage. I don´t know whats causing it, but re-entering the world is fixing it.
I gave a zombie pigman a +9001 damage weapon, he oneshotted me!
Same when I threw a +9004 wooden sword to a zombie.
Was not fun at all.
9001 damage is not a vanilla weapon.
I have given a zombie a diamond sword on 13w24b, and it is still only dealing 1.5 hearts of damage per hit. I have no mods, no armor, no Attribute Modifiers on myself, and no status effects. Note that I gave the item to the zombie in-game, without the use of any editors.
I'll attach a GIF and a testing world where this occurs. Perhaps the bug was fixed for non-vanilla modifiers, but a zombie with a diamond sword should not be dealing 1.5 hearts of damage to an unarmored player.
Sorry, my GIF may have broken the attachment renderer.
Anyways, I've attached a fully functional test world. All zombies in the test world have picked up their weapons. Observe that enchantments work, but Attribute Modifiers do not.
Despite each zombie wielding a diamond sword, they only do 1.5 hearts of damage per hit. This even applies when the modifier is +100 Attack Damage, with a unique UUID. Although the player can 1-hit-kill mobs with it, a zombie wielding the item does not make use of its damage boost.
This is still a problem in 13w24b.
Despite the JIRA renderer breaking, the attachments can still be accessed from the History tab.
Grum, can you provide a sample world as well? What mode were you on when throwing the item to your zombie? Was it Normal, like me, or Hard?
While you could argue that I may have done something wrong with the NBT for the custom items (it seems even if UUIDLeast is nonzero, UUIDMost must also be nonzero), there is no reason for a vanilla Minecraft, unmodified item, such as the leftmost diamond sword in the test world, to not work.
For clarification, the following was my exact procedure for creating all of those zombies:
Steps to Reproduce:
I downloaded the attached world, the zombie villager with overkill sword needed several strikes to take me down (I had no effects/armor). I then killed him, got his sword and used it against common mobs, they all died in 1 hit.
In short, the bug exists and works, confirmed here.
As i sad a few comments above, the System is working, but has a few bugs. If you give a Sword to a Zombie with speed and attack modifiier you will see it clearly. Most of the time the modifiers will work. Sometimes the modifiers are working, but will loose theyr effect at random times.
I attached a schematic of a Zombie spawner. The Zombie has a sword with speed and attack modifiers.
I created the spawner like so:
Can this please be re-opened? I'm getting it in 13w25a.
I'd like to repeat: I created a new world on the snapshot, and gave a zombie a diamond sword. I switched to survival. The zombie only did 1.5 hearts of damage per attack.
Unable to reproduce following exactly the steps. Zombie did 5 hearts of damage correctly.
CONFIRMED IN 13w25a using the following steps:
0. (Create a new world...)
1. Give a zombie a diamond sword.
2. Use the command /tp ~0 ~150 ~0. This will despawn all mobs except the one you gave the item to.
3. Change to survival mode
4. Observe damage dealt to be 1.5 hearts.
I did this bug on a freshly made superflat world.
Because some people couldn't reproduce this, I followed the same steps twice. The bug happened both times.
The difficulty was set to normal.
I would also like to point out that I did not use a zombie from a spawn egg or any mob spawner, the mob was spawned naturally at night time.
This is incredibly peculiar. I decided to just spawn a single zombie at a time, so I don't have to fly away and let them despawn. Now I can reproduce the correct behavior.
However, if I move too far away from a properly-functioning zombie, i.e. "/tp ~0 ~150 ~0" and fall, then the zombie will lose its attribute modifiers!
It seems as though attribute modifiers get untracked from mobs when a player ventures too far from a mob. This would be pretty devastating to adventure maps, honestly. I'll update the ticket info.
Tails, can you please see if your zombie, which deals 5 hearts correctly, becomes bugged if you do "/tp ~0 ~150 ~0" or anything else to get far away from it?
Ok after a while the zombie lost his attributes, so I believe this is the same issue as
MC-16467which is already assigned.Does the zombie lose its attributes simply as time passes? Because teleporting away from the mob and back has consistently gotten the bug to happen for me, without any meaningful amount of time passed. Attributes vanishing over time could be
MC-16467, but it seems distance can also cause Attribute loss.Also, can this please be marked "Confirmed", or at least "Community Consensus"? Thank you.
Step 3 isn`t really necessary, just wait like a minute and zombie loses the attributes.
However, it happens instantly if you teleport away from the mob and back - without time passing.
Teleporting away (tried even ~ 200 ~) did not work, however I determined that on avarage after 30 seconds attribute runs out.
Possibly related to
MC-16467, which I see Gerrard has commented may be related to this. Anyone have ideas on how to determine why this is happening? Are the attributes no longer present on the entity, or just no longer functional? Matthias's comment onMC-16467would suggest that the attributes are being saved, because they reactivate when reloading the world. So some random, regular event is recalculating the final stats inappropriately or overwriting them.I've managed to reproduce attributes vanishing over time and returning upon world reload. I've also reproduced an entity which did not lose its attributes even after I teleported away and back. I have no idea why it didn't happen before - perhaps the issue is just incredibly random.
I suppose
MC-16467is the correct bug then; as long as the version tags on that are updated, this can be closed as a duplicate unless somebody can find evidence that distance does make entities more likely to lose their attributes.Resolved on request.