#Detect a Custom name chest not working in 1.21

1 messages · Page 1 of 1 (latest)

timber torrentBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

native tangle
#

do you have a renamed chest in your world rn

#

come to that renamed chest, do data get block <cords of renamed chest> and show the result here

grizzled smelt
#

0, 60, 0 has the following block data: {CustomName:'{"text":"Variety Chest","color":"blue"}', x: 0, y: 60, Items: [], z: 0, id:"minecraft:chest"}

prime python
#

isn't the issue the fact that 1.21 uses components and not NBT?

#

wait

#

I'm dumb lol

#

I thought this was an item

#

what exactly are you trying to detect?

grizzled smelt
prime python
#

so you just want to know if the chest has a custom name?

grizzled smelt
#

execute if block ~ ~ ~ chest{CustomName:'{"text":"Name"}'} run

prime python
#

did this work before in earlier versions?

grizzled smelt
#

this works in previous version but not now

prime python
grizzled smelt
prime python
native tangle
#

and it should work

#

yk

prime python
#

wait

#

are you trying to check if the block has any custom name?

#

or specifically the custom name "Variety Chest"?

grizzled smelt
#

Not work

prime python
#

the block is at 0, 60, 0, right?

grizzled smelt
prime python
#

and the chest's custom name is "TEXT"?

prime python
#

that's literally what I said

grizzled smelt
timber torrentBOT
# grizzled smelt THX It worked
🎗️ Is your question resolved?

If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D

full notch
#

Just to clarify here, the reason it wasn't working was because the actual chest's name had a blue colour, and so detecting for the name without a colour wouldn't properly detect it. Keep that in mind for the future, in case you change the colour or anything like that