mojira.dev
MC-305149

Mobs cannot perform melee piercing attacks (piercing_weapon component)

Mobs cannot perform melee piercing attacks using items with the piercing_weapon component. It would be expected that a melee mob with such a weapon would perform a piercing attack along a ray from their eyes to the edge of their attack range.

See attached video for a demonstration.

The following commands (or their practical equivalents) were used for the setup:

  • /summon minecraft:zombie ~ ~ ~ {equipment:{head:{id:"chainmail_helmet",components:{"minecraft:unbreakable":{}}}}}

  • /summon minecraft:witch ~ ~ ~

  • /summon minecraft:witch ~ ~ ~ {NoAI:1b,CustomName:"NoAI:1b"}

  • /give @s minecraft:blaze_rod[minecraft:piercing_weapon={sound:"entity.blaze.hurt",hit_sound:"entity.lightning_bolt.impact"}]

  • /item replace entity @n[type=zombie] weapon.mainhand from entity @s weapon.mainhand

  • /execute as @n[type=zombie] at @s run damage @s 0 minecraft:mob_attack by @n[type=witch,nbt=!{NoAI:1b}]

Linked issues

Attachments

Comments 1

This bug also explains why the spear‘s Jab attack when used by mobs cannot pierce and damage multiple targets.

clamlol

(Unassigned)

Confirmed

Platform

Normal

Items, Mob behaviour

1.21.11, 26.1 Snapshot 1

Retrieved