Adding Custom Structures: Example structure - Silverminer007/Shrines GitHub Wiki
In last chapter got over how to add a custom structure. There was a list with things to do, but everything was very abstract, so here is a small example:
- Adding a new structure with the name "house"
- It should be generated
- It should spawn at every possible place, so we set "spawn_chance" to "1.0"
- It shouldn't be varianted
- It should spawn every 12 - 30 chunks
- It should only spawn birch forests
- Actually we have only one part of the structure (We will go later over to have more)
- We have to build our structure "house"
- We had decided how our structure should be called. So we will use "house" later on
- Now we have to export our builded structure to a file that should have to name "house.nbt". To do this we will use the "Structure block" of minecraft. To explain how to use the structure block would go beyond the scope of this tutorial, so here is an external link. You can search for other tutorials online too
- Now we restart Minecraft again and create a new world to set up our "house"
- It's important that you've startet Minecraft at least one time with this mod to generate all needed files
- Creating a new world isn't needed but is recommended to prevent old worlds to trouble, because of changes on the structures. After finally setting up the structures, you can play old worlds with the new structures
- Removing a structure will cause old world to stop saving, use "/shrines-structures configure |name| generate false", to diable spawn, but still allow saving old worlds
In this tutorial, i've decided to use the command way. Generally it's recommended to use the command way before using the manual way sometimes to look in the generated files and learn how to do manually
- First we want to add the structure with default settings. To do this we use
/shrines-structures add house
because "house" is the name of our structure. Use/shrines-structures query
to see all custom structures. Your one should be listed - Now we can use
/shrines-structures configure house
to change the settings of our structure. Let's now go over the things we wish the structure to do (On top of this tutorial)
- The structure should be generated -> this is the defaultly the case, when adding a new structure. If you want to change this setting you use
/shrines-structures configure house generate false/true
- It should spawn at every possible place -> We need to set "spawn_chance" to 1.0 (The chance ranges from 0 - 1, while 0 means no generation and 1 means every place where possible). To set the "spawn_chance" we can use the
configure
option again. In our case the command will end in/shrines-structures configure house spawn_chance 1.0
- We want the structure not to variant from place to place, so we turn "use_random_varianting" off. To do this we use
/shrines-structures configure house use_random_varianting false
- To make the structure appear every 12-30 chunks, we have to set two options:
seperation
for min. anddistance
for max. value. So the two commands to use are in our case:/shrines-structures configure house seperation 12
and/shrines-structures configure house distance 30
- The next action is a bit tricky, but not complicated: We want to have a whitelist of structure, but we can't have one; We only have a whitelist per category and a blacklist per biome. So here comes the trick: We add to the whitelist only "FOREST" and blacklist every biome that has the category "FOREST", but isn't birch forest. To do this we use the following commands: First we set the Category using
/shrines-structures configure house categories FOREST
(Seperate multiple Categories with ",") and then blacklist every other biome:/shrines-structures configure house blacklist [minecraft:forest, minecraft:flower_forest, minecraft:dark_forest_hills, minecraft:dark_forest]
- We should now be done with configuring our structure. Use
/shrines-structures query house
to see full specifications of your structure - Now you should close Minecraft (Quit the game) and navigate to your Minecarft Directory. Open up the path
<Mc Dir>/saves/<Name of your structures world>/generated/minecraft/structures/
and search for yourhouse.nbt
file. Copy this file and go back to your minecraft directory. Now open up<Mc Dir>/shrines-saves/shrines/house/
. Paste here your house.nbt file and rename it to "resource.nbt" - Start Minecarft again and open up / create a world and type
/locate shrines:house
. You should now get the location of the nearest version of your structure. Click on the green brackets to teleport. Here we go!
Now were done adding our own structure to Minecarft worlds! Actually we can add small structures and make them appear in our worlds. But what if we have bigger structures? To do this, we have to add multiple pieces to our structure that all have different offsets and points on different piece files (*.nbt files), but all in order:
- First you have your big structure. Export this to *nbt files. You will note, that structure that are at least one dimension larger that 48x48x48 can't be saved in one file. So you have to save it in two files. It's important that you remember the distance between the two bottom-left-front structure blocks. Later this will be called "offset"
- Copy these two files to
<Mc Dir>/shrines-saves/shrines/house/
to continue with our example above - It's more easy to add a new piece using the manual way, so we will use this here. Open up the file "house.txt". Note the extension ".txt". Search here for the line
pieces:[[resource,[0,0,0]]];
. This is may a bit different, if you have changed this before, but imprtant is the start "pieces:". This line holds a list (Indicated by the brackets []) of objects (indicated by the second [] brackets). The object, which is there right now, holds multiple information:
- the name of the *.nbt file is "resource.nbt" (The extension will be added automatically)
- The offset of this piece is x = 0, y = 0, z = 0
- Now we want to a second piece. It should be in the list of pieces, so we put it inside the list of pieces. Seperate the pieces by "+". The line will end up in
pieces:[[resource,[0,0,0]]+[resource2,[0,0,0]]];
. Your resource files would have the be named as "resource.nbt" and "resource2.nbt". Right now the pieces are placed in each other, because they are both on [0,0,0]. We will change this by adding the offset of point 1. Assuming that your offset is [10,0,10] the line will end up inpieces:[[resource,[0,0,0]]+[resource2,[10,0,10]]];
- Start Minecarft now (You have to start it after saving the config file), join a world and try to find your structure with
/locate shrines:house
or/locate shrines:<name of your structure>
to give the general command to find structures - Adding more pieces is now very strange forward. E.g. 3 pieces would be
pieces:[[resource,[0,0,0]]+[resource2,[0,0,0]]+[resource3,[0,0,0]]];
and so on. Note that you have to restart Minecarft (Really Quit the game) everytime you change something on the configuration
As you have seen adding multiple pieces isn't hard to do. So be creative now and add your own structures