TransWikia.com

How to execute if there's a certain block within a radius

Arqade Asked by BjornGmr on March 11, 2021

I’m trying to figure out how to execute (for example /say hi) when there’s Yellow Terracotta in a certain radius or field, however I can’t figure out how to do it. Anyone knows?

One Answer

I provided some thoughts in your thread on stackoverflow, but I came up with (for mc1.16):

execute at @p[distance=..3] if block ~ ~-1 ~ minecraft:yellow_glazed_terracotta run say hi

This sort of achieves what you are looking for. When a button is on the command block, the player must press the button, be within 3 blocks of the command block, and the terracotta must be under the player. Then it shall run "say hi."

Answered by emmit on March 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP