Code:java final int ID; p.setExp(1);ID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {public void run() {p.setExp(p.getExp() - 0.1);if (p.getExp() == 0) {p.setVelocity(new Vector(0, 1, 0)); // just some fun codeBukkit.getScheduler().cancelTask(ID);}}}, 0, 2) or something like that and then just set the players xp to 0.1 less
PizzaPixel Well first we set the players xp to 1. Then we start a repeating timer and assign it id. every 2 ticks the players xp bar will be set to 0.1 xp less and if the xp of the player is 0 we cancel the task and then do some stuff with the player. Note sure if the code works though, i havent tested it yet oh, and btw you need to define the ID variable in the top of your class
MCPvPCraft kk MCPvPCraft What does p equal??? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Well, sorry, I can't explain everything.. Try out this post by @Adamki11s https://forums.bukkit.org/threads/plugin-development-a-huge-tutorial.15167/
PizzaPixel well it doesn't looks like you know how to, because you just asked me what a player is and how to define it lol
MCPvPCraft I think he was asking in the specific code you gave him, what can be used as a representation of p. But I completely agree PizzaPixel If you are bored and aren't thinking, stop coding. You need an open-mind: We can't (and won't) just spell everything out.
AoH_Ruthless Lol Im just gonna go eat so Bye AoH_Ruthless Crap I have nothing left in my fridge what should i do EDIT by Moderator: merged posts, please use the edit button instead of double posting.
PizzaPixel Not go farther and farther off-topic from what the purpose of this thread was (imo worse than just saying bump)!
PizzaPixel Code: public static void expTimer(int time){ for(Player p : Bukkit.getOnlinePlayers){ p.setLevel(time); } }