Client-sided (per-player) virtual blocks for Paper, designed as an embeddable library for high-scale private mines.
- Paper 1.21.4+
- Java 21
- PacketEvents installed on the server (or shaded by your plugin)
<dependency>
<groupId>codes.kooper</groupId>
<artifactId>blockify</artifactId>
<version>2.0.0</version>
</dependency>PacketEvents and Paper API are provided — your plugin must depend on PacketEvents at runtime.
public final class PrisonPlugin extends JavaPlugin {
private Blockify blockify;
@Override
public void onEnable() {
blockify = Blockify.create(this);
blockify.enable();
Stage mines = blockify.stages().create(
"privatemines",
world,
new BlockifyPosition(minX, minY, minZ),
new BlockifyPosition(maxX, maxY, maxZ)
);
// Per player:
Pattern border = new Pattern(Map.of(Material.BEDROCK.createBlockData(), 1.0));
Pattern ores = new Pattern(Map.of(
Material.STONE.createBlockData(), 70.0,
Material.COAL_ORE.createBlockData(), 30.0
));
PlayerMineViews views = mines.createPlayerMine(player, border, ores);
views.border().setBreakable(false);
views.mine().setBreakable(true);
views.fillInitialMine(21); // walls+floor, side air gap open at top, bedrock top from walls to stage edge
views.show();
}
@Override
public void onDisable() {
if (blockify != null) {
blockify.disable();
}
}
}- Stage — shared world AABB (one region for all private mines)
- View — per-player layer (
border,mine) with its own subscribers - Mutations and digs only affect view subscribers, never the whole stage audience
Listen for BlockifyBreakEvent, BlockifyInteractEvent, PlayerEnterStageEvent, PlayerJoinStageEvent, etc. on the host plugin.
Blockify 2.0 is a library. Do not install the JAR as a server plugin; embed it in your plugin and call Blockify.create(this).