Is it possible to do a for loop in Java? If you know Lua, you know what I mean. It's like for i=1, 10 do, and it just does i = 1+1 until it gets to ten. Example: for(i=1, 10) -- for every tick, add 1 to i=1 until i ='s 10 It's a bit confusing, and also Is it possible to use getPositition().getX() + i?
Code:java for(int i = 0; i < 10; 1++){// code here} Will loop ten times. Adds 1 to i every loop, and stops when i is less than 10. I suggest learning Java a bit more... EDIT: Oops, fixed the for loop, such a stupid error
Sorry. I should look up more. Anyways, thanks. Edit: It's trying to convert a int to boolean, thus erroring. Any suggestions, or should I just go look this up? Edit: I got it. Just snagged the one from Oracle
Your syntax is wrong, should be Code: for (int i = 0; i < 10; i++) { // inside loop here } actually it stops when i is not less than 10.... i.e. 10 or more including 10.
Might want to look over that for loop again... here's one that would stop when i is less than 10... for (int i = 20; i >= 10; i--) { }
because people trying to make plugins should have a decent grasp on java first as not to waste our time on this when we could be helping people that are having Bukkit related programming questions