I wanted to know if the @r command works with the [name=] specification, aim trying to make a underwater map with randomized fish using invisible squids and i want to only select the ones named squid (meaning the unnamed ones since a squid's default name is squid)
1 Answer
Yes it does, but you have to specify the type of mob it is, or it won't target entities. As per the wiki:
When used without the
type
argument,@r
always targets a random player. Thetype
argument can be used to target non-player entities [...]
Here is a example:
/tp @r[type=Squid,name=Random] ~ ~3 ~
This would teleport a random Squid with the name "Random" 3 blocks up. Hope this helps!
-
Welcome to the Site! Good first answer. I didn't believe @r could target entities, you so I looked it up on the wiki. Turns out you are right, so I took the liberty of adding the relevant section to your answer for all the other doubters. Feel free to roll-back if you don't like it though. (To do so, click on "edited TIME ago" to see the edit history and click "rollback".)– MrLemonCommented Jan 21, 2015 at 10:09