if(mc.thePlayer.getGameType() == EnumGameType.SURVIVAL){
mc.thePlayer.setGameType(EnumGameType.CREATIVE);
lithium.addMessage("Gamemode updated to §bCreative§f.");
}
if(mc.thePlayer.getGameType() == EnumGameType.CREATIVE){
mc.thePlayer.setGameType(EnumGameType.SURVIVAL);
lithium.addMessage("Gamemode updated to §bSurvival§f.");
}
public void runCommand(String s, String[] args)
{
if (this.mc.thePlayer.capabilities.isCreativeMode) {
this.sendChat("survival");
} else {
this.sendChat("creative");
}
}
private void sendChat(String gameMode) {
this.mc.thePlayer.sendChatMessage("/gamemode " + gameMode);
}