TransWikia.com

Command Block /execute at all UNnamed mobs of same type

Arqade Asked by PolikMaster on August 21, 2021

I have various named Zombies. I want to do something with all OTHER Zombies.

/execute @e[name=Zombie] ~ ~ ~ summon ArmorStand ~ ~ ~

Above does not seem to work. Any way to target Zombies that have no CustomName?

3 Answers

First create a scoreboard objective:

/scoreboard objectives add selectMe dummy  

Then add all your Zombies:

/scoreboard players set @e[name=Name1] selectMe 1  
/scoreboard players set @e[name=Name2] selectMe 1  
/scoreboard players set @e[name=Name3] selectMe 1  

Now, you can execute your command:

/execute @e[score_selectMe=0] ~ ~ ~ summon ArmorStand ~ ~ ~ 

For more info, click here.

Answered by user143228 on August 21, 2021

/execute @e[name=Unknown,type=Zombie] ~ ~ ~ /say hi

This command should work

Answered by Slurpy on August 21, 2021

1.13 Update

You can use the unless subcommand of /execute to execute as all zombies that don't have the custom name:

execute
  as @e[type=zombie]
  unless data entity @s CustomName
run ...

Answered by ExpertCoder14 on August 21, 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