Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- String cmdName = cmd.getName().toLowerCase();
- Player player = null;
- String playerName = null;
- //If player is null, command was sent from the server
- if (sender instanceof Player) {
- player = (Player) sender;
- playerName = player.getName();
- }
- if (cmdName.equals("command1")) {
- //Do stuff
- }
- else if (cmdName.equals("command2")) {
- //Do stuff
- }
- else if (cmdName.equals("command3")) {
- //Do stuff
- }
- else {
- //Unhandled command
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement