Minecraft – How to test if all minecraft players on a server are in a radius

minecraft-commandsminecraft-java-edition

This has got me. I need a command that tells me if all players on a server are in a radius of a command block. If one of them isn't in the radius, the command will be false. Any ideas? Thanks!

Best Answer

Use a command block with the command /testfor @a[rm=RADIUS]. point a comparator from the command block into another block, and on that block, place a redstone torch. This tests if anyone is outside of the radius, and inverts the signal, providing the output you want.