How does the command work?

Ti
3

How can I activate a command block but only when players are around in 50 blocks? So he should spawn iron golems but only when players are 50 blocks away. Minecraft java version 1.14.4

Ba

Give it a try

/ testfor @a [radius = 50] and then set it to repeat and always active.

Then connect to another command block with a comparator and stop / summon iron_golem xyz

cl

Congratulations, you have no idea.

cl

Execute if entity @a [distance = .50] run summon iron_golem x y z