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 using the biomeLoad event to spawn my duck entity in, but when returning to a biome or standing still in it, the ducks will keep on spawning at the same location on my modded server.

How do I prevent this?

I only want them to spawn once, at the same rate as chickens, near beaches or rivers.

 

GitRepo: https://github.com/Leronus/mOres

Image for reference: https://imgshare.io/image/2021-10-09-182453.pFfbGp

 

Class location: mOres/src/main/java/mod/mores/events/EntityEvent.java

Edited by Leronus
Further explanation

I tried to reproduce your problem, but i can't. The ducks are very rare in Beach and River Biomes and when they spawn there are 2-5 Ducks
the code works how it should

  • Author
34 minutes ago, Luis_ST said:

I tried to reproduce your problem, but i can't. The ducks are very rare in Beach and River Biomes and when they spawn there are 2-5 Ducks
the code works how it should

It works in singleplayer yes, but not on a server. That's when they keep spawning over and over.

1 hour ago, Leronus said:

It works in singleplayer yes, but not on a server. That's when they keep spawning over and over.

for me it works on server and on client, again the code works how it should
with this code:

Spoiler
    @SubscribeEvent
    public static void onBiomeLoad(final BiomeLoadingEvent event){
        if (event.getName() == null){
            return;
        }

        if (Config.duckSpawning.get()) {
            MobSpawnInfoBuilder spawns = event.getSpawns();

            if (event.getCategory().equals(Biome.Category.BEACH) || event.getCategory().equals(Biome.Category.RIVER)) {
                spawns.addSpawn(EntityClassification.WATER_CREATURE, new MobSpawnInfo.Spawners(EntityTypeInit.DUCK.get(), 5, 2, 5));
            }
        }
    }

 


client:
https://ibb.co/Pz4xgjS

server:
https://ibb.co/XtLRTjN


 

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.