Posted February 19, 201312 yr Hi, I was just wondering if there was a way to make custom structures spawn in a specific vanilla biome.
February 19, 201312 yr Yes BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(i, j); if(biomeGenBase instanceof BiomeGenForest) { //generate structure } Sorry for mistakes, English is not my mother tongue
February 20, 201312 yr Author Thanks, that seemed to work. But is there a way to make it spawn in like a hillside as well? I tried this: protected int[] GetValidSpawnBlocks() { return new int[] { Block.dirt.blockID }; } public boolean LocationIsValidSpawn(World world, int x, int y, int z) { int checkID = world.getBlockId(x, y, z + 2); int checkID2 = world.getBlockId(x, y + 5, z + 1); if (checkID != Block.grass.blockID || (checkID2 != Block.dirt.blockID && checkID2 != Block.stone.blockID)) { return false; } else { return true; } } public WorldGenDungeon() { } public boolean generate(World world, Random rand, int i, int j, int k) { // check that each corner is one of the valid spawn blocks if (!LocationIsValidSpawn(world, i, j, k + 2) || !LocationIsValidSpawn(world, i, j + 5, k + 1)) { return false; } And then the generation underneath that. This is in a custom class called WorldGenDungeon.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.