Minecraft 1.8 changed drastically the way the vanilla mobs are spawned. The animals no longer despawn and their spawn is based on the biome seed. In other words, the randomness of spawning was removed. There are several mods that relied on the prior mob spawning method to add custom mobs to the game, like Mo'Creatures, More Creeps and Weirdos, Humans+ and many more.
I have developed a Tool called 'CustomSpawner' that offers modders the ability to have their custom mobs spawned in a similar way than Minecraft prior to 1.8. Every mod will have its individual spawning list, so other mods won't interfere with the spawning settings.
For users:
Just download the .zip file and put it into the /.minecraf/mods/ folder
For Modders:
Please don't modify or supply the CustomSpawner file with your mod, redirect users to this thread or put the http://adf.ly/Duxfb link in your own thread. Thanks!
You have to create an instance of the CustomSpawner class, and specify the limits for Mobs, Animals and Aquatic mobs. Then you add the custom spawns in a similar way as Risugami's ModLoader. However you only need to specify the weighted random frequency 'freq'.
You can see how is done by looking at this example: I will post an updated version for CustomSpawner 1.6 shortly, the current one is outdated
If you have any questions, post in this thread.
package net.minecraft.src;
import java.util.Map;
import net.minecraft.client.Minecraft;
public class mod_example extends BaseMod
{
public mod_example()
{
ModLoader.SetInGameHook(this, true, false); //sets the hook to use OnTickInGame
ModLoader.RegisterEntityID(MyMob.class, "MyMob", ModLoader.getUniqueEntityId());
ModLoader.RegisterEntityID(MyAnimalMob.class, "MyAnimalMob", ModLoader.getUniqueEntityId());
ModLoader.RegisterEntityID(MyAquaticMob.class, "MyAquaticMob", ModLoader.getUniqueEntityId());
myCustomSpawner = new CustomSpawner(); //initializes the instance of the spawner
myCustomSpawner.setMaxMobs(50); //sets the maximum number of custom mobs
myCustomSpawner.setMaxAnimals(40); //sets the maximum number of custom peaceful mobs
myCustomSpawner.setMaxAquatic(30); //sets the maximum number of custom aquatic mobs
int freq = 10;
//freq is a weighted random choice. It depends on the other freqs of the list.
//The higher this number, the higher the chance of that particular mob to spawn
//adds MyAnimalMob to the three specified biomes
myCustomSpawner.AddCustomSpawn(MyAnimalMob.class, freq, EnumCreatureType.creature, new BiomeGenBase[] {
BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.taiga });
//adds 'MyAnimalMob' to all the biomes except Hell and Sky
myCustomSpawner.AddCustomSpawn(MyAnimalMob.class, freq, EnumCreatureType.creature);
//adds 'MyMob' to Hell
myCustomSpawner.AddCustomSpawn(MyMob.class, freq, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.hell });
//adds 'MyMob' to all biomes except Hell and Sky
myCustomSpawner.AddCustomSpawn(MyMob.class, freq, EnumCreatureType.monster);
//adds 'MyAquaticMob' to the Ocean and River biomes
myCustomSpawner.AddCustomSpawn(MyAquaticMob.class, freq, EnumCreatureType.waterCreature, new BiomeGenBase[] {
BiomeGenBase.ocean, BiomeGenBase.river });
//this overwrites the frequency of the MyAquaticMob in the river biome only:
myCustomSpawner.AddCustomSpawn(MyAquaticMob.class, 5, EnumCreatureType.waterCreature, new BiomeGenBase[] {
BiomeGenBase.river });
//this removes MyAnimalMob from the biome plains
myCustomSpawner.RemoveCustomSpawn(MyAnimalMob.class, EnumCreatureType.creature, new BiomeGenBase[] {
BiomeGenBase.plains });
//and this removes MyAnimalMob from all the biomes
myCustomSpawner.RemoveCustomSpawn(MyAnimalMob.class, EnumCreatureType.creature);
}
public boolean OnTickInGame(float f, Minecraft minecraft)
{
if (mc.theWorld.worldInfo.getWorldTime() % 100L == 0L)
//how often to perform this code? change 100L. the higher the number, the less frequent
{
//this code randomly spawns custom mobs based on the lists and maxNumbers populated above
//this is what you would normally need to make your mod behave like it did on Minecraft 1.7
myCustomSpawner.doCustomSpawning(mc.theWorld, mc.gameSettings.difficulty > 0, true);
//the settings here are: the current world, spawns mobs, spawns peaceful creatures
//this code will randomly spawn MyAnimalMob up to 15 times
myCustomSpawner.doSpecificSpawning(mc.theWorld, MyAnimalMob.class, 15, EnumCreatureType.creature);
//There are also methods to despawn vanilla creatures:
//this code reactivates the despawning of vanilla creatures as in Minecraft 1.7
int despawned = myCustomSpawner.despawnMob(mc.theWorld);
System.out.println("despawned " + despawned + " vanilla mobs");
//the despawnMob method, checks the distance of the mob to the player or the 'age' of the mob
//and will despawn vanilla animals that are far away from the player or old enough
//this one despawns wolves, it will ignore tamed wolves, the ones who are near the player and the ones who are not 'old' enough
myCustomSpawner.despawnMob(mc.theWorld, EntityWolf.class);
//or you can provide a list:
myCustomSpawner.despawnMob(mc.theWorld, EntityChicken.class, EntitySheep.class);
//you can also count the number of a particular entity, and despawn but keeping a minimum number of creatures:
if(mc.theWorld.countEntities(EntitySheep.class) >10)
{
int y = myCustomSpawner.despawnMobWithMinimum(mc.theWorld, EntitySheep.class, 10);
System.out.println("despawning " + y + " sheep");
}
//the above code counts the number of sheep, if the number is greater than 10, it will
//despawn sheep while leaving 10 alive.
}
return true;
}
public void AddRenderer(Map map)
{
map.put(MyMob.class, new RenderMyMob(new ModelMyMob(), 0.5F));
map.put(MyAnimalMob.class, new RenderMyAnimalMob(new ModelMyAnimalMob(), 0.5F));
map.put(MyAquaticMob.class, new RenderMyAquaticMob(new ModelMyAquaticMob(), 0.5F));
}
public String Version()
{
return "1.0";
}
private static CustomSpawner myCustomSpawner;
public static Minecraft mc = ModLoader.getMinecraftInstance();
}
Also, don't forget to add this override to your EntityAnimals, so they despawn.
Dude your Mo' Creatures is SO cking hard to install! I'm trying right now.
To me its the easiest. Its just different from alot of other mods. You just have to remember to download all the mods needed. Like this, modloader, audiomod, and Gui API.
found it ...
AddRenderer
has to be changed to
addRenderer
... tiny detail, big impact
I'm sorry I didn't answer before. Modloader changed the caps for its methods to the camel caps.
I've updated the custom spawner, to squash some bugs, it works fine on version 1.4.1
I need 1.2.5! I Have 1.2.5 Mo's Creatures, TooManyItems, and all Mo's Creatures requirements except this (Audio and GUI API). Please make it soon and post it! I don't really want to downgrade because 1.2.5 is alot better than 1.2.4! Please!!!
I need 1.2.5! I Have 1.2.5 Mo's Creatures, TooManyItems, and all Mo's Creatures requirements except this (Audio and GUI API). Please make it soon and post it! I don't really want to downgrade because 1.2.5 is alot better than 1.2.4! Please!!!
I'm using this with 1.2.5 and have yet to experience any problems. You should just go ahead and download it.
When will you update it to 1.2.5? I'm trying to put Mo Creatures but in my 1.2.5 this is all I need an update for it to work, right now it's crashing my Minecraft.
I've been trying all day to download the Custom Mob spawner and Mo's Creatures, but the links won't work. It goes to ad fly, and when i click skip ad, it redirects and says it could not find the file no matter what i do. I've tried going to several different websites, and all the websites turn out the same. Any help?
Minecraft 1.8 changed drastically the way the vanilla mobs are spawned. The animals no longer despawn and their spawn is based on the biome seed. In other words, the randomness of spawning was removed. There are several mods that relied on the prior mob spawning method to add custom mobs to the game, like Mo'Creatures, More Creeps and Weirdos, Humans+ and many more.
I have developed a Tool called 'CustomSpawner' that offers modders the ability to have their custom mobs spawned in a similar way than Minecraft prior to 1.8. Every mod will have its individual spawning list, so other mods won't interfere with the spawning settings.
-CustomMobSpawner 2.3.1 mirror (For Minecraft 1.6.2)
-CustomMobSpawner v2.2.5 Mirror (For Minecraft 1.5.2)
Previous versions:
-CustomMobSpawner v2.2.2 Mirror (For Minecraft 1.5.2)
-CustomMobSpawner v1.12.5 Mirror (For Minecraft 1.5.1)
-CustomMobSpawner v1.12.2 Mirror (For Minecraft 1.5.1)
-CustomMobSpawner v1.11 Mirror (For Minecraft 1.4.7)
-CustomMobSpawner v1.10.0 Mirror (For Minecraft 1.4.6)
-CustomMobSpawner v1.9.0 Mirror (For Minecraft 1.4.5)
-CustomMobSpawner v1.7.1 (For Minecraft 1.4.2) *this version increases spawn frequencies
-CustomMobSpawner v1.7 (For Minecraft 1.4.2)
-CustomMobSpawner v1.6 (For Minecraft 1.3.2)
-CustomMobSpawner v1.5.1 (For Minecraft 1.2.5)
-CustomMobSpawner v1.5 (For Minecraft 1.2.5)
-CustomMobSpawner v1.4.3 mirror (For Minecraft 1.2.5)
-CustomMobSpawner v1.4.2 mirror (For Minecraft 1.2.4)
-CustomMobSpawner v1.4.1 mirror (For Minecraft 1.2.3)
-CustomMobSpawner v1.4 (For Minecraft 1.1)
-CustomMobSpawner v1.3 (For Minecraft 1.0)
-CustomMobSpawner v1.1 (For Minecraft Beta 1.8.1)
For users:
Just download the .zip file and put it into the /.minecraf/mods/ folder
For Modders:
Please don't modify or supply the CustomSpawner file with your mod, redirect users to this thread or put the
http://adf.ly/Duxfb link in your own thread. Thanks!
You have to create an instance of the CustomSpawner class, and specify the limits for Mobs, Animals and Aquatic mobs. Then you add the custom spawns in a similar way as Risugami's ModLoader. However you only need to specify the weighted random frequency 'freq'.
You can see how is done by looking at this example: I will post an updated version for CustomSpawner 1.6 shortly, the current one is outdated
If you have any questions, post in this thread.
Also, don't forget to add this override to your EntityAnimals, so they despawn.
To me its the easiest. Its just different from alot of other mods. You just have to remember to download all the mods needed. Like this, modloader, audiomod, and Gui API.
Why dont you post this in the Mo' Creatures thread..
ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ
I'm sorry I didn't answer before. Modloader changed the caps for its methods to the camel caps.
I've updated the custom spawner, to squash some bugs, it works fine on version 1.4.1
Soon to be made!
I'm using this with 1.2.5 and have yet to experience any problems. You should just go ahead and download it.
http://minebook.me/?ruid=41949
Also, i'm using magic launcher, and it says "no mods found" in the status column. Any suggestions or solutions?