How can you use a dirt block as a helmet, for example? I know that there's a command, but I don't know it anymore.
You can somehow give the head of any skin of a player with the give command. If someone has a dirt skin, then you have a dirt block as a head.
/ replaceitem entity username slot.armor.head minecaft: dirt
If it is on a server and Essentials is installed, simply pick it up and type: / hat