Skip to content

Instantly share code, notes, and snippets.

@Signifies
Created December 13, 2016 21:51
Show Gist options
  • Save Signifies/9fd6a7216093ea8ea206f873fc73803a to your computer and use it in GitHub Desktop.
Save Signifies/9fd6a7216093ea8ea206f873fc73803a to your computer and use it in GitHub Desktop.
if args.length() == 0
{
player.sendMessage("Incorrect Arguments. Specify gamemode.")
}else {
switch(args[0].toLowerCase())
{
case "creative":
case "1":
player.setGameMode(Gamemode.CREATIVE);
break;
case "survival":
case "0":
player.setGameMode(GameMode.SURVIVAL);
break;
case "adventure":
case "2":
player.setGameMode(GameMode.ADVENTURE);
break;
case "spectator":
case "3":
player.setGameMode(GameMode.SPECTATOR);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment