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 deprecated. 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.
Download the Mod:
-------------------------------------------------------------------
-------------------------------------------------------------------
If you want to buy me a coffee you can use the donate button, thanks!
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/4zA0M 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:
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.
I am a representative of MinecraftBox.com | Managed Bukkit Servers | New Stocks! | Start from $2.95/mo! | Location: USA - Canada - UK - Germany - Netherlands
I have found a small bug in this mod. When I attempt to install it alongside the "Twilight Forest" mod, the game loads correctly and then crashes with the following error:
java.lang.ArrayIndexOutOfBoundsException: -1
at CustomSpawner.getCustomBiomeSpawnList(CustomSpawner.java:596)
at CustomSpawner.doCustomSpawning(CustomSpawner.java:266)
at mod_mocreatures.OnTickInGame(mod_mocreatures.java)
at BaseMod.OnTickInGame(BaseMod.java)
at ModLoader.OnTick(ModLoader.java)
at EntityRendererProxy.b(EntityRendererProxy.java)
at net.minecraft.client.Minecraft.run(SourceFile)
at java.lang.Thread.run(Thread.java:679)
The Twilight Forest mod adds a new dimension in which some vanilla Minecraft biomes have been removed or changed, and some new biomes have been added. I suspect that there isn't a proper custom spawn list for one or more of these biomes. As a result, when the getCustomBiomeSpawnList method tries to find the index of this biome's list, it gets back -1. Then it tries to grab the list at index -1, throwing the error. I think a simple bounds check should solve that problem. If not, it might be possible to disable custom mob spawning in areas with unrecognised biome names.
I have found a small bug in this mod. When I attempt to install it alongside the "Twilight Forest" mod, the game loads correctly and then crashes with the following error:
java.lang.ArrayIndexOutOfBoundsException: -1
at CustomSpawner.getCustomBiomeSpawnList(CustomSpawner.java:596)
at CustomSpawner.doCustomSpawning(CustomSpawner.java:266)
at mod_mocreatures.OnTickInGame(mod_mocreatures.java)
at BaseMod.OnTickInGame(BaseMod.java)
at ModLoader.OnTick(ModLoader.java)
at EntityRendererProxy.b(EntityRendererProxy.java)
at net.minecraft.client.Minecraft.run(SourceFile)
at java.lang.Thread.run(Thread.java:679)
The Twilight Forest mod adds a new dimension in which some vanilla Minecraft biomes have been removed or changed, and some new biomes have been added. I suspect that there isn't a proper custom spawn list for one or more of these biomes. As a result, when the getCustomBiomeSpawnList method tries to find the index of this biome's list, it gets back -1. Then it tries to grab the list at index -1, throwing the error. I think a simple bounds check should solve that problem. If not, it might be possible to disable custom mob spawning in areas with unrecognised biome names.
am i to understand this corectly , we cant change the spawn rate of vanilla mobs but we can turn them off?
all of them?
im asking this cause with another mod im running i don't want creepers to destroy or endears to steal and this mod isn't shutting them off in options it says de-spawn vanilla mobs yes but they still spawn
mods im running
1. modloader
2. audiomod
3. minecraftforge
4. scottools
5. Premiumwood
6. Level_up
7. Custommobspawner
8. Mo' Creatures
9. GuiAPI
10. SPC
11. Timber
12. Toomanyitems
all up to date 1.8.1
Rollback Post to RevisionRollBack
Tale of Kingdoms, Fossil /Archeology, MO' Creatures,OptiFine, 1.0.0
am i to understand this corectly , we cant change the spawn rate of vanilla mobs but we can turn them off?
all of them?
im asking this cause with another mod im running i don't want creepers to destroy or endears to steal and this mod isn't shutting them off in options it says de-spawn vanilla mobs yes but they still spawn
mods im running
1. modloader
2. audiomod
3. minecraftforge
4. scottools
5. Premiumwood
6. Level_up
7. Custommobspawner
8. Mo' Creatures
9. GuiAPI
10. SPC
11. Timber
12. Toomanyitems
all up to date 1.8.1
This mod gives you the option to despawn vanilla creatures in the same way they did in 1.7.3
For the aggressive mobs (i.e. Creepers) you can use the ModLoader.removeSpawn method
This mod gives you the option to despawn vanilla creatures in the same way they did in 1.7.3
For the aggressive mobs (i.e. Creepers) you can use the ModLoader.removeSpawn method
Thank you very much for your response and help.
BTW i'm a big fan of your work attention to detail.
Edit I'm not a mod creator and have just been able to understand where to start, i have been reading alot, i'm starting with MCP and modloader, and i have Notepad++ any help would be accepted and appreciated
I have found a small bug in this mod. When I attempt to install it alongside the "Twilight Forest" mod, the game loads correctly and then crashes with the following error:
java.lang.ArrayIndexOutOfBoundsException: -1
at CustomSpawner.getCustomBiomeSpawnList(CustomSpawner.java:596)
at CustomSpawner.doCustomSpawning(CustomSpawner.java:266)
at mod_mocreatures.OnTickInGame(mod_mocreatures.java)
at BaseMod.OnTickInGame(BaseMod.java)
at ModLoader.OnTick(ModLoader.java)
at EntityRendererProxy.b(EntityRendererProxy.java)
at net.minecraft.client.Minecraft.run(SourceFile)
at java.lang.Thread.run(Thread.java:679)
The Twilight Forest mod adds a new dimension in which some vanilla Minecraft biomes have been removed or changed, and some new biomes have been added. I suspect that there isn't a proper custom spawn list for one or more of these biomes. As a result, when the getCustomBiomeSpawnList method tries to find the index of this biome's list, it gets back -1. Then it tries to grab the list at index -1, throwing the error. I think a simple bounds check should solve that problem. If not, it might be possible to disable custom mob spawning in areas with unrecognised biome names.
I hope this info is helpful to you.
Oh, crud. Now I can't run Twilight Forest until this is updated. Argh, I guess I'm stuck with Mo' Creatures 2.14.1.
This mod gives you the option to despawn vanilla creatures in the same way they did in 1.7.3
For the aggressive mobs (i.e. Creepers) you can use the ModLoader.removeSpawn method
Unfortunately I don't know that that method entails, can you please be a bit more descriptive? Sorry for the dumb request, but I've only started playing MC during 1.8.1 and I don't know what it was like previously.
Unfortunately I don't know that that method entails, can you please be a bit more descriptive? Sorry for the dumb request, but I've only started playing MC during 1.8.1 and I don't know what it was like previously.
this is referring to using Java code to make your own Mod, he was telling me that the option to de-spawn aggressive Mobs in the Vanilla MC (like Creepers) was removed and if I needed to I could make my own mod and use that. it was a polite way of saying it
I'm not a programmer but thx to him I am trying to learn, and i wish he would re-installl the option in the next update. it was a very useful option, I would Turn off Creepers and Enderman because they are the only Vanilla mobs that destroy Blocks and i would turn off Ogres as well for same reason. be cause i love to fight large amount of mobs but I also love building complex redstone contraptions but i don't enjoy fixing the complex redstone contraptions
this is referring to using Java code to make your own Mod, he was telling me that the option to de-spawn aggressive Mobs in the Vanilla MC (like Creepers) was removed and if I needed to I could make my own mod and use that. it was a polite way of saying it
I'm not a programmer but thx to him I am trying to learn, and i wish he would re-installl the option in the next update. it was a very useful option, I would Turn off Creepers and Enderman because they are the only Vanilla mobs that destroy Blocks and i would turn off Ogres as well for same reason. be cause i love to fight large amount of mobs but I also love building complex redstone contraptions but i don't enjoy fixing the complex redstone contraptions
I have no clue why he took the option out, either. It was the only reason i downloaded the mod to begin with. Mind if I add you to my friends list? If you're successful with your mod to put the vanilla mob control function back into mo'Creatures 2.14.2, I will give you ALL THE THINGS to let me try it out! :tongue.gif: 'Till then I just can't upgrade to the newest version. Which makes me a sad little taco.
I have no clue why he took the option out, either. It was the only reason i downloaded the mod to begin with. Mind if I add you to my friends list? If you're successful with your mod to put the vanilla mob control function back into mo'Creatures 2.14.2, I will give you ALL THE THINGS to let me try it out! :tongue.gif: 'Till then I just can't upgrade to the newest version. Which makes me a sad little taco.
I'll add that option again to the next version of Mo'Creatures
As I understand from your OP, this is a mod for mob modders (sorry for the alliteration) to use so they can 'fix' some sort of despawning nerf. My question is, is there a use/benefit for lay people like me for everyday play? ie:
- How does this affect/differ the current 1.0.0 gameplay?
- How do i access it's features? Is there a GUI for settings (like Mo'Creatures) or is there some line of code i need to customize in a cfg or is this like an API with nothing for me to actually use/modify?
Apologies if I'm being a little dense here but just I'm trying to wrap my head around whether or not I should install this (w/ or even w/o Mo'Creatures) and then how would i go about using it?
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 deprecated. 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.
-------------------------------------------------------------------
If you want to buy me a coffee you can use the donate button, thanks!
-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/4zA0M 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:
If you have any questions, post in this thread.
Also, don't forget to add this override to your EntityAnimals, so they despawn.
Done, check the first post
one of the first
java.lang.ArrayIndexOutOfBoundsException: -1
at CustomSpawner.getCustomBiomeSpawnList(CustomSpawner.java:596)
at CustomSpawner.doCustomSpawning(CustomSpawner.java:266)
at mod_mocreatures.OnTickInGame(mod_mocreatures.java)
at BaseMod.OnTickInGame(BaseMod.java)
at ModLoader.OnTick(ModLoader.java)
at EntityRendererProxy.b(EntityRendererProxy.java)
at net.minecraft.client.Minecraft.run(SourceFile)
at java.lang.Thread.run(Thread.java:679)
The Twilight Forest mod adds a new dimension in which some vanilla Minecraft biomes have been removed or changed, and some new biomes have been added. I suspect that there isn't a proper custom spawn list for one or more of these biomes. As a result, when the getCustomBiomeSpawnList method tries to find the index of this biome's list, it gets back -1. Then it tries to grab the list at index -1, throwing the error. I think a simple bounds check should solve that problem. If not, it might be possible to disable custom mob spawning in areas with unrecognised biome names.
I hope this info is helpful to you.
Yes, very helpful.. I'll fix it
all of them?
im asking this cause with another mod im running i don't want creepers to destroy or endears to steal and this mod isn't shutting them off in options it says de-spawn vanilla mobs yes but they still spawn
mods im running
1. modloader
2. audiomod
3. minecraftforge
4. scottools
5. Premiumwood
6. Level_up
7. Custommobspawner
8. Mo' Creatures
9. GuiAPI
10. SPC
11. Timber
12. Toomanyitems
all up to date 1.8.1
This mod gives you the option to despawn vanilla creatures in the same way they did in 1.7.3
For the aggressive mobs (i.e. Creepers) you can use the ModLoader.removeSpawn method
Thank you very much for your response and help.
BTW i'm a big fan of your work attention to detail.
Edit I'm not a mod creator and have just been able to understand where to start, i have been reading alot, i'm starting with MCP and modloader, and i have Notepad++ any help would be accepted and appreciated
Oh, crud. Now I can't run Twilight Forest until this is updated. Argh, I guess I'm stuck with Mo' Creatures 2.14.1.
Unfortunately I don't know that that method entails, can you please be a bit more descriptive? Sorry for the dumb request, but I've only started playing MC during 1.8.1 and I don't know what it was like previously.
this is referring to using Java code to make your own Mod, he was telling me that the option to de-spawn aggressive Mobs in the Vanilla MC (like Creepers) was removed and if I needed to I could make my own mod and use that. it was a polite way of saying it
I'm not a programmer but thx to him I am trying to learn, and i wish he would re-installl the option in the next update. it was a very useful option, I would Turn off Creepers and Enderman because they are the only Vanilla mobs that destroy Blocks and i would turn off Ogres as well for same reason. be cause i love to fight large amount of mobs but I also love building complex redstone contraptions but i don't enjoy fixing the complex redstone contraptions
I have no clue why he took the option out, either. It was the only reason i downloaded the mod to begin with. Mind if I add you to my friends list? If you're successful with your mod to put the vanilla mob control function back into mo'Creatures 2.14.2, I will give you ALL THE THINGS to let me try it out! :tongue.gif: 'Till then I just can't upgrade to the newest version. Which makes me a sad little taco.
I'll add that option again to the next version of Mo'Creatures
As I understand from your OP, this is a mod for mob modders (sorry for the alliteration) to use so they can 'fix' some sort of despawning nerf. My question is, is there a use/benefit for lay people like me for everyday play? ie:
- How does this affect/differ the current 1.0.0 gameplay?
- How do i access it's features? Is there a GUI for settings (like Mo'Creatures) or is there some line of code i need to customize in a cfg or is this like an API with nothing for me to actually use/modify?
Apologies if I'm being a little dense here but just I'm trying to wrap my head around whether or not I should install this (w/ or even w/o Mo'Creatures) and then how would i go about using it?