3D Regions

Since 1.0.0

3D regions can be created with the Region3D class, they are coded as an extension of the 2D regions to include the y axis, so make sure you understand them before reading this.

Creating 3D regions

Pretty straight forward if you already know how to create 2D regions, just include the y axis.

World world = Bukkit.getWorld("world");

// By coordinates: x1, y1, z1, x2, y2, z2
Region3D region = new Region3D(world, 5, 0, 5, -5, 10, -5);

// By locations: loc1, loc2
Location loc1 = new Location(world, 5, 0, 5);
Location loc2 = new Location(world, -5, 10, -5);
Region2D region = new Region2D(loc1, loc2);

Here is a representation of this region in-game

Last updated