mojira.dev
MC-261153

/data merge block not working on ender chests

/data merge block ~ ~ ~ {Lock:"Name of Key","italic":false,"color":"white"} does not work on enderchests despite working on chests, trapped chests, barrels, and shulker boxes. Also I didn't know if this one was a bug or not but command does not work on doors, if it is not a bug can it please work on doors.

Comments 5

Ender chests are not containers, they cannot be locked. Feature request, not a bug.
Also, that NBT is mis-structured; the italic and color fields get deleted.

So regarding the NBT being "incorrect" or "mis-structured" is wrong, let me explain as to why for both scenarios(Do note that I wrote both these as ways to clarify how I also got the results that I did); first it being incorrect as the NBT of the command refers the the NBT of the Key in use which for the scenario I was using was a custom item with its NBT altered here is the command for the key /give @p tripwire_hook{display:

{Name:'[

{"text":"Name of Key","italic":false,"color":"white"}

]'} if there is any form of error regarding the command try removing the " and retyping them or try retyping the whole command as to copy/paste as different fonts can cause them to not work but other than that the commands work fine as to the reason I know, I have Minecraft open right now and am executing the commands perfectly. Now as for it being mis-structured might I ask how? If it is for the reason of [,"italic":false,"color":"white"] existing as I mentioned previously in this comment I altered the NBT of the Key item which I had thought was clear as it had modified Name NBT data but if I may have missed something I would be glad to learn as I have been studying commands for the past 3-4 years and anything new I can learn is very helpful.

 

Personal thoughts-

Though I do have 1 thing that I am a bit confused about and that is how is an enderchest not a container? It is true that it isn't your every day conventional container as all enderchests share the same inventory but it still has the same interactability and function as each other containers as you right click on it and it opens the inventory allowing the players to store items inside now what stops the specific enderchest from not being able to be opened and remain locked but that's just my brain being confused and reasoning why it would be a bug note this also doesn't work for chiseled book shelves but that one makes sense.

The NBT is mis-structured as you're setting the block's italic and color NBT, not JSON in a string. Neither tags exist on the block data. The Lock NBT is plain text, not json in a string, and the key will work if the resulting text matches (Lock:"abc" works with both Name:'"abc"' and Name:'["a",["b",["c"]]]' for example.)

Ender chests do not store anything, they literally open a gui to a second player inventory. They store no items -> they are not containers.

I see that makes a lot more sense now thank you for explaining that is really helpful to know 

Thank you for your report!
However, this issue is Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit Minecraft Suggestions on Reddit or visit the Feedback website.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Neo_Explorer

(Unassigned)

Unconfirmed

(Unassigned)

commands

1.19.4, 23w12a

Retrieved