BlockTracker is a powerful Minecraft lib that provides a comprehensive API for tracking and monitoring specific blocks across your world. Designed primarily for mod developers, it offers efficient block position storage, retrieval, and event handling with minimal performance impact.
// Track blocks with custom conditions
// Recommended init place: ServerAboutToStartEvent
BlockTrackerApi.trackBlock(Blocks.BEACON, true, block -> {
return customConditionCheck(block);
});
// Get blocks in specific chunk
LongSet blocks = BlockTrackerApi.getTrackedBlocks(level, chunkPos, Blocks.BEACON);
// Get blocks in area around position
ObjectList<LongSet> areaBlocks = BlockTrackerApi.getTrackedBlocks(level, centerPos, 3, Blocks.BEACON);
Note: This mod is primarily intended for developers. End-users will need mods that implement BlockTracker API to see its benefits.