Jump to content

[SOLVED][1.16.5] Entity naturally spawn!


TonyOneG112

Recommended Posts

Hi, I'm making a custom Entity, already fix it all, i can spawn it by commands but idk how to create spawnegg, i'm working with deferred register and I want that mob spawns naturally in biomes, but i don't see any way to add my monster to biomemaker class etc, any tip? thank u btw.

1. I'm using tthis to try to spawn it (I know 500 it's too much), problem is: Pigs are spawning, not my mob... But on dungeons it's spawning okay.

2. Maybe a more "natural" codding way to spawn it naturally?

3. Really thanks for ur patience, I post a lot, sorry.

  private void setup(final FMLCommonSetupEvent event) {
        // some preinit code
        LOGGER.info("HELLO FROM PREINIT");

        EntitySpawnPlacementRegistry.register(VERRUCT.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES,
                MonsterEntity::checkMonsterSpawnRules);
        DungeonHooks.addDungeonMob(VERRUCT.get(), 500);
    @SubscribeEvent
    public static void onBiomeLoad(final BiomeLoadingEvent event){
        if (event.getName() == null){
            return;
        }

          MobSpawnInfoBuilder spawns = event.getSpawns();

            if (event.getCategory()!=(Biome.Category.OCEAN)) {
                spawns.addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(VERRUCT.get(), 500, 1, 1));
            }

    }
Edited by TonyOneG112
Solved, close thread
Link to comment
Share on other sites

[18:32:34] [Server thread/WARN] [ne.mi.co.ForgeConfigSpec/CORE]: Configuration file .\saves\New World (2)\serverconfig\forge-server.toml is not correct. Correcting
[18:32:34] [Server thread/WARN] [ne.mi.co.ForgeConfigSpec/CORE]: Incorrect key server was corrected from null to its default, SimpleCommentedConfig:{

 

Using that code and before I get that. And my mob still don't work.

Link to comment
Share on other sites

bump, now server is creating pigs instead mob, any idea?

 

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


            if ((event.getCategory().getName()!=Biome.Category.NETHER.getName()) && (event.getCategory().getName()!=Biome.Category.THEEND.getName())) {
                event.getSpawns().addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(VERRUCT.get(), 200, 5, 5)).addMobCharge(VERRUCT.get(), 0.1D, 0.1D);
            LOGGER.info("Welcome to generation!  "+event.getName());
            }

    }

 

Link to comment
Share on other sites

  • TonyOneG112 changed the title to [SOLVED][1.16.5] Entity naturally spawn!

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.