Jump to content

Recommended Posts

Posted (edited)

Hi! My problem is that MONSTERS are spawning in large amounts. Only in dark places, but amounts are really too big. There's no such problem with creatures. In entity code I have getMaxSpawnedInChunk() set to 2. What can be causing this problem?

Spawn Registry

  Reveal hidden contents

EDIT:
Even when I set weight to some huge number I've got a lot of mobs. For e.g. 

  Reveal hidden contents

EDIT:
BiomeMysticForest
 

  Reveal hidden contents

Kether Biome
 

  Reveal hidden contents


BiomeDecoratorMystic

  Reveal hidden contents

 

populateChunk method in my ChunkGenerator
 

  Reveal hidden contents

 

It appeared that the problem is very weird. There is only problem with EntitySkylight during the day. During the night they almost don't spawn. 

Edited by Krevik
Posted
  On 4/17/2018 at 6:09 PM, jabelar said:

Well, the first parameter is the spawn "weight" meaning it affects the chance of spawning. You have it set very low so I think it will spawn all the time. Normally mobs like zombies have value of 95 there.

Expand  

Thanks! I thought this works same as with animals, cause animals with spawn rate like 1 spawn very rare

Posted
  On 5/4/2018 at 8:24 AM, diesieben07 said:

The opposite is the case. The higher the weight the higher the spawn chance compared to other mobs.

Expand  

But how that fix my problem? Whenever I change the value to low or high, there are lot's of mobs. That applies only to MONSTERS

Posted (edited)
  On 5/4/2018 at 8:24 AM, diesieben07 said:

The opposite is the case. The higher the weight the higher the spawn chance compared to other mobs.

Expand  

You're right, but the the reason I made my statement about the lower being more common is that entities like pigs have weight of 12 and entity like zombie has weight of 100. However, I see now that each list (creatures, monsters, water creatures) the vanilla weight levels are quite different. 

 

Tuning weight numbers can be a bit tricky because they are relative to the total weight. In other words, every time you add an entity, the chance of all other entities spawning gets a bit smaller. But that shouldn't be an issue in this case.

 

In any case, my point was that he should use numbers similar to the vanilla entities when testing. Since he's looking at monsters, he should have number around 100 to spawn with similar frequency to zombies and skeletons. A number of 1 should be less frequent than a witch which is 5. If you want to see the default values, look at the constructor for the Biome base class.

 

Anyway, we need way more code than that to help you solve this problem. It obviously isn't this line of code causing the trouble. Is this problem related to a custom biome? If so, maybe you're calling the generation code way more times than you think (and therefore generating more of the entity). Or something like that.

Edited by jabelar

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

Posted
  On 5/4/2018 at 3:07 PM, jabelar said:

every time you add an entity, the chance of all other entities spawning gets a bit smaller. But that shouldn't be an issue in this case.

Expand  

Uh...duh?

When you buy more socks, the odds that you grab a white one out of your sock drawer at random changes.

Vanilla doesn't want to spawn more total mobs as the variety increases (otherwise you reach a hyperbolic example of a billion different mobs and vanilla insures that at least one of each is spawened at any given time, making it impossible to move without running into something) so the actual percentage chance goes down.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
  On 5/4/2018 at 6:47 PM, Draco18s said:

Uh...duh?

When you buy more socks, the odds that you grab a white one out of your sock drawer at random changes.

Vanilla doesn't want to spawn more total mobs as the variety increases (otherwise you reach a hyperbolic example of a billion different mobs and vanilla insures that at least one of each is spawened at any given time, making it impossible to move without running into something) so the actual percentage chance goes down.

Expand  

I know this but was teaching a beginner about what a weighted system means. For testing purposes I was basically telling the OP to copy a number used by vanilla, but I could see him/her then going off and adding a dozen more entities later with the same number, so I wanted to warn him/her about that.

 

Also, although it is true that there is a good reason to limit the total entities, it is also reasonable for a modder to want to add a bit more prolific entities to the game. This is especially true where game balance is concerned. Like if I wanted to add flocks of seagulls, I wouldn't necessarily want food entities like pigs to become more scarce. So it is worth them understanding that they are not really adding to the overall fauna but rather substituting spawns and making existing fauna more rare.

Edited by jabelar

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

Posted
  On 5/4/2018 at 9:05 PM, jabelar said:

I know this but was teaching a beginner about what a weighted system means. For testing purposes I was basically telling the OP to copy a number used by vanilla, but I could see him/her then going off and adding a dozen more entities later with the same number, so I wanted to warn him/her about that.

 

Also, although it is true that there is a good reason to limit the total entities, it is also reasonable for a modder to want to add a bit more prolific entities to the game. This is especially true where game balance is concerned. Like if I wanted to add flocks of seagulls, I wouldn't necessarily want food entities like pigs to become more scarce. So it is worth them understanding that they are not really adding to the overall fauna but rather substituting spawns and making existing fauna more rare.

Expand  

Not so begginer as you think :P Will post rest of the code soon

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.