Anyone know how to make a command similar to /f map. I have made my own plugin similar to factions and am confused about how to get all the chunks around a player who types the command and send it in a message format.
I would do something like this: Code: Player player = (Player) sender; World world = player.getWorld(); Location location = player.getLocation(); for(int x = -4; x <= 4; x++) { for(int z = -4; z <= 4; z++) { Chunk chunk = world.getChunkAt(new Location(location.getX() + (x*16), location.getY(), location.getZ() + (z*16))); } } You should be able to grab every chunk in a 4 chunk radius around the player (unless I did something wrong). It's a start anyway
@0-o Yeah mate that's the way I was thinking. My issue is more about formatting. How do you turn that into a message that is reflective of where the chunks are. I can't think of any good way of doing this way more than a few chunks.
@Coopah Maybe you could use StringBuilder and append 1 box (if you want the chunks as boxes in the message), then check the length, if it's more than the amount of 4 (in case of 4*4) then make a new line before adding the next box.