Jump to content

Too many monsters spawn at once, how to reduce? (mc vers. 1.10) pls help!


Recommended Posts

Posted

Hello mates!

I`m a newby at modding and I need some help please.

 

I created a new biome and it works as I imagined it. My problem  comes up with spawning some guardians, sometimes are less as I want but  sometimes when

I change to another place, there spawn a lot of them, too many at once (watch my screenshot). I surched the foren about this theme but couldn`t find any relevant results.

Could anybody tell me, how to fix this problem pls? (whit detailed description that i could understand.... :) )

 

 

guardians-spawntxs47.png

 

 

 

My basic biomes code:

 

package com.space.extended.biomes;

 

import java.util.Random;

 

import net.minecraft.block.state.IBlockState;

import net.minecraft.world.biome.Biome;

import net.minecraft.world.gen.feature.WorldGenAbstractTree;

import net.minecraftforge.common.BiomeManager.BiomeType;

 

public abstract class BasicBiomes extends Biome{

 

public BasicBiomes(BiomeProperties properties, String name) {

super(properties);

setRegistryName(name);

}

 

public BasicBiomes (String name){

this(new BiomeProperties(name), name);

 

}

    public BiomeType getBiomeType(){

    return BiomeType.WARM;

  }

 

 

}

 

 

 

My biome code:

 

package com.space.extended.biomes;

 

import java.util.List;

import java.util.Random;

 

import com.google.common.collect.Lists;

import com.space.extended.basicblocks.BasicBlocks;

 

import net.minecraft.entity.monster.EntityBlaze;

import net.minecraft.entity.monster.EntityCaveSpider;

import net.minecraft.entity.monster.EntityGuardian;

import net.minecraft.entity.monster.EntitySilverfish;

import net.minecraft.entity.monster.EntitySkeleton;

import net.minecraft.entity.passive.EntityPig;

import net.minecraft.init.Blocks;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.World;

import net.minecraft.world.biome.Biome;

import net.minecraft.world.biome.Biome.SpawnListEntry;

import net.minecraft.world.gen.feature.WorldGenerator;

import net.minecraftforge.common.BiomeManager.BiomeType;

 

public class SpaceBiome1 extends BasicBiomes{

 

 

 

 

public SpaceBiome1() {

super(new BiomeProperties("SpaceBiome1").setHeightVariation(0.9f).setSnowEnabled().setWaterColor(11606476).setTemperature(0.2F),"SpaceBiome1");

 

 

topBlock = BasicBlocks.cyberit.getDefaultState();

fillerBlock = BasicBlocks.cyberit_fire.getDefaultState();

 

 

spawnableCaveCreatureList.clear();

spawnableCreatureList.clear();

spawnableMonsterList.clear();

spawnableWaterCreatureList.clear();

 

spawnableMonsterList.add(new SpawnListEntry(EntitySilverfish.class,10, 2, 3));

spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 3, 4));

spawnableWaterCreatureList.add(new SpawnListEntry(EntityGuardian.class,4, 1, 2));

spawnableCreatureList.add(new SpawnListEntry(EntityPig.class,12,1,3));

 

 

theBiomeDecorator.generateLakes = true;

 

}

 

}

 

 

 

Thanks for the help in advance,

Norzeteus

Don't blame me if i always ask for your help. I just want to learn to be better....

Posted

When run-time behavior is unexpected (but not a crash), it is instructive to set breakpoints and run the debugger so you can step through the spawning process. Each chunk is supposed to have a max number of any given mob. You want to step through the code that should be enforcing that.

 

To find a good place to set your break point, hunt for spawn-list references.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

@jeffryfisher

 

Thanks for response, but, as I said a noob I am, I have 0 plan what and where to do this.....  ;(

Don't blame me if i always ask for your help. I just want to learn to be better....

Posted

Hmmm... Try setting a breakpoint on the EntityGuardian's contructor(s). See what method is spawning so many of them. Sset another breakpoint and step through the method that decided to spawn yet another guardian. Examine its variables. It should be apparent where it's trying to test for "too many" and why the test isn't working as expected.

 

BTW, Vanilla mc had a similar problem with squids a couple years ago.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.