Attack Knockback attribute doesn't work on items.
This one is quite simple; Although generic.attack_knockback is a perfectly valid attribute, it can only be used as a base attribute for mobs, and does not currently work with items.
/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
The command above gives the nearest player a stick which increases Attack Knockback by 10, however, when using the stick as a weapon, the extra knockback does not apply, although the description does say "+10 Attack Knockback".
Created Issue:
Attack Knockback attribute doesn't work on items.
This one is quite simple; Although generic.attack_knockback is a perfectly valid attribute, it can only be used as a base attribute for mobs, and does not currently work with items.
/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
The command above gives the nearest player a stick which increases Attack Knockback by 10, however, when using the stick as a weapon, the extra knockback does not apply, although the description does say "+10 Attack Knockback".
Environment
Items with custom attributes.
This one is quite simple; Although generic.attack_knockback is a perfectly valid attribute, it can only be used as a base attribute for mobs, and does not currently work with items.
/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
The command above gives the nearest player a stick which increases Attack Knockback by 10, however, when using the stick as a weapon, the extra knockback does not apply, although the description does say "+10 Attack Knockback".
This one is quite simple; Although generic.attack_knockback is a perfectly valid attribute, it can only be used as a base attribute for mobs, and does not currently work with items.
/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"}]} 1The command above gives the nearest player a stick which increases Attack Knockback by 10, however, when using the stick as a weapon, the extra knockback does not apply, although the description does say "+10 Attack Knockback".
Items with custom attributes.
relates to
duplicates
relates to
This is probably the same issue as
MC-180199.Also relates to
MC-138868.Yes it is the same bug. I gave this stick to a skeleton that can pick up loot command: /summon minecraft:skeleton ~ ~1 ~
{CanPickUpLoot:1b}And the attribute worked. So the attribute on items has exactly the same issue that it only works on mobs. Minecraft 20w18a - Singleplayer 04.05.2020 15_57_49.mp4