#execute if block Comand not working

1 messages · Page 1 of 1 (latest)

dense falcon
#

execute if block Command not working execute if block 0 60 0 minecraft:barrel{CustomName:'{"text":"Supply Crate"}'} run say hi

limpid pewterBOT
#

<@&1201956957406109788>

Someone will come and help soon!

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

🙇 If nobody has answered you by <t:1724562597:t>, feel free to use the Summon Helpers button to ping our helper team.

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

hushed salmon
#

You're sure the block is at those coordinates?

hushed salmon
#

In what dimension?

dense falcon
#

setblock 0 60 0 barrel[facing=up]{LootTable:"gamerz_riot:trial_ominous_supplies",CustomName:'{"color":"red","italic":false,"text":"Supply Crate"}'} replace barrier

#

In Overworld

hushed salmon
#

Okay, try checking the block without the data

dense falcon
hushed salmon
dense falcon
hushed salmon
#

The data you're checking is not the same as the data you set for it

dense falcon
hushed salmon
#

You can do just the CustomName

#

But it has the be the whole CustomName, can't do a partial check for that because it's technically all one string

dense falcon
hushed salmon
#

That's not the whole CustomName, I just told you...

hushed salmon
dense falcon
hushed salmon
#

Why are you sharing that again?

dense falcon
hushed salmon
#

That's not super surprising, but was worth a try. Checking data like that isn't always going to be super accurate

#

Why do you need to check the data if the barrel?

#

If you know it's at those coordinates, whether it's a barrel named Supply Crate or not should be irrelevant

dense falcon
hushed salmon
#

Seems to me that you can just check if it's a barrel

dense falcon
hushed salmon
#

Or, alternatively, you can also spawn a marker with a tag at that position along with the barrel, and run the command as that instead

hushed salmon
#

It's a type of entity

#

They're invisible and don't move, so they're very useful for things like this