The Meaning of Life, the Universe, and Everything.
Join Date:
4/7/2011
Posts:
233
Member Details
Hey guys, I am trying to get my air elemental to spawn naturally in the mountains. This is how my code looks:
public class ModEntities {
public static void init() {
createEntity(EntityAirElemental.class, "AirElemental", 0x0004FF, 0x00FF04, 1);
}
public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor, int spawnType) {
int id = createEntity(entityClass, entityName);
switch(spawnType) {
case 0://NONE
break;
case 1://MOUNTAINS
EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.monster, BiomeGenBase.extremeHillsPlus);
EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.monster, BiomeGenBase.extremeHills);
EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.monster, BiomeGenBase.extremeHillsEdge);
// EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.creature, BiomeGenBase.extremeHills);
// EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.creature, BiomeGenBase.extremeHillsEdge);
// EntityRegistry.addSpawn(entityClass, 9, 3, 6, EnumCreatureType.creature, BiomeGenBase.extremeHillsPlus);
break;
}
createEgg(id, solidColor, spotColor);
}
The entity spawns, but very rarely, and never in groups, even though I set the rarity to 9, and minimum group size to 3. Could some please explain these parameters to me?
Rollback Post to RevisionRollBack
Whomsoever takes up this mod shall wield power eternal.
The Meaning of Life, the Universe, and Everything.
Join Date:
4/7/2011
Posts:
233
Member Details
Setting the spawn rate to 100 solved the problems. I believe it was some compability problems with Zombie Awareness that caused vanilla mobs to dominate too hard.
Rollback Post to RevisionRollBack
Whomsoever takes up this mod shall wield power eternal.
Have not seen a single entity spawn. Changed 15 to 100 to 511 to 1011 and generated new worlds and tried EnumCreatureType.CREATURE and MONSTER to no avail. This is located in my ClientProxy which implements my CommonProxy. Also tried calling this right after registering my mob in my ModEntities file but still no results. Any ideas?
Thanks for the help. Moved it into my main init method, changed probability to 100 and started seeing them spawn.
However they only spawn at night. Tried overriding the following code in EntityMob and removing isValidLightLevel in hopes that that would always be true but it still only spawns in the dark. Any ideas?
Hey guys, I am trying to get my air elemental to spawn naturally in the mountains. This is how my code looks:
The entity spawns, but very rarely, and never in groups, even though I set the rarity to 9, and minimum group size to 3. Could some please explain these parameters to me?
I was having a similar problem and found that EnumCreatureType.AMBIENT seemed to make my mob spawn far more often.
Setting the spawn rate to 100 solved the problems. I believe it was some compability problems with Zombie Awareness that caused vanilla mobs to dominate too hard.
Having the same problem in 1.11
Have not seen a single entity spawn. Changed 15 to 100 to 511 to 1011 and generated new worlds and tried EnumCreatureType.CREATURE and MONSTER to no avail. This is located in my ClientProxy which implements my CommonProxy. Also tried calling this right after registering my mob in my ModEntities file but still no results. Any ideas?
(Spawn egg works and entity is working 100%)
This might be a very stupid question, but it is worth asking anyway: did you search for them in the forest and extreme hills biomes?
Yes sir
Hmmm. I believe there is a method called canSpawnAtLightLevel(...) or something like that. Did you implement that method?
Why are you registering entities in ClientProxy? Don't register it in a proxy, just register it on initialization (FMLInitializationEvent)
Thanks for the help. Moved it into my main init method, changed probability to 100 and started seeing them spawn.
However they only spawn at night. Tried overriding the following code in EntityMob and removing isValidLightLevel in hopes that that would always be true but it still only spawns in the dark. Any ideas?
to
EDIT: Got it to work. got rid of "&& super.getCanSpawnHere();"
Try changing EnumCreatureType to CREATURE instead of AMBIENT
Thanks for the help. Working properly now