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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • https://pastebin.com/VwpAW6PX My game crashes upon launch when trying to implement the Oculus mod to this mod compilation, above is the crash report, I do not know where to begin to attempt to fix this issue and require assistance.
    • https://youtube.com/shorts/gqLTSMymgUg?si=5QOeSvA4TTs-bL46
    • CubeHaven is a SMP server with unique features that can't be found on the majority of other servers! Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132 3 different stores: - CubeHaven Store: Our store to purchase using real money. - Bitcoin Store: Store for Bitcoin. Bitcoin can be earned from playing the server. Giving options for players if they want to spend real money or grind to obtain exclusive packages. - Black Market: A hidden store for trading that operates outside our traditional stores, like custom enchantments, exclusive items and more. Some of our features include: Rank Up: Progress through different ranks to unlock new privileges and perks. 📈 Skills: RPG-style skill system that enhances your gaming experience! 🎮 Leaderboards: Compete and shine! Top players are rewarded weekly! 🏆 Random Teleporter: Travel instantly across different worlds with a click! 🌐 Custom World Generation: Beautifully generated world. 🌍 Dungeons: Explore challenging and rewarding dungeons filled with treasures and monsters. 🏰 Kits: Unlock ranks and gain access to various kits. 🛠️ Fishing Tournament: Compete in a friendly fishing tournament! 🎣 Chat Games: Enjoy games right within the chat! 🎲 Minions: Get some help from your loyal minions. 👥 Piñata Party: Enjoy a festive party with Piñatas! 🎉 Quests: Over 1000 quests that you can complete! 📜 Bounty Hunter: Set a bounty on a player's head. 💰 Tags: Displayed on nametags, in the tab list, and in chat. 🏷️ Coinflip: Bet with other players on coin toss outcomes, victory, or defeat! 🟢 Invisible & Glowing Frames: Hide your frames for a cleaner look or apply a glow to it for a beautiful look. 🔲✨[ Player Warp: Set your own warp points for other players to teleport to. 🌟 Display Shop: Create your own shop and sell to other players! 🛒 Item Skins: Customize your items with unique skins. 🎨 Pets: Your cute loyal companion to follow you wherever you go! 🐾 Cosmetics: Enhance the look of your character with beautiful cosmetics! 💄 XP-Bottle: Store your exp safely in a bottle for later use! 🍶 Chest & Inventory Sorting: Keep your items neatly sorted in your inventory or chest! 📦 Glowing: Stand out from other players with a colorful glow! ✨ Player Particles: Over 100 unique particle effects to show off. 🎇 Portable Inventories: Over virtual inventories with ease. 🧳 And a lot more! Become part of our growing community today! Discord: https://cubehaven.net/discord Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132
    • # Problematic frame: # C [libopenal.so+0x9fb4d] It is always the same issue - this refers to the Linux OS - so your system may prevent Java from working   I am not familiar with Linux - check for similar/related issues  
  • Topics

×
×
  • Create New...

Important Information

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