--- title: "For mod developers - BuildPrint wiki" description: "What other mods can do with BuildPrint, and how to call it without making it a requirement." url: https://voxelsprout.com/buildprint/wiki/api --- [BuildPrint](https://voxelsprout.com/buildprint) [Wiki](https://voxelsprout.com/buildprint/wiki)For mod developers # For mod developers What other mods can do with BuildPrint, and how to call it without making it a requirement. BuildPrint has five public APIs, all in the package `com.buildprint.api` and all on the client. The examples use the Mojang names of Minecraft 26.x. | API | What it is for | Since | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------ | | [BuildprintBlueprints](https://voxelsprout.com/buildprint/wiki/blueprints-api) | Keep a blueprint for your mod: builds your mod makes show up in BuildPrint as a build to follow. | 0.1.12 | | [BuildprintPlacements](https://voxelsprout.com/buildprint/wiki/placements-api) | Read the loaded builds: where they are, what they want at a block, progress and materials. | 0.1.17 | | [BuildprintHud](https://voxelsprout.com/buildprint/wiki/hud-api) | Hide BuildPrint's panels while your own screen-filling tool is open. | 0.1.17 | | [Editor API](https://voxelsprout.com/buildprint/wiki/editor-api) | Add tools, buttons and drawings to the editor. | 0.1.17 | | [Format API](https://voxelsprout.com/buildprint/wiki/format-api) | Teach BuildPrint another schematic file format. | 0.1.17 | Only that package is kept stable. Everything else in BuildPrint can change in any release, so a mixin into those classes will break sooner or later. ## Keep BuildPrint optional BuildPrint is client-side, and most players of your mod will not have it. Two ways to call it without making it a requirement: * Check `FabricLoader.getInstance().isModLoaded("buildprint")`, and keep the calls in a class of their own, so BuildPrint's classes only load when it is there. * Or call it by reflection. `BuildprintBlueprints`, `BuildprintPlacements` and `BuildprintHud` take only Java types (`String`, `int`, arrays, `Map`, `java.util.function`), so there is nothing to compile against. See the [example](https://voxelsprout.com/buildprint/wiki/blueprints-api#without-a-compile-dependency). The editor and format APIs have you implement BuildPrint's interfaces, so they need the jar to compile. An editor add-on registers through a Fabric entrypoint, which Fabric only calls when BuildPrint is installed, so your mod still runs without it. Client initializer ```java public final class MyModClient implements ClientModInitializer { @Override public void onInitializeClient() { if (FabricLoader.getInstance().isModLoaded("buildprint")) { BuildprintCompat.init(); } } } // A class of its own: BuildPrint's classes only load when it is there. final class BuildprintCompat { static void init() { BuildprintHud.hideWhile("mymod", MyTool::isOpen); } } ``` ## Compiling against it BuildPrint is on [Modrinth](https://modrinth.com/mod/buildprint), so the Modrinth Maven works. One file covers both Minecraft versions, so the version number as Modrinth shows it is enough, `+26.x` included. `build.gradle` ```gradle repositories { maven { url = "https://api.modrinth.com/maven" } } dependencies { // 0.1.17 or newer, as Modrinth lists it. compileOnly "maven.modrinth:buildprint:0.1.17+26.x" } ``` BuildPrint is a Fabric mod for Minecraft 26.2 and 26.3\. It is client-side only, so call it from client code, on the client thread. ## Questions Something the API should do, or something that does not work: ask on [Discord](https://discord.gg/CvdkGbEW4y). [Previous Bug reports](https://voxelsprout.com/buildprint/wiki/bug-reports) [Next Blueprint API](https://voxelsprout.com/buildprint/wiki/blueprints-api) Something missing or wrong on this page? Say so on [Discord](https://discord.gg/CvdkGbEW4y).