Minecraft:Commands/enchant: Difference between revisions
More actions
Remove broken links to missing pages |
Sync: updated from Minecraft |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others=Cheat only{{only|bedrock|short=1}} | |others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}} | ||
}} | }} | ||
Adds an enchantment to a player's selected [[Minecraft:item]], subject to the same restrictions as an anvil.<ref>{{bug|MC-261942}}</ref> Also works on any mob or entity holding a [[Minecraft:weapon]]/[[Minecraft:tool]]/[[Minecraft:armor]] in its main hand. | Adds an [[Minecraft:enchantment]] to a player's selected [[Minecraft:item]], subject to the same restrictions as an [[Minecraft:anvil mechanics|anvil]].<ref>{{bug|MC-261942}}</ref> Also works on any mob or entity holding a [[Minecraft:weapon]]/[[Minecraft:tool]]/[[Minecraft:armor]] in its main hand. | ||
== Syntax == | == Syntax == | ||
| Line 26: | Line 26: | ||
{{el|je|short=1}}: {{argument|enchantment|resource}}<br> | {{el|je|short=1}}: {{argument|enchantment|resource}}<br> | ||
{{el|be|short=1}}: {{argument|be=1|enchantmentId: int|int}} or {{argument|enchantmentName: Enchant|enum}} | {{el|be|short=1}}: {{argument|be=1|enchantmentId: int|int}} or {{argument|enchantmentName: Enchant|enum}} | ||
: Specifies the enchantment to be added to the item held in main hand by the target. | : Specifies the [[Minecraft:enchantment]] to be added to the item held in main hand by the target. | ||
: {{arg desc|je=resource|registry=minecraft:enchantment|be=enum}} | : {{arg desc|je=resource|registry=minecraft:enchantment|be=enum}} | ||
| Line 61: | Line 61: | ||
== Examples == | == Examples == | ||
* To give the Infinity enchantment to all players holding a bow: | * To give the [[Minecraft:Infinity]] enchantment to all players holding a bow: | ||
*: <code>/enchant @a infinity</code> | *: <code>/enchant @a infinity</code> | ||
* To enchant the nearest player's held sword with Sharpness 5: | * To enchant the nearest player's held sword with [[Minecraft:Sharpness]] 5: | ||
*: <code>/enchant @p sharpness 5</code> | *: <code>/enchant @p sharpness 5</code> | ||
| Line 96: | Line 96: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/enchant | [[Minecraft:de:Befehl/enchant]] | ||
es:Comandos/enchant | [[Minecraft:es:Comandos/enchant]] | ||
ja:コマンド/enchant | [[Minecraft:fr:Commandes/enchant]] | ||
ko:명령어/enchant | [[Minecraft:ja:コマンド/enchant]] | ||
lzh:令/enchant | [[Minecraft:ko:명령어/enchant]] | ||
pt:Comandos/enchant | [[Minecraft:lzh:令/enchant]] | ||
ru:Команды консоли/enchant | [[Minecraft:pt:Comandos/enchant]] | ||
th:คำสั่ง/enchant | [[Minecraft:ru:Команды консоли/enchant]] | ||
uk:Команди консолі/enchant | [[Minecraft:th:คำสั่ง/enchant]] | ||
zh:命令/enchant | [[Minecraft:uk:Команди консолі/enchant]] | ||
[[Minecraft:zh:命令/enchant]] | |||
Latest revision as of 11:04, 9 May 2026
Adds an Minecraft:enchantment to a player's selected Minecraft:item, subject to the same restrictions as an anvil.<ref>Template:Bug</ref> Also works on any mob or entity holding a Minecraft:weapon/Minecraft:tool/Minecraft:armor in its main hand.
Syntax
- Java Edition
enchant <targets> <enchantment> [<level>]
- Bedrock Edition
enchant <player: target> <enchantmentId: int> [level: int]enchant <player: target> <enchantmentName: Enchant> [level: int]
Arguments
- Specifies the target(s).
- Template:Arg desc
Template:El: Template:Argument
Template:El: Template:Argument or Template:Argument
- Specifies the Minecraft:enchantment to be added to the item held in main hand by the target.
- Template:Arg desc
- Specifies the enchantment level. Should be not greater than the maximum level for the specified enchantment<ref>Although
/enchantenforces maximum levels and compatibility, other commands (such as Template:Cmd, Template:Cmd, and Template:Cmd) can bypass these restrictions.</ref>. If not specified, defaults to 1. - Template:Arg desc Template:IN, it should be between 1 and 2147483647 (inclusive).
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Examples
- To give the Minecraft:Infinity enchantment to all players holding a bow:
/enchant @a infinity
- To enchant the nearest player's held sword with Minecraft:Sharpness 5:
/enchant @p sharpness 5
History
Java Edition
Bedrock Edition
References
External links
Minecraft:de:Befehl/enchant Minecraft:es:Comandos/enchant Minecraft:fr:Commandes/enchant Minecraft:ja:コマンド/enchant Minecraft:ko:명령어/enchant Minecraft:lzh:令/enchant Minecraft:pt:Comandos/enchant Minecraft:ru:Команды консоли/enchant Minecraft:th:คำสั่ง/enchant Minecraft:uk:Команди консолі/enchant Minecraft:zh:命令/enchant