Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm trying to make it so my mob only spawns in groups of one, using the code below

event.getSpawns().withSpawner(EntityClassification.WATER_CREATURE, new MobSpawnInfo.Spawners(ModEntityTypes.KRAKEN.get(), OutvotedConfig.COMMON.ratekraken.get(), 1, 1));

However the maxcount is completely ignored, and it's very rare for the mob to only spawn in a group of 1, it usually does it in 2 or more. This happens for both normal creatures and water creatures.

The same applies to mincount in this code

event.getSpawns().withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.BLAZE, OutvotedConfig.COMMON.rateblaze.get(), 3, 4));

Where there should be a minimum group of 3, but I've seen blazes spawn in groups of only 1 or 2.

 

Am I just not understanding how biome spawns work?

The following function is used to calculate the amount of entities to spawn: min + randInt[0, 1 + max - min). If you have a min and max of 1, at least one entity will spawn and at most one. However, there is no limit on how many times the spawner might be called. Also, entities can despawn or not spawn due to specific conditions as well which might reduce the amount to spawn. So, it's just a simple case of confirmation bias.

You could implement your mob spawning in the form of a Feature that generates in the world. The only thing that feature would do when generating in the world is spawn one (and only one) of your custom entity type. The ice and fire mod for example uses features to make some of their entities spawn singularly

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.