Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. package me.notpexel.helloworld.commands;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7.  
  8. import com.sun.tools.javac.Main;
  9.  
  10. public class HelloCommand implements CommandExecutor {
  11.  
  12.     private Main plugin;
  13.     public HelloCommand(Main plugin) {
  14.         this.plugin= plugin;
  15.         plugin.getCommand("hello").setExecutor(this);
  16.     }
  17.    
  18.     @Override
  19.     public boolean onCommand(CommandSender sender, Command cmd, String lable, String[] args) {
  20.         if (!(sender instanceof Player)) {
  21.             sender.sendMessage("You ain't no player! Only players are premmited to usin' this command");
  22.             return true;
  23.         }
  24.         Player p = (Player) sender;
  25.         if (p.hasPermission("hello.use")) {
  26.             p.sendMessage("sup m8?"));
  27.             return true;
  28.         }else {
  29.             p.sendMessage("You ain't no allowed!");
  30.         }
  31.         return false;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement