How to spawn multiple structures from .ntb (structure block file)?

Started by X_Khan_X on Wed, 09/25/2019 - 22:24

Topic category: Advanced modding

Last seen on 11:14, 23. Oct 2019
Joined Sep 2019
User points:


  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How to spawn multiple structures from .ntb (structure block file)?
Wed, 09/25/2019 - 22:24

Hello, I'm trying to generate some structure when a particular action is performed, I have this class as Structuregenerator

public class StructureGenerator {

    public static final StructureGen CAGE_TRAP = new StructureGen("cage_trap");
    public static final StructureGen WISHING_WELL = new StructureGen("wishing_well");
public static final StructureGen AMERICAN_FLAG = new StructureGen("american_flag");

    public static void generateStructure(WorldGenerator generator, World world, Random random, int x, int y, int z) {
        BlockPos pos = new BlockPos(x, y, z);
        if (world.getWorldType() != WorldType.FLAT) {
            if (!world.isRemote) {
                generator.generate(world, random, pos);

And I use:

StructureGenerator.generateStructure(StructureGenerator.CAGE_TRAP, worldIn, r, player.getPosition().add(3,0,0).getX(),player.getPosition().add(0,-2,0).getY(),player.getPosition().add(0,0,-1).getZ());

But it keeps to spawn me the last Structure added (AMERICAN_FLAG), why? How to fix this?

0Upvote this forum topic