Tie your own mod into Blockgame+ with these public, versioned hooks. Add Blockgame+ as an optional dependency and your mod still runs standalone without it.
A "room" is a sealed build with a trigger block. A player builds it, right-clicks the trigger, and Blockgame+ scans the room and hands you the result - open a screen, run an action, anything. The trigger has to be a block that opens a screen server-side (a container, smithing table, furnace, and so on): that open is what we intercept.
build.gradle:
modImplementation files("libs/bgplus-2.4.0.jar") - it stays a separate mod your
users install, and Loom remaps it to your mappings with no transitive dependencies.bgplus:rooms entrypoint pointing at a BgplusRoomProvider.RoomType with a trigger block, a room signature, and an on-open action.// fabric.mod.json "entrypoints": { "bgplus:rooms": ["com.you.MyRooms"] } // MyRooms.java public class MyRooms implements BgplusRoomProvider { public void registerRooms(RoomRegistry r) { r.register(RoomType.builder("mymod:forge") .trigger(Blocks.BLAST_FURNACE) .signature(room -> room.sealed() && room.count(Blocks.NETHERITE_BLOCK) > 0) .onOpen(ctx -> Minecraft.getInstance() .setScreen(new MyForgeScreen(ctx))) .build()); } }
API version 1 · requires Blockgame+ 2.4.0 or newer · client side. The
RoomView your signature receives exposes sealed(),
count(block), bookshelves(), hasOutline(),
containers() and the room bounds.
Make your own mod's HUD widget draggable and scroll-to-resize inside Blockgame+'s
HUD Layout editor (/bgplus hud), right alongside ours. Blockgame+ stays optional -
guard the integration behind a mod-loaded check and your mod still runs standalone.
modCompileOnly files("libs/bgplus-2.4.0.jar") - Loom remaps it, and Yarn mods get
the Yarn types (MinecraftClient / DrawContext) automatically.EditableWidget (store your position as screen fractions 0..1) and
register it once at client init, behind an isModLoaded("bgplus") guard.// only when bgplus is present (keep this in its own class) if (FabricLoader.getInstance().isModLoaded("bgplus")) { HudEditorRegistry.register(new EditableWidget() { public String id() { return "mymod:my_widget"; } public int[] bounds(Minecraft mc) { return new int[]{ x, y, w, h }; } public void render(GuiGraphics g, Minecraft mc, boolean preview) { /* draw it */ } public void setPositionFraction(float fx, float fy) { /* store fractions */ } public void save() { /* persist on editor close */ } }); } // first line of your live HUD render, so the widget doesn't double up: if (HudEditorRegistry.isEditorOpen()) return;
Types are in cody.bgplus.client.hud. Every method is called defensively,
so a bug on your side can't crash our editor. Optional overrides: displayName(),
enabled(), scale() / setScale() for scroll-resize.
Smaller extension points, same optional-dependency setup
(modCompileOnly files("libs/bgplus-2.4.0.jar"), guarded by
isModLoaded("bgplus")):
blur.json): BlurCompat.registerExternalScreens("com.you.gui.MyScreen").FlatButton, ScaledFlatButton and
VaultStyle (in cody.bgplus.client.gui) are stable, reusable widgets
for buttons and vault-style panels in the Blockgame+ house style.Seal a room with a smithing table, an anvil, and a gold block. Right-click the table to open your gear vault.
Seal a room with 3 or more bookshelves and a polished-blackstone-brick or chiseled-stone-brick outline, plus a barrel named "altar" to open it.