Jump to content

[Solved] Custom mobs won't spawn


TheBasedRebel

Recommended Posts

Using newest version of forge and modding 1.4.7 Minecraft, using Eclipse.

 

First off I am having troubles getting my custom mobs to spawn anywhere.

 

Here is my code that is inside my main_ModClass:

 

 

EntityRegistry.registerModEntity(InfectedPig.class, "InfectedPig.entity", 4, this, 80, 3, true);
EntityRegistry.addSpawn(InfectedPig.class, 25, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.icePlains);
LanguageRegistry.instance().addStringLocalization("entity.InfectionMod.InfectedPig.entity.name", "Infected Pig");

 

Every tutorial I've watched has the mobs spawning like this but for some reason it doesn't spawn for me. When I first did the code for it, i thought it was working perfectly, but then I noticed it was only around the initial spawn area, then I noticed this: "[iNFO] [sTDOUT] Fetching addPacket for removed entity" in my debug window the farther i got out, and the message is very frequent which leads me to believe that it is the result of my custom Mobs being removed, however I could be wrong. Now I have noticed that they are just not spawning entirely, or if they are I cant find them. I have changed the numbers for how frequent they spawn, but to no avail.

 

On another note when they were spawning and now if I try to add my custom biome to the list like this:

 BiomeGenBase.jungle, BiomeGenBase.icePlains, Lagoon);

Lagoon being the custom biome (it does show as blue when it is typed) it then crashes on startup. I can by the way spawn it in with an egg and it works just fine. Now my goal in the end is to make them spawn naturally and to make them spawn in my custom biome, Lagoon.

 

Any help with this issue would be much appreciated.

 

And I have looked at every post here about this issue and none helped me, yes I did use the search feature  ;)

Link to comment
Share on other sites

the custom biome (it does show as blue when it is typed) it then crashes on startup.

I'm sorry, but this sounds like you should learn more about java and/or programming.

 

Please provide more information, like (relevant) source code at http://paste.minecraftforge.net/, logs of crash and so on.

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

the custom biome (it does show as blue when it is typed) it then crashes on startup.

I'm sorry, but this sounds like you should learn more about java and/or programming.

 

Please provide more information, like (relevant) source code at http://paste.minecraftforge.net/, logs of crash and so on.

 

Yes, sorry I realized how that sounded after posting I do know a great deal about Java and that statement didn't reflect it. I've took your advice and created relevant source code.

 

Here is sections of my main class file.

 

mod_MainClass:

http://gw.minecraftforge.net/qdsL

 

I tried to remove most of the irrelevant code, things left are just for my biome and my mobs, exluding crafting recipes and such.

 

This is all my files for just the InfectedPig mob, but the other mobs follow almost the same code.

 

Model: http://gw.minecraftforge.net/Jkgn

Render: http://gw.minecraftforge.net/J9UK

Entity: http://gw.minecraftforge.net/HffX

 

This is my Proxys.

 

ClientProxy: http://gw.minecraftforge.net/f2mG

ServerProxy: http://gw.minecraftforge.net/Poed

 

Finally this is all the code for my biome.

 

WorldGeneratorLagoon: http://gw.minecraftforge.net/ak3m

BiomeGenLagoon: http://gw.minecraftforge.net/nG2r

 

Logs:

 

For when it launches but no mobs spawn, says "[sTDOUT] Fetching addPacket for removed entity" http://gw.minecraftforge.net/tovk

 

For when it crashes after adding custom biome: http://gw.minecraftforge.net/OjhU

 

Again sorry for my lack of relevant information and arrogance, I hope I have provided the proper source code now.

 

Thank you for your time.

Link to comment
Share on other sites

I've took your advice and created relevant source code.

oh, by relevant code I meant classes responsible for/working with your biome and mob, you didn't have to prune it by hand (my bad, sorry).

 

Again sorry for my lack of relevant information and arrogance.

I didn't feel any arrogance from you post, but again my english isn't excellent. A lot of people asking here forgets to append source code/logs, but without it it's usually nearly impossible to track down the issue.

 

the biome seems to be created after registering a mob spawn which uses the biome, it could be the problem.

 

I'm not really sure if only "registerModEntity" is enough, in my mod I had to register my mob also by the global method.

take a look at this post, it might help: http://www.minecraftforge.net/forum/index.php/topic,5748.msg30986.html#msg30986 (rest of it is here - https://github.com/mnn/jaffas/tree/master/src/minecraft/monnef)

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

I've took your advice and created relevant source code.

oh, by relevant code I meant classes responsible for/working with your biome and mob, you didn't have to prune it by hand (my bad, sorry).

 

Again sorry for my lack of relevant information and arrogance.

I didn't feel any arrogance from you post, but again my english isn't excellent. A lot of people asking here forgets to append source code/logs, but without it it's usually nearly impossible to track down the issue.

 

the biome seems to be created after registering a mob spawn which uses the biome, it could be the problem.

 

I'm not really sure if only "registerModEntity" is enough, in my mod I had to register my mob also by the global method.

take a look at this post, it might help: http://www.minecraftforge.net/forum/index.php/topic,5748.msg30986.html#msg30986 (rest of it is here - https://github.com/mnn/jaffas/tree/master/src/minecraft/monnef)

 

Oh hey, didn't even realize that post was yours, I actually was looking at that earlier, anyways I've actually gotten the mobs to spawn now and they spawn even when I go really far away, however it's very infrequent, even though my numbers for spawning are 50, 20, 60 and I list most all biomes, also I checked out your github, where exactly is the part about spawning in the duck? For the life of me I just can't find it, sorry :P

 

Thanks btw, I think the part about the biome being after the mob is correct so I will change that, any chance you could tell me how to spawn a tree in that biome? Like a custom one?

 

Edit: found duck code after posting, wouldn't of thought to look in food xD

Link to comment
Share on other sites

Mobs now spawn, I didn't need the Global method, in fact adding it made them stop spawning but i'mm sure that was of my own fault. Anyways it's not needed for me and everything works correctly. If anyone else has the same problem copy this code:

 

EntityRegistry.registerModEntity(Entity.class, "yourentitysname", 1, this, 80, 3, true);
	EntityRegistry.addSpawn(Entity.class, 10, 2, 6, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.jungle, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
LanguageRegistry.instance().addStringLocalization("entity.yourmodidname.yourentitysname.name", "Entity Name");

 

And for for mobs to spawn in custom biome make sure the biome is initiated before all mobs are. Credit to mnn for figuring that out :)

Link to comment
Share on other sites

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.

×
×
  • Create New...

Important Information

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