So i have this: Code: if(event.getPlayer().getLocation().getX() >= locx && event.getPlayer().getLocation().getX() <= locx1 && event.getPlayer().getLocation().getY() >= locy && event.getPlayer().getLocation().getY() <= locy1 && event.getPlayer().getLocation().getZ() >= locz && event.getPlayer().getLocation().getZ() <= locz1 ) But when I try and run my code and get out of the region it still triggers, why
Your if statement looks good. Try adding a line before the if statement. Code: System.out.println("debug: " + locx + "-" + locx1 + ", " + locy + "-" + locy1 + ", " + locz + "-" + locz1); if( event.getPlayer().getLocation().getX() >= locx && event.getPlayer().getLocation().getX() <= locx1 && event.getPlayer().getLocation().getY() >= locy && event.getPlayer().getLocation().getY() <= locy1 && event.getPlayer().getLocation().getZ() >= locz && event.getPlayer().getLocation().getZ() <= locz1 )
when I call a command, if the player is inside a specified region it should allow it, otherwise it will say "You are not allowed to use that here" --- merged: Jan 24, 2011 9:42 PM --- Heres what it spit out (with an extra get player location debug: 2-50, 15-100, 16-36-Location{world=CraftWorldx=54.48166639522478y=70.0z=36.2788494138605pitch=44.54996yaw=316.19986}