The command
/kill @r
only kills a player (in singleplayer me), it can't target a random entity.
The command
/kill @r[type=ArmorStand]
actually kills a random armor stand. But if I want to kill a random entity in the world (or a random one that fits a certain condition), it isn't possible (except, of course, I summon an armor stand with a name at every entity and execute at a random armor stand and and and...).
I think this is a bug, since with @e it always works.
Linked issues
is duplicated by 4
Comments 11
If you use @e[type=...], it targets all entities of one type.
If you use @e, it targets all entities.
If you use @r[type=...], it targets a random one of a type of entities.
If you use @r, it targets a random player.
What I expected was to target a random entity, I don't see where the limit to players suddenly comes from.
Since Mojang broke all relative teleports when target and source are not identical, they apparently don't worry too much about breaking existing command block contraptions. Could this bug report then please be re-opened?
Confirmed for 1.9.4 and 16w21b.
For now if you want to target any random entity regardless of type, use @r[type=!LightningBolt]
. "LightningBolt" is not a valid savegame ID, and lightning bolts cannot be targeted anyway.
What exactly are you trying to do, what did you expect to happen and what did actually happen? Why is this a bug?