Questions about NMS
Closed this issue · 1 comments
IceBear003 commented
Hello!
I want to ask how the command /skychanger 5 works.
Could you please tell me how the plugin works to reduce the light.
This is my code:
Object entityPlayer=player.getClass().getMethod("getHandle").invoke(player);
Object playerConnection=entityPlayer.getClass().getField("playerConnection").get(entityPlayer);
Object packet=PluginApi.getNMS("PacketPlayOutGameStateChange").getConstructor(int.class,float.class).newInstance(8,10.0);
playerConnection.getClass().getMethod("sendPacket",PluginApi.getNMS("Packet")).invoke(playerConnection, packet);
But it didn't work. I want to know what constants(In my code they are 8 & 10.0f) can make the minecraft like /skychanger 5.
Thank you!
Sorry for my bad English ;D
dscalzi commented
Just use the developer API I've provided https://github.com/dscalzi/SkyChanger/wiki#developer-api