Skip to content

Blueprint Packs for Developers

Raycoms edited this page Jul 30, 2022 · 3 revisions

So you're a developer and you want to use the Structure-Pack API. I'll divide the guide into three parts:

  • You want to ship blueprints with your mod.
  • You are implementing a mod that has special blueprint blocks.
  • You are implementing a mod that queries blueprints.

Shipping Blueprints

Let's start with the easiest of the three. If you want to ship blueprints with your mod you have to package them in a Blueprint-Pack. For more details on how to make a Blueprint-Pack check out this. Once you have packaged the Blueprint-Pack you want to create a "blueprints/modid" folder inside your "resources" folder (right next to assets and data).

Like in this example:

image

Once in there, the pack will load automatically for all the users of your mod.

But if I want more?

Case you want to drop your blueprints in another location, inside a datapack or similar, this is also possible. All you have to do is to register your Blueprint-Pack metadata in the StructurePacks.java (here

As long as you give the pack a valid java nio Path pointing to your pack root, your pack will be available ingame.

Special Blueprint Blocks.

At this moment, there is a series of special blueprint anchors interfaces with special behavior (you can find the interfaces here.

If your block implements these interfaces they can influence the following:

Invisibility

Allows the block to toggle visibility in the list of blueprints displayed to the client.

Leveled

Bunches together files with the same anchor + ending in a number "name1.blueprint, name2.blueprint, etc" and then displays a number picker.

Named

Displays the name your anchor dictates instead of the file name in the UI. Also bunches together those that report the same name and shows an alternative picker.

Requirements

Allows you to create special requirements that have to be fulfilled before placement (e.g. the anchor block as an item in the inventory).

Special Creative Handler

Some blocks might require special handling when placed (e.g. place the anchor first, use a structure placement handler, etc) The block implementation can define all of this.

Query Blueprints