you are missing a lot of brackets in your if statement, did you even read Kris' comment
|
you are missing a lot of brackets in your if statement, did you even read Kris' comment
http://prntscr.com/jtwksv
This is the line below, sorry I thought I posted a different screenshot
could you copy paste the code inside code tags please, not the bottom part, tbh your ide should tell you
that you're missing a bracket above
If your code is unreachable, then you most likely have your next command (that if statement) underneath, directly underneath a return. You can't place code underneath a return because that code will never execute, hence "unreachable code".
http://prntscr.com/judkanCode:if (command[0].equalsIgnoreCase("wildy2") || (player.getInventory().contains(15643) || player.getInventory().contains(15640) || player.getEquipment().contains(15643) || player.getEquipment().contains(15640))) { player.getPacketSender().sendMessage("You can't take custom Armour/Weapons in here!"); return;//this } else { TeleportHandler.teleportPlayer(player, new Position(3104, 5537), player.getSpellbook().getTeleportType()); return;//this } if (command[0].equalsIgnoreCase("abbadon")) { TeleportHandler.teleportPlayer(player, new Position(2496, 5175, 0), player.getSpellbook().getTeleportType()); }
http://prntscr.com/judkg1
What Goody said is exactly the case here, the first if checks a condition and if it doesn't match that condition it will always go to else and here you return out of the method meaning it can never reach the code below this return resulting in unreachable code. Try removing the return statements, change things around and see what happens
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |