The command /give cannot enchant an item.
I am trying to run a command (/give @s minecraft:diamond_sword[minecraft:enchantments={levels:{"minecraft:sharpness":10}}]) and failed. But this command works in 1.21.4
Linked issues
Comments 3
Also, don't duplicate your own reports. MC-280093 (Unintentional?)
Thank you for your report!
We're tracking this issue in MC-280093, so this ticket is being resolved and linked as a duplicate.
Please do not duplicate your own report.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Command format changed (25w04a changelog):
ENCHANTMENTS and STORED_ENCHANTMENTS Components
Removed show_in_tooltip field, replaced by tooltip_display component
These components now always use their simplified form, with the levels field inlined to top-level
e.g. enchantments={levels:{sharpness:2}} -> enchantments={sharpness:2}