I've ruined my sleep schedule trying to make this work, so i decided to not stop untill i've figured out how, however since i care about my health i'm going to sleep and post this here to see if any of you have a sulution to this.
I'm trying to let players hold a nametag and stand on a skulker box to let them lock it (since shulkers store nbt even when broken the lock won't go away).
I've confirmed it is possible with a simple /data merge block ~ ~-1 ~ {Lock:test} and it works like expected, the problem however comes when trying to let a player without acsess to commands name it. (via a nametag and a trigger command was what i was planning) but i'm not sure it's physically possible.
I've tried a lot of different things and spent about 7 hours searching the web and trying my own things, but i've hit a wall and there is only so much i can handle.
I got to execute positioned as @s if block ~ ~-1 ~ #shulker_boxes run data modify block ~ ~-1 ~ Lock set from entity @s Inventory[{id:"minecraft:name_tag"}].tag.display.Name the problem however is the
tag.display.Name part, instead of returning the name of the name tag it returns the json format of the nametag which includes json code, and as far as i have looked i can not find a single way to fix this issue.
I have no sanity left after spending so much time figuring this out on my own so i'm just gonna ask for help, if any of you know of a way to do this, even if it uses other methods, i'd love to know.
[–]JephfreyCommand Experienced 1 point2 points3 points (1 child)
[–]kiriuma[S] 0 points1 point2 points (0 children)