Minecraft – Summon 10 Zombies at players position, to all players

minecraft-commandsminecraft-java-edition

There is a way to summon 10 zombies near every player on the map with command blocks twice a day?

In the official command wiki, we can read this:

To summon 10 creepers at the nearest player's position (only works as
long as there are at least 10 entities in the loaded world):

execute @e[c=10] ~ ~ ~ execute @p ~ ~ ~ summon Creeper

This command work with command blocks? I read somewhere else the execute command doesn't work in command blocks.

Also, I didn't understood why the world must have 10 entities loaded. Can you explain this to me?

Sorry if this question was alerady answered. I searched, but I didn't find anything.

Thank you for your help.

Best Answer

To do this, you will need 10 command blocks in series, connected to this daylight sensor setup:

Attach the daylight sensor output to A- a not gate, and B- a 14-block long line of redstone dust. The outputs of both of these should activate the 10 command blocks all containing:

execute @a ~ ~ ~ summon Zombie

P.S. the execute command CAN be used in command blocks.