Mojira Archive
MC-121740

@r (random) selector does not work for non-players anymore

The bug

The type argument can no longer be used for the @r selector to select non-player entities.

How to reproduce

  1. Make sure there are other entities in the world
  2. Use the following command
    /say @r[type=!player]
    

Code analysis

From this comment

The following is based on a decompiled version of Minecraft snapshot 17w45b (obfuscated) decompiled using CFR v122

This is because the class cx.java, which appears to parse selectors, sets the properties l, presumably named selectsNonPlayer or equivalent when deobfuscated to false. The relevant code is as follows:

else if (c2 == 'r') {
    this.k = 1;
    this.l = false; //Should be true
    this.y = i;
}

Works As Intended

Marcono1234

Rikard Herlitz

2017-11-09, 08:07 PM

2018-08-06, 11:31 AM

2018-05-25, 11:54 AM

19

10

Confirmed

player, selector

Minecraft 17w45a - Minecraft 18w20cMinecraft 17w45a, Minecraft 17w48a, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w11a, Minecraft 18w19a, Minecraft 18w20c

-