Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED][1.16.5] Entity naturally spawn!


TonyOneG112
 Share

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

8 minutes ago, TonyOneG112 said:

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

 

Check your entity renderer. Did you make a custom model? Did you properly place your textures in the resources?

  • Thanks 1
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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Why are you extracting them? Put the mods in the mods folder.
    • Because the jar is not runnable. Java 9 and the module system removed the way to have executable jars. So, because Minecraft 1.16 uses Java 16 we can no longer just have an executable jar file. A script is necessary.
    • Delete forge-client.toml if you didn't modify it.
    • This issue happens with every version of forge as far back as 1.16 (I haven't tried an older version) and continues with 1.18. The game will open but will only show a white screen for a few seconds before reopening the Minecraft launcher with a notification that the game has crashed. It seemed to start suddenly so I thought it was an issue with my mods but even without any mods in my mods folder it crashes. Log: https://pastebin.com/qsbJS3gC   
    • Hey! So, following: I want to create backpacks that open when you right click with my custom item. This is in my custom item class: @Nullable @Override public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { ItemStackHandler itemHandler = new ItemStackHandler(27); return ChestItemProvider.from(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, () -> itemHandler); } This is my ChestItemProvider: public class ChestItemProvider implements ICapabilityProvider { private final Capability<IItemHandler> capability; private final LazyOptional<IItemHandler> implementation; public ChestItemProvider(Capability<IItemHandler> capability, LazyOptional<IItemHandler> implementation) { this.capability = capability; this.implementation = implementation; } public static ChestItemProvider from(Capability<IItemHandler> cap, NonNullSupplier<IItemHandler> impl) { return new ChestItemProvider(cap, LazyOptional.of(impl)); } @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return implementation.cast(); } return LazyOptional.empty(); } } So, a few questions: Is this implementation correct to this point? How do I open a gui with IItemHandler and how do I save the changed contents? This is what I have now: @SubscribeEvent public void onRightClick(PlayerInteractEvent.RightClickItem event) { if (!(event.getItemStack().is(this))) return; if (event.getSide() == LogicalSide.CLIENT) return; ItemStack item = event.getItemStack(); ServerPlayer player = (ServerPlayer) event.getPlayer(); LazyOptional<IItemHandler> cap = item.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); if (cap.isPresent()) { NetworkHooks.openGui(((ServerPlayer) event.getPlayer()), new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> ChestMenu.threeRows(1, new Inventory(player)), new TextComponent("Test"))); } } But this just opens a blank inventory, I could copy the IItemHandler's content to a new Inventory instance, but is this really the way you do it?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.