/give with Enchantments returns unknown item name error
waybaker opened this issue ยท 9 comments
Information
Full output of /ess version
:
Server version: 1.16.1-R0.1-SNAPSHOT git-Paper-108 (MC: 1.16.1)
EssentialsX version: 2.18.0.7
LuckPerms version: 5.1.26
Vault version: 1.7.3-b131
EssentialsXChat version: 2.18.0.7
Server log: https://gist.github.com/waybaker/abc79c4f970ffabec3f2c006c1bb409b
EssentialsX config: https://gist.github.com/waybaker/d5b0a97d28371b9a86fe8e3290fccfba
Details
Description
When using the /give command, either in console or in game, and using enchantments, an error is returned - "Unknown Item Name".
Sample Command: /give [putplayernamehere] diamond_axe{Enchantments:[{id:efficiency,lvl:5},{id:fortune,lvl:3},{id:mending,lvl:1},{id:sharpness,lvl:5},{id:unbreaking,lvl:3}]} 1
Error Returned: Error: Unknown item name: diamond_axe{enchantments:[{id:efficiency,lvl:5},{id:fortune,lvl:3},{id:mending,lvl:1},{id:sharpness,lvl:5},{id:unbreaking,lvl:3}]}.
Steps to reproduce
With plugin loaded, issue the command. I removed plugins one by one until I figured out it was this one. After removing the EssentialsX and EssentialsX Chat Plugins, the issue resolved.
Expected behavior
The player identified in the command string should be given the item specified, with the enchantments specified.
Screenshots
@triagonal how do i give a named item with essentials?
@triagonal how do i give a named item with essentials?
Use {display:{Name:'[{"text":"Your text here"}]}}
.
that is the vanilla method. it does not work with essentialsx. thanks for trying though
this is my command:
/minecraft:give @p minecraft:netherite_sword{display:{Name:'{text":"The Blade of Death","italic":"FALSE","color":"RED","bold":"TRUE"}'},Enchantments:[{id:"minecraft:sharpness",lvl:10s}]} 1
but the sword just shows up as an enchanted 'netherite sword'
Try not in capital letters?
Also, issues in this project aren't meant for support, it would be appreciated if you could create a discussion about this.
This is because the Essentials /give
command has a different syntax to the vanilla /give
command. The Essentials syntax requires the NBT data to be put last after all other elements, e.g. /give <player> <itemname> <amount> <nbt>
.
In your example, you should structure the command as /give <player> diamond_axe 1 {Enchantments:[{id:efficiency,lvl:5},{id:fortune,lvl:3},{id:mending,lvl:1},{id:sharpness,lvl:5},{id:unbreaking,lvl:3}]}
.
If you wish to use the vanilla /give
syntax, then specify /minecraft:give
explicitly instead.