Minecraft wiki entry for enchant, associated text: Adds an enchantment to a player's selected item, subject to the same restrictions as an anvil. Also works on any mob or entity holding a weapon/tool /armor in their main hand in Java Edition.