Posted May 12, 201411 yr 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
May 12, 201411 yr 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/
May 12, 201411 yr Author The crash reports already there Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods
May 12, 201411 yr 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.
May 12, 201411 yr Author This is how: http://prntscr.com/3io2fg Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods
May 12, 201411 yr As SanAndreas said using that method there is a limit of 256 including all vanilla mods and including all other mods. If you want to confirm that you've used up the amount you can print out the global ID as they are registered. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
May 13, 201411 yr Author This may sound newbish, but how would one register using the other method? I've always used that way! Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods
May 13, 201411 yr 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. http://i.imgur.com/NdrFdld.png[/img]
May 13, 201411 yr is that 256 entities per world, dimension, chunk? Long time Bukkit & Forge Programmer Happy to try and help
May 13, 201411 yr is that 256 entities per world, dimension, chunk? per game 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.
May 13, 201411 yr 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
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.