The bug
The type argument can no longer be used for the @r selector to select non-player entities.
How to reproduce
- Make sure there are other entities in the world
- Use the following command
/say @r[type=!player]
Code analysis
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; }
- is duplicated by
-
MC-124276 @r tag not functioning properly on entities
- Resolved
-
MC-125082 Random entity type
- Resolved
-
MC-127498 [type=] target selector doesn't function in some circumstances
- Resolved
-
MC-130409 @r selector does not accept [type=<entity_name>] or any other [<stuff>=<other_stuff>]
- Resolved
-
MC-131087 Entitles Leave Their Teams (Fix: @r Selector Doesn't Work)
- Resolved
-
MC-135667 "type=" doesen't work in @r
- Resolved