How do I limit the radius that a say command can be seen from?
I have an adventure map with a say command that activates after a certain mob is killed. This can be problematic, because if you die while fighting the mob, it sends you to a town, and automatically makes the difficulty set to peaceful. This in turn kills the mob and sets off the say command without the player actually killing it. With this situation, can I make a say command that is only seen by players that are within a certain radius? I do not want a say command that is only set off when a player enters a certain radius.
You can't specify a radius for the command /say
. You should learn json and use /tellraw
instead. If you want to send the message to everyone within a radius of 100 blocks, do /tellraw @a[r=100]
.
Basic JSON formatting:
/tellraw @a[r=100] {text:"Hello world!"}
With colours: /tellraw @a[r=100] {text:"Hello world!",color:"aqua"}
These colours have different names than wool colours, for example cyan is dark_aqua
. These names can be found on the Minecraft wiki here.
You can do lots more with JSON than you can do with /say. Check out this awesome json generator: https://www.minecraftjson.com/