Skip to content

Instantly share code, notes, and snippets.

@crast
Created March 23, 2013 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crast/5229624 to your computer and use it in GitHub Desktop.
Save crast/5229624 to your computer and use it in GitHub Desktop.
class MyPlugin {
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
if (args[0].equals("eat")) {
// do something
return false; // wait is it false or true?
} else if (args[0].equals("sleep")) {
// do something else
} else if (args[0].equals("code")) {
// I'm getting tired of else ifs :(
} else if (args[0].equals("rinse")) {
// really?
} else if (args[0].equals("repeat")) {
// yeah, really.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment