mojira.dev
MC-180199

Attribute minecraft:generic.attack_knockback and minecraft:generic.flying_speed don’t work on all entities

You can use the minecraft:generic.attack_knockback attribute to change the attack knockback of a mob. But if you try to do this with players it does not work. It says entity name has no Attribute Attack Knockback. For mobs it works fine. 

How to reproduce: 

Run this command: /attribute @s minecraft:generic.attack_knockback base set 0 

It fails.
minecraft:generic.flying_speed has the same issue.
It seems like minecraft:generic.flying_speed also does not work on mobs.

This also doesn’t work if you have the attribute on an item. You can for example use this command:/give @p minecraft:stick{AttributeModifiers:[{AttributeName:"generic.attack_knockback",Name:"generic.attack_knockback",Amount:10,Operation:0,UUID:[I;5,5,5,5],Slot:"mainhand"}]} 1 and the attribute of the item will only work on mobs.

Related issues

Attachments

Comments

migrated
[media]
migrated

Also relates to MC-138868.

slicedlime

Not all entities have the same attributes.

Adding an attack knockback attribute for players is a feature request.

migrated

But why don’t have players an attack knockback attribute? I don’t see any reason for them to not have this attribute.

migrated

Wait, players are not intended to have this basic attribute?

migrated

(Unassigned)

Community Consensus

Low

Commands

20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2

Retrieved