I am attempting to make one player immune to knockback. I have a command block with this in:
/replaceitem entity @p slot.inventory.0 minecraft:stone 1 0 {display:{Name:"Anti-Knockback",Lore:["Just so you arent affected by knockback"]},AttributeModifiers:[{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:1,Operation:1,UUIDMost:82829,UUIDLeast:167220}]}
It gives me the stone block and it says "+100% knockback resistance" but I'm still knocked back the same as before.
I used this command generator for this command.
Is there something wrong with the command that I can fix or is this just not the way to go about removing knockback. If so, how can I do it?
Thanks
I'm doing this because I have a snowball that summons a massive amount of lightning and it's knocking me back. I thought it might just be that the attribute doesn't affect lightning but I tried it with a skeleton and the result was the same.