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;
}
Linked issues
is duplicated by 6
Comments 18
@@unknown did you mean to comment on a different report or is your comment missing a "not" (even then "in most situations" looks wrong) since this report is about something not working
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;
}
Confirmed in 18w11a. Do you want me to keep checking this or is it generally accepted that it's going to eventually be marked as Works as Intended?
We don't need weekly updates, no. We're happy about them, but especially for minor stuff like this it's not important.
can be achieved through @e and type, limit and sort attributes. sort=[nearest|furthest|random|arbitrary]
/say @r[type=!player] can be done with /say @e[type=!player,limit=1,sort=random]
I can confirm that this doesn’t work in most situations (IE @r with entities doesn’t work)