CommandStructures

CommandStructures

3.6k Downloads

Custom structures made with structure blocks are not able to be spawned

Goldenlion5648 opened this issue · 5 comments

commented

After making a custom structure and saving with a structure block, the structure is not able to be spawned in with /spawnstructure

commented

/spawnstructure is for spawning from template pool json. Which are loaded by datapacks or a mod's data folder at world load. The structure block creates the structure nbt file itself which can be spawned by the /spawnpieces command.

Basically, nbt files are the pieces. Template pools tell how the pieces (with jigsaw blocks inside) how to assemble and create the jigsaw structure.

The readme on my structure tutorial mod has some helpful links and pics that may help
https://github.com/TelepathicGrunt/StructureTutorialMod/tree/1.18.x-Forge-Jigsaw

let me know if you're still confused.

commented

Would it be possible to either write out or make a video (intended for future users of the mod) to show how to generate custom made structures with this mod? Personally I'm a bit confused since the link you gave is intended for adding structures to a mod, not modpack/ datapack

commented

Command Structures mod isn’t for generating during worldgen. It’s more for debugging jigsaw structures that a person is making before they make it actually spawn in the world by another mod or datapack.

The link I provided has a video in the readme about how jigsaw structures work and how to make them. To spawn them in a world by datapack, you need to replace a vanilla jigsaw structure (village, outpost, or bastion) entirely. 1.18 did not expose the structure <=> biome connection so you can’t even have your datapack structure spawn in any biome you want. Only replace entire vanilla structures.

I would recommend waiting for WorldShape mod to update as that mod allows you to make your custom jigsaw structures spawn in the world during worldgen in any biome you want. It is for 1.16.5 right now https://www.curseforge.com/minecraft/mc-mods/worldshape

The only other alternative is to well, write your own mod to spawn the jigsaw structure.

But yeah, CommandStructures is just a utility mod to help modders and datapacks test and see how their jigsaw pieces assemble easier. It isn’t for actually spawning structures for worldgen.

commented

Thanks! I wasn't trying to spawn my structure during world gen, I wanted to make a structure spawn at a given position when the player uses certain items. I thought I might be able to do that with the /spawnstructure command instead of a the hacky way I was using with placing a structure block, activating, and replacing the structure block with what was there before.

Not sure how long it will be for worldshape to update, since there does not seem to be a branch besides 1.16

commented

Hmm. You probably could spawn it with the command by item if you have some way of triggering command.

The /Spawnstructure command points to a template pool. The template pool picks an nbt file to spawn. If the nbt file has a jigsaw block pointing to another template pool, it’ll spawn that other pool’s piece with its jigsaw block connected to the first one’s. And it’ll keep going until it hits the depth limit (one of the arguments for the /Spawnstructure command. The template pool + nbt file is basically a jigsaw structure but needs a way to be spawned which can be done by the command.

Your datapack with the structure would just need these files:
https://github.com/TelepathicGrunt/StructureTutorialMod/blob/1.18.x-Forge-Jigsaw/src/main/resources/data/structure_tutorial/worldgen/template_pool/run_down_house/start_pool.json

https://github.com/TelepathicGrunt/StructureTutorialMod/blob/1.18.x-Forge-Jigsaw/src/main/resources/data/structure_tutorial/structures/run_down_house_left_side.nbt

data/datapackname/structures/ is where pieces go
data/datapackname/worldgen/template_pool/ is where the template pool json file goes.

And the /spawnstructure command will need you to give it datapackname:start_pool or whatever you name the template pool file.

Hopefully that helps clarify it