Jump to content

[1.18.1] How to make this entity spawning code more efficient?


Recommended Posts

Posted

Hello there, so I currently have this method that works, and my mob do spawn but it doesn't spawn them efficiently at all even though I have set the weight 100:

    @SubscribeEvent
    public static void onBiomeLoad(final BiomeLoadingEvent event)
    {
        if(event.getName() == null)
            return;
        MobSpawnSettingsBuilder spawns = event.getSpawns();
        if(event.getCategory().equals(Biome.BiomeCategory.SWAMP))
        {
            spawns.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(ModEntityTypes.CROAKER.get(), 100,2,4));
        }
    }

They basically spawn very rare, is there a better way or to fix this maybe?

Posted

one thing you can try is make your own category.

is your entity based on a vanilla hostile entity? probably not, but if it is, you need to override something that makes them despawn if they are too far.

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.