How can you cheat a strong sword in Minecraft?

Ma
6

How can you cheat a strong sword in Minecraft?

Ka

To what extent? For example, if you are on a server, it will not just work as if you were in your own world

an

You cheat a sharpness 5 book, an anvil and a diamond sword and then you put the sharpness on the sword.

Ma

I meant a command block

an

Depends on the version. Can you add to your question?

Be

For example

/ give @p minecraft: diamond_sword {AttributeModifiers: [{AttributeName: "generic.attackDamage", Name: "generic.attackDamage", Amount: 1024, Operation: 0, UUIDLeast: 416051, UUIDMost: 937470, Slot: "mainhand"} ]} 1

Ma

Mobile phone version 1.14.2