Hey. I am working with reflection here, but I am no so experienced in it. What should the objects in the set method be? I get this error: Code: 02.03 11:18:59 [Server] WARN java.lang.IllegalArgumentException: Can not set java.lang.String field net.minecraft.server.v1_7_R4.MinecraftServer.motd to java.lang.String Code: Code: public void setMotd(String motd) { try { Class clazz = MinecraftServer.class; Field f = clazz.getDeclaredField("motd"); f.setAccessible(true); f.set(motd, "motd"); } catch (Exception ex) { ex.printStackTrace(); } }
@WesJD You have to pass in the instance an instance of MinecraftServer in f.set();. So in your case: Code: Class<?> serverClass = MinecraftServer.class; Field theField = serverClass.getDeclaredField("motd"); theField.setAccessible(true); theField.set(MinecraftServer.getServer(), <motd>);