.enchant is a chat command that enchants the item in the player's hand with every enchantment except for Silk Touch and cursed enchantments. Most enchantments are applied at level 127, but Quick Charge is applied at level 5 to prevent it from breaking crossbows.
To enchant an item, simply type
.enchant into the chat box while holding the item.
If the item has been enchanted successfully, there will be a chat message saying:
[Wurst] Item enchanted. 1)
If the item could not be enchanted, the chat will display either:
[Wurst] [ERROR] There is no item in your hand. 2)
if the main hand slot is empty, or:
[Wurst] [ERROR] Creative mode only. 3)
if you are not in Creative Mode.
Main article: Command Syntax
.enchantEnchants the item in the player's main hand.