How can you cheat a strong sword in Minecraft?
To what extent? For example, if you are on a server, it will not just work as if you were in your own world
You cheat a sharpness 5 book, an anvil and a diamond sword and then you put the sharpness on the sword.
I meant a command block
Depends on the version. Can you add to your question?
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
Mobile phone version 1.14.2