So you're enabling it if the command is /drops, and disabling if it isn't? I don't think that's what you meant to do.
Something like this? Code:java public boolean onCommand(CommandSender sender, Command cmd, String CommandLabel, String[] arg) { if (sender.hasPermission("kits.dropstoggle")) { if (cmd.getName().equalsIgnoreCase("drops")) { if(this.Drops1 == true){ this.Drops1 = false; sender.sendMessage(ChatColor.WHITE + "Drops are now " + ChatColor.RED + "Disabled.");}else { this.Drops1 = true; sender.sendMessage(ChatColor.WHITE + "Drops are now " + ChatColor.RED + "Enabled."); } } return true; }
elementalgodz11 If you do not mind me asking what is the purpose of this plugin. And also did you import the event into your main class?
elementalgodz11 instead of a boolean, use a hashmap/arraylist and just store the player's name if they want drops on then if they try to drop something check if their name is within the arraylist / hashmap.
elementalgodz11 Your if statements are nested to where the drops will not be set to true unless Drops1 is equal to true and Drops2 is false. Try setting Drops1 and 2 to true if Drops1 is false. For example, Code:java if (this.Drops1 == true) { this.Drops1 = false; if (this.Drops2 == true) { this.Drops2 = false; sender.sendMessage(ChatColor.WHITE + "Drops are now " + ChatColor.RED + "Disabled."); }} else { //If Drops1 != true run this code this.Drops1 = true; this.Drops2 = true; sender.sendMessage(ChatColor.WHITE + "Drops are now "+ ChatColor.RED + "Enabled.");}
If you want them to be disabled first do this. Code:java boolean Drops1 = false; boolean Drops2 = false; Instead of: Code:java private boolean Drops1 = true; private boolean Drops2 = true;