EskilstunasTs

Command Base

Mar 1st, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  2.         if (!(sender instanceof Player)) {
  3.             sender.sendMessage("You can't do this command from the console!");
  4.             return true;
  5.         }
  6.  
  7.         Player player = (Player) sender;
  8.  
  9.         if (!(player.hasPermission("test.example"))) {
  10.             player.sendMessage(ChatColor.RED + "Du har saknar 'test.example'");
  11.             return true;
  12.         }
  13.  
  14.         if (args.length == 0) {
  15.             // TODO
  16.             return true;
  17.         }
  18.  
  19.         Player target = Bukkit.getServer().getPlayerExact(args[0]);
  20.  
  21.         if (target == null) {
  22.             // TODO
  23.             return true;
  24.         }
  25.  
  26.         // TODO
  27.  
  28.         return true;
  29.     }
  30. }
Add Comment
Please, Sign In to add comment