Can you attach a command to a sword in minecraft?

So
2

I would like to generate a sword, which, when you hit a block, it starts to burn. Can you do that?

Is

Clear with essentials from spigot. Take the sword and enter (your command without /).

So

Where do you get essentials from?