Skip to content

Structure Mod Author Guide

beeboee edited this page Aug 18, 2026 · 1 revision

Structure-Mod Author Guide

You can ship optional Biblio support from your own mod with one small sidecar JSON file. You do not need Java integration code, and you do not need to replace or alter your normal loot table.

1. Identify your loot table IDs

Use the IDs of the loot tables assigned to your structure's containers. Do not use the structure ID unless it happens to be identical.

For this resource:

data/yourmod/loot_table/chests/sunken_library.json

the target ID is:

yourmod:chests/sunken_library

If your structure uses separate common, treasure, or basement tables, list all tables that should receive Biblio books.

2. Add a sidecar integration

Ship a file such as:

src/main/resources/data/yourmod/biblio/loot_integrations/sunken_library.json
{
  "targets": [
    "yourmod:chests/sunken_library",
    "yourmod:chests/sunken_library_treasure"
  ],
  "any_tags": ["ocean", "maritime"],
  "exclude_tags": ["desert"],
  "rolls": {"min": 1, "max": 2},
  "chance": 0.7
}

The first yourmod is the resource namespace containing the sidecar. Each target ID may use any namespace.

3. Keep Biblio optional

Do not add Biblio as a required dependency solely for this sidecar. Without Biblio, the file is not read by Biblio and your normal loot table continues to work.

If you advertise compatibility, state the minimum Biblio release that includes the tag-driven integration API. At this documentation snapshot, the verified API existed on a feature branch and was not yet on the public default branch.

4. Choose stable selectors

  • Use semantic tags for broad themes.
  • Use all_tags for essential characteristics.
  • Use exclude_tags to remove tone or setting mismatches.
  • Use works only for a deliberate exact-title collection.
  • Keep rolls conservative because integrations from several mods or datapacks are additive.

Example for an observatory that wants nonfiction science:

{
  "target": "yourmod:chests/observatory",
  "any_tags": ["science"],
  "all_tags": ["nonfiction"],
  "rolls": 1
}

Example for a haunted library:

{
  "target": "yourmod:chests/haunted_library",
  "any_tags": ["gothic", "horror", "afterlife"],
  "exclude_tags": ["comedy"],
  "chance": 0.5
}

5. Test both configurations

With Biblio installed:

  1. Run /reload and check logs for parsing errors or zero-match warnings.
  2. Generate the structure or open an ungenerated target container.
  3. Confirm Biblio books are added and your original loot remains intact.
  4. Confirm /biblio disable settings are honored.

Without Biblio installed:

  1. Start the mod normally.
  2. Generate the same structure.
  3. Confirm its native loot behaves normally.

For every supported field, see Data-Driven Loot Integration API.

Clone this wiki locally