Searching into the code of Minecraft, I found that GuiChat class has a foundPlayerNames list but it is private.
Therefore, I searched for reflection method to access it but I still get a java.lang.NoSuchFieldException
Here one try of getting this list:
getDeclaredField(Minecraft.getMinecraft().currentScreen, "foundPlayerNames")
With method:
public static Object getDeclaredField(Object object, String field) {
try {
Field f = object.getClass().getDeclaredField(field);
f.setAccessible(true);
return f.get(object);
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
Thanks in advance if anyone know why I get this error.