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.

NooterDooter

Members
  • Joined

  • Last visited

  1. Been hopping around the forums lately and can't really get a concrete answer on how to make your custom entity spawn in a particular biome. The code I have registers the entity placement using EntitySpawnPlacementRegistry.register() and adds a new SpawnListEntry to all biomes, for testing purposes, and is then put in a FMLCommonSetupEvent event. However, when I launch the game, I see no entities spawn even though I have it to where it should spawn in all biomes. Below is the code that I have. Also please excuse any bad formatting All help is appreciated! Note: The SpawnListEntry I used uses the same values that a Minecraft Sheep does besides the entity of course. EventSpawnRocky.java public class EventSpawnRocky { @SubscribeEvent public static void spawnRocky(FMLCommonSetupEvent event) { DeferredWorkQueue.runLater(new Runnable() { @Override public void run() { ForgeRegistries.BIOMES.getValues().stream() .forEach( biome -> { List<Biome.SpawnListEntry> creatures = biome.getSpawns(EntityClassification.CREATURE); creatures.add(new SpawnListEntry(ModEntities.rocky, 12, 4, 4)); }); }} ); } } MainModClass - Things we care about in setup_common, which is a FMLCommonSetupEvent DeferredWorkQueue.runLater(new Runnable() { @Override public void run() { EntitySpawnPlacementRegistry.register(ModEntities.rocky, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, EntityRocky::spawnConditions); } }); and MinecraftForge.EVENT_BUS.register(EventSpawnRocky.class); spawnConditions from EntityRocky.java - I have it returning true for now. public static boolean spawnConditions(EntityType<EntityRocky> rocky, IWorld world, SpawnReason reason, BlockPos blockPos, Random rand) { return true; }

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.