Hi, I'm the spleef arena plugin and I have a problem with setting negative coordinates. He told me someone would please how? Here is my code Code: public class CountdownCommandExecutor2 implements CommandExecutor { public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { final Player player = (Player)sender; if(cmd.getName().equalsIgnoreCase("podkopsnow") && sender instanceof Player) { for(int x = 100; x<110; x++) { for(int y = 100; y<110; y++) { for(int z = 100; z<110; z++) { Location location = new Location(player.getWorld(), x, y, z); location.getBlock().setType(Material.SNOW_BLOCK); } } } } return true; } } I would like to set negative x coordinate and do not know how to do it.
I need to coordinate both were negatively for(int x = -100; x<-110; x++) and this does not work for or example first position is x: -100, y: 100, z:100 the second position is -110, y 100, z:110
Code:java for(int x = -100; x < 110; x++){ for(int y = 100; y < 100; y++){ //however this isn't needed because the y is always 100 (from what you said above) for(int z = 100; z < 110; z++){ //set the block with coords x, y, z. } }}
I need this to have negative coordinates. When I enter the code you wrote to me so I create a single point in the negative and the other positive .. for(int x =-100; x <110; x++){ x<110 I need to put in a negative x<-110 this does not work I need to make a square for which you will have both coordinates x in the negative sorry for the English, I am from Czech Republic
Sicka_gp maybe surround it in parentheses? x < (-110)? Although for the loop to function the int has to be anything below -110.
Code: for(int x = -100; x<(-110); x++) { for(int y = 100; y<110; y++) { for(int z = 100; z<110; z++) { Location location = new Location(player.getWorld(), x, y, z); location.getBlock().setType(Material.SNOW_BLOCK); } does not work I enter the command and nothing happens