Skip to main content

Multiple else statements

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
EvilKittyCat123
Offline
Joined: 2014-05-19

Hey, I have a small problem, and I need some help solving it. I am trying to make a config option true/false, but for that I need an else statement. But the thing is that I have already used one. I know that it is possible to use 2 else statements, but I am not quite sure how. Please help me, here's my code:
}

@EventHandler
public void onPlayerDrop(PlayerDropItemEvent evt) {
Player player = evt.getPlayer();
if(player.hasPermission("nodrop.bypass")) {
evt.setCancelled(false);
} else {
evt.setCancelled(true);
{

if(getConfig().getBoolean("DropMessage"));
player.sendMessage(getConfig().getString("MessageOnDrop").replace("&", "§"));
} else {
end

}

I am making a Bukkit Plugin.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ravidamarla
Offline
Joined: 2014-06-09

use elseif{} statement and at finally else{} statement
for more details about else stattement visit below website
http://www.tutorialsera.com/control-statements/

EvilKittyCat123
Offline
Joined: 2014-05-19

bump