Jump to content

[1.7.2] Mob cap?


The_SlayerMC

Recommended Posts

Hello!

I'm just wondering if there is a mob cap? I mean so you can only have a certain amount of mobs in one mod? Because i have plenty of mobs in a mod (more than i would care to count) and im getting a crash if i spawn a mob thats later down the list: CRASH But if i spawn a mob earlier in the tab, it works fine. So yeah, im assuming its got something to do with a entity cap

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

Link to comment
Share on other sites

What does the crash report say?

 

If there was a cap in the coding then it probably would "fail gracefully" meaning it just wouldn't spawn or something, it shouldn't crash.  I suspect that it is some other problem.  It may be "capped" by memory available or something.  But let's see the crash report.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

The question is how do you register entities?

If you use registerGlobalEntityId(), then yes, there's a cap (AFAIK max 256 entities)

If you just use registerModEntity(), then there shouldn't be a problem.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

This may sound newbish, but how would one register using the other method? I've always used that way!

It's pretty straightforward:

// I create a local index to make it easy on myself; just increment away 
int modEntityIndex = 0;

// the numbers are a) tracking range, b) frequency of tracking updates; true to send tracking updates
// see [url=https://docs.google.com/spreadsheet/pub?key=0Ap8gssssFFPAdFRXREZGSzZRY3k1WE8wcUE4S09xWXc&single=true&gid=0&output=html]this chart[/url] for typical vanilla values
EntityRegistry.registerModEntity(SomeEntity.class, "entity1name", ++modEntityIndex, YourMod.instance, 64, 10, true);
EntityRegistry.registerModEntity(AnotherEntity.class, "entity2name", ++modEntityIndex, YourMod.instance, 64, 10, true);

Keep in mind that doing it this way you will not be able to use the vanilla spawn eggs or summon command for you custom entity (thus the appeal of the global entity id, which I still don't understand why it has not been 'fixed' to allow for more than 256, such as using a String "mod:entityName" for spawn eggs rather than an integer, but I digress), so you will have to create your own spawn egg item(s) and command if you want them.

Link to comment
Share on other sites

is that 256 entities per world, dimension, chunk?

 

per game :P

No seriously, it's like the old block IDs, if you register too much entities with registerGlobalEntityId(), then you can't register more.

That's what registerModEntity is for, to not have this kind of limitations.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I get it now, I totaly misunderstood.  That is how many entity classes can exists.

 

I thought you were talking about how many spawned entities in a world.  I was getting worried something I was working on was doomed.

Long time Bukkit & Forge Programmer

Happy to try and help

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



×
×
  • Create New...

Important Information

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