-
-
Notifications
You must be signed in to change notification settings - Fork 45
Blueprint Packs for Developers
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.
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:
Once in there, the pack will load automatically for all the users of your mod.
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 (
As long as you give the pack a valid java nio Path pointing to your pack root, your pack will be available ingame.
At this moment, there is a series of special blueprint anchors interfaces with special behavior (you can find the interfaces .
If your block implements these interfaces they can influence the following:
Allows the block to toggle visibility in the list of blueprints displayed to the client.
Bunches together files with the same anchor + ending in a number "name1.blueprint, name2.blueprint, etc" and then displays a number picker.
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.
Allows you to create special requirements that have to be fulfilled before placement (e.g. the anchor block as an item in the inventory).
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.