SHARE
TWEET

bbear

a guest Oct 12th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.Vimiks.Poll;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9.  
  10. public class poll extends JavaPlugin {
  11.    
  12.    
  13.     public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  14.        
  15.         if (cmd.getName().equalsIgnoreCase("poll")) {
  16.             if(args.length == 0) {
  17.                 sender.sendMessage(ChatColor.RED + "Please Specify a Question.");
  18.             return true;
  19.             }
  20.            
  21.  
  22.         }
  23.        
  24.         StringBuilder str = new StringBuilder();
  25.         for (int i = 0; i < args.length; i++) {
  26.             str.append(args[i] + " ");
  27.         }
  28.         String poll = str.toString();
  29.         sender.sendMessage(" ");
  30.         sender.sendMessage(ChatColor.GREEN + sender.getName() + " wants to know: " + poll);
  31.         sender.sendMessage(" ");
  32.        
  33.         Bukkit.getServer().broadcastMessage(ChatColor.GREEN + "To vote use /yes or /no");
  34.        
  35.         return true;
  36.     }
  37. }
RAW Paste Data
Top