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

Hello,

I am in the process of learning how to make a mod but I am stuck on the spawning portion.

My current mapping is: mappings channel: 'snapshot', version: '20200723-1.16.1'

 

The errors I get are:

error: cannot find symbol
                            .add(new Biome.SpawnListEntry(ModEntityTypes.BENGAL_CAT.get(), 10, 3, 5));
                                          ^
  symbol:   class SpawnListEntry
  location: class Biome

and

error: cannot find symbol
                    biome.getSpawns(EntityClassification.CREATURE)
                         ^
  symbol:   method getSpawns(EntityClassification)
  location: variable biome of type Biome

 

Here is the code.

package com.undecimber.naturereconstructed.world.gen;

import com.undecimber.naturereconstructed.naturereconstructed;
import com.undecimber.naturereconstructed.init.ModEntityTypes;
import net.minecraft.entity.EntityClassification;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.registries.ForgeRegistries;

@Mod.EventBusSubscriber(modid = naturereconstructed.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEntitySpawns {

    @SubscribeEvent
    public static void spawnEntities(FMLLoadCompleteEvent event) {
        for (Biome biome : ForgeRegistries.BIOMES) {

            // Nether Mobs
            if (biome.getCategory() == Biome.Category.NETHER) { }

            // End Mobs
            else if (biome.getCategory() == Biome.Category.THEEND) { }

            // Overworld Mobs
            else {
                if (biome.getCategory() != Biome.Category.OCEAN) {
                    biome.getSpawns(EntityClassification.CREATURE)
                            .add(new Biome.SpawnListEntry(ModEntityTypes.BENGAL_CAT.get(), 10, 3, 5));
                }
            }
        }
    }
}

 

Edited by Undecimber

  • Author
3 minutes ago, Beethoven92 said:

The correct name for your mappings would be: 20200723-1.16.1

I typed it in this website incorrectly. My mappings is:

mappings channel: 'snapshot', version: '20200723-1.16.1'

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.