PizzaPixel Create a new BukkitRunnable and define the integer x within it. For every player you are making the countdown for, set there xp level to int x. Then, have the BukkitRunnable loop once every 20 ticks (1 second, changeable). When x is equal to 0, cancel the BukkitRunnable, set there xp level to 0, and do something.
ShadowLAX So it would be like this ? Code:java final int ID; p.setExp(30);ID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {public void run() {p.setExp(p.getExp() - 0.1);if (p.getExp() == 0) {Bukkit.getScheduler().cancelTask(ID);p.sendmessage( "Your cool")}}, 0, 2)
PizzaPixel You could do it like that, but the setExp() method sets individual xp that makes up a level. Also, I don't approve of double posts.
ShadowLAX Lol sorry about the double post its because i was tired ShadowLAX What do you mean by the setExp() method sets individual xp that makes up a level and how would i fix that?? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
PizzaPixel Are you kidding me??? Why are you double posting this whole entire thread?( http://forums.bukkit.org/threads/xp-countdown.248356/#post-2356147 ) You literally just took a code that worked from MCPvPCraft and passed it as your own, asking another if it works. You just wasted the time of ShadowLAX and everyone else who went through and read this. Overall, I am just trying to say you shouldn't be asking for help or coding until you develop some maturity.
AoH_Ruthless You think i Shouldn't code well guess what im gonna code till my server becomes popular.
AoH_Ruthless Because theres no way you can ask for some big help with something your confused without getting said 'You Should Stop coding' or "LEARN JAVA" HyrulesLegend Lol EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Learn Java.. honestly Bukkit is an API for Java, if you don't know Java you won't be going anywhere..
Don't take it the wrong way. I'm not telling you to give up coding and never say the word 'Java' again. I have no idea about how much you know Java. You could be working at Sun Microsystems, but you obviously aren't. You don't have the mindset a coder needs: You lack a work ethic, maturity, and integrity. You need to learn to do things yourself. A real coder knows spoonfeeding is never the solution. I never told you to "LEARN JAVA" or "Stop coding" if you look at any of the threads I post in. I told you to take a break because you kept saying you are "tired" or "forget what [your] plugin is..". The Bukkit forums is one of the nicest forum communities I've seen because it overall lacks the qualities you've displayed (at least in recent hours): Arrogance and Immaturity. So please, just take to heart what everyone is saying because it will make you a better developer and maybe a better person! I'm not trying to be mean or come across as rude, but I'm not going to lie to you. Edit: PizzaPixel Edit2: The reason everyone is so doubtful of your acclaimed skills is because of my college thesis I've written just now. Also, the help you are asking for isn't completely Bukkit based. You are asking people to spell out answers for you ("how can I fix setExp()?"). Developers (imo) should know to actually try and figure it out (google, searching on the forums, etc..).