I'm trying to teleport an armour stand ~ ~1 ~, as well as a sheep in the same position, but when I do /tp @e[type=ArmorStand] ~ ~1 ~ it will only let me teleport the armour stand and not the sheep, for example /tp @e[type=ArmorStand,type=Sheep] ~ ~1 ~ doesn't work. Is there a way to select both an armour stand and a sheep, but no other entities? This goes the same with names, can you select two separate entities with different names and have them both be effected by the single command?
I'm trying to teleport an armour stand ~ ~1 ~, as well as a sheep in the same position, but when I do /tp @e[type=ArmorStand] ~ ~1 ~ it will only let me teleport the armour stand and not the sheep, for example /tp @e[type=ArmorStand,type=Sheep] ~ ~1 ~ doesn't work. Is there a way to select both an armour stand and a sheep, but no other entities? This goes the same with names, can you select two separate entities with different names and have them both be effected by the single command?
Not as simply as you are asking, but yes. A simple way is to mark every entity with a scoreboard objective:
/scoreboard players set @e[type=ArmorStand] sheepStand 1
/scoreboard players set @e[type=Sheep] sheepStand 1
/tp @e[score_sheepStand_min=1] ~ ~1 ~
Of course, you have to create the objective, sheepStand, first: /scoreboard objectives add sheepStand dummy
WHY IS EVERYONE MAKING IT MORE COMPLICATED THAN IT HAS TO BE? You don't need to set up a scoreboard objective. In fact, doing a kill command for each individual entity is MORE EFFICIENT than that method!
WHY IS EVERYONE MAKING IT MORE COMPLICATED THAN IT HAS TO BE? You don't need to set up a scoreboard objective. In fact, doing a kill command for each individual entity is MORE EFFICIENT than that method!
If the targets need to be affected by more than one command, then using scoreboards is more efficient. Otherwise you'd need many times the number of command blocks for each command you need to affect per target. If it's only one command, sure, but overall it's more efficient to use scoreboards.
WHY IS EVERYONE MAKING IT MORE COMPLICATED THAN IT HAS TO BE? You don't need to set up a scoreboard objective. In fact, doing a kill command for each individual entity is MORE EFFICIENT than that method!
In this case there were more than 100 command blocks, using this I reduced it from being 200 to 100
Not as simply as you are asking, but yes. A simple way is to mark every entity with a scoreboard objective: Of course, you have to create the objective, sheepStand, first: /scoreboard objectives add sheepStand dummy
that works perfectly! thank you
Sure thing!
What is life when we bake cookies and cook bacon?
If the targets need to be affected by more than one command, then using scoreboards is more efficient. Otherwise you'd need many times the number of command blocks for each command you need to affect per target. If it's only one command, sure, but overall it's more efficient to use scoreboards.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
In this case there were more than 100 command blocks, using this I reduced it from being 200 to 100
Couldn't you do two target selectors?
You could go like
No. When you redeclare a parameter, you're replacing the previous declaration. The last of the same listed parameters will be used instead.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/