mojira.dev
MC-117163

Mobs ignore attack speed of items when attacking

The bug

Mobs ignore the attack speed of an item when they attack with it. This can cause pretty big problems if you have an item with a high attack damage but a very low attack speed, which is therefore balanced for players, and somehow a mob picks it up.

How to reproduce

  1. Give yourself an item with a high attack damage but a low attack speed

    /give @p diamond_axe 1 0 {AttributeModifiers:[{AttributeName:generic.attackSpeed,Name:a,UUIDLeast:1L,UUIDMost:1L,Amount:-10.0,Slot:mainhand},{AttributeName:generic.attackDamage,Name:a,UUIDLeast:1L,UUIDMost:2L,Amount:50.0,Slot:mainhand}]}
  2. Summon a husk, which has like a player a health value of 20

    /summon husk
  3. Try to kill the husk with the axe
    → It should require two hits

  4. Equip diamond armor

  5. Summon a husk with the same axe

    /summon husk ~ ~1 ~ {HandItems:[{id:diamond_axe,Count:1b,tag:{AttributeModifiers:[{AttributeName:generic.attackSpeed,Name:a,UUIDLeast:1L,UUIDMost:1L,Amount:-10.0,Slot:mainhand},{AttributeName:generic.attackDamage,Name:a,UUIDLeast:1L,UUIDMost:2L,Amount:50.0,Slot:mainhand}]}}]}
  6. Switch to Survival or Adventure mode and let the husk hit you
    → You are instantly dead

Linked issues

Comments 1

The attack speed attribute exists on players only, so this is intended/invalid.

You know the next part @unknown. 😉

marcono1234

(Unassigned)

Unconfirmed

AttributeModifiers, attackSpeed, attributes, item, mob

Minecraft 17w18b

Retrieved