SHARE
TWEET

Untitled

a guest Oct 14th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.Tommunity.Commands;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8.  
  9. import de.Tommunity.Main.Main;
  10.  
  11. public class Msg implements CommandExecutor{
  12.  
  13.      String message = "";
  14.    
  15.     @Override
  16.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  17.         Player p = (Player) sender;
  18.  
  19.        
  20.         if(args.length >= 2) {
  21.             Player t = Bukkit.getPlayer(args[0]);
  22.            
  23.             if(t != null) {
  24.                
  25.                 for(int i = 1; i < args.length; i++) {
  26.                     message = message + args[i] + " ";
  27.                 }
  28.                 p.sendMessage("§a[§cMir §7-> §c" + t.getName() + "§a]§7:§7 " + message);
  29.                 t.sendMessage("§a[§c" + p.getName() + " §7-> §c Dir§a]: §7" + message);
  30.                
  31.                 message = "";
  32.             } else {
  33.                 p.sendMessage(Main.pre + " §cDieser Spieler ist nicht online");
  34.             }
  35.            
  36.         } else {
  37.             p.sendMessage(Main.pre + " §cBitte benutze §6/msg <Name> Nachricht");
  38.         }
  39.        
  40.        
  41.         return false;
  42.        
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top