hey i'm working on a custom plugin for my server and it's working fine but i want to do it like this: When you type /fly and your flying is not enabled you will be enabled to get flying And when you type /fly agian It will basiclly stop flying And when i typ /fly it will start all over agian. So in short words: Typ /fly - Start flying typ /fly agian stop flying I do know how to make them fly but only with /fly and /stopfly
Well if you have a two way function for /fly , that means you must've put in in yourself. Because you can just do player.setAllowFlight(boolean); [where boolean = true / false ] ?? Can i see your code, I can fix.
Code:java if (p.isFlying()) {p.setAllowFlight(false);p.setFlying(false);} else {p.setAllowFlight(true);p.setFlying(true);} Remember to cast the sender to a Player like this Code:java Player p = (Player) sender;