Hello everyone, i want to generate a wall in front of player, where it is facing, so i don't know how can i do it. Does anyone can help me? Here is my code: Code: double x1 = p.getLocation().getX(); double y1 = p.getLocation().getY(); double z1 = p.getLocation().getZ(); double x; double y; double z; for (x = x1; x < x1 + 7; x++) { for (y = y1; y < y1 + 2; y++) { for (z = z1; z < z1 + 1; z++) { Location loc = new Location(p.getWorld(), x, y, z); Block b = loc.getBlock(); b.setType(Material.PORTAL); warderPortal.add(b); b.getWorld().playEffect(b.getLocation(), Effect.PORTAL, 4); Bukkit.getScheduler().scheduleSyncDelayedTask(kHungerBukkit.getInstance(), new Runnable() { @Override public void run() { b.setType(Material.AIR); } }, 5 * 20);
@darknoneee You can use this method to get the BlockFace. Afterwards, you can use Block#getRelative(BlockFace, int) to get the block a distance away in that direction.