Hello, I am trying to figure out how to add spaces in between commands for my plugin. I have tried but I just cannot find why. Here is my main package me.pieman.drinks; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; public class Drinks extends JavaPlugin{ @Override public void onEnable(){ getLogger().info("Drinks has been ENABLED!"); } @Override public void onDisable(){ getLogger().info("Drinks has been DISABLED"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if(commandLabel.equalsIgnoreCase("coke")){ Player player = (Player) sender; player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 1200, 2)); player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1200, 2)); player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 600, 2)); }else if(commandLabel.equalsIgnoreCase("sprite")){ Player player = (Player) sender; player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 1200, 2)); player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1200, 2)); player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1200, 2)); }else if(commandLabel.equalsIgnoreCase("coorslite")){ Player player = (Player) sender; player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 600, 1)); player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100, 1)); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1200, 2)); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 1200, 1)); }else if(commandLabel.equalsIgnoreCase("yuengling")){ Player player = (Player) sender; player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 600, 1)); player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 100, 1)); player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 200, 1)); } return false; } } Here is my plugin.yml name: Drinks main: me.pieman.drinks.Drinks version: 1.0 Description: A plugin that allows you to drink all of your favorite beverages. commands: drink coke: description: Drink a bottle of coke default: true permission: drink.coke permission-message: You don't have permission! drink sprite: description: Drink a bottle of sprite default: true permission: drink.sprite permission-message: You don't have permission! drink coorslite: description: Drink a bottle of coors lite default: true permission: drink.coorslite permission-message: You don't have permission! drink yuengling: description: Drink a bottle of yuengling default: true permission: drink.yuengling permission-message: You don't have permission! If you know what is wrong please help me
Here is something that I used in one of my other plugins. Code:java public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender instanceof Player) { Player player = (Player) sender; if (cmd.getName().equalsIgnoreCase("join")) { if (args.length == 1) { if (args[0].equalsIgnoreCase("red")) { redteam.add(player.getName()); blueteam.remove(player.getName()); sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Red team!"); } else { if (args[0].equalsIgnoreCase("blue")) { blueteam.add(player.getName()); redteam.remove(player.getName()); sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "You have joined the Blue team!"); } if (args[0].equalsIgnoreCase("game")) { crossServer(player); } } } else { sender.sendMessage(ChatColor.AQUA + "[Siege] " + ChatColor.RED + "Usage: /join red; /join blue"); } } } return false; }