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 guys,

as you can see in the Title, i have a problem with natural spawning of my custom entities. My forge version is currently 1.16.5-36.1.18.

For the spawning i use the BiomeLoadingEvent: (This is in my CommonEvents.class)

	@SubscribeEvent
	public void registerEntitySpawns(BiomeLoadingEvent spawn) {	
		if(spawn.getCategory() != Biome.Category.NETHER || spawn.getCategory() != Biome.Category.OCEAN || spawn.getCategory() != Biome.Category.THEEND) {
			spawn.getSpawns().addSpawn(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(ModEntityTypes.PLUS.get(), 14, 0, 1));
			spawn.getSpawns().addSpawn(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(ModEntityTypes.DEMI_HOLLOW.get(), 14, 0, 1));
		}	
		
		System.out.println("Spawner: " + spawn.getSpawns().getSpawner(EntityClassification.CREATURE));
	}

Main.class

 private void setup(final FMLCommonSetupEvent event)
 {
	 event.enqueueWork(() -> {
		//Register
		....
		EntitySpawnPlacementRegistry.register(ModEntityTypes.PLUS.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, EntityPlus::checkGhostSpawnRules);
		EntitySpawnPlacementRegistry.register(ModEntityTypes.DEMI_HOLLOW.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, EntityDemiHollow::checkGhostSpawnRules);
		
		MinecraftForge.EVENT_BUS.register(new CommonEvents());
	 });
 }

The problem is: If im using EntityClassification.CREATURE then nothing happens but if im using AMBIENT, WATER_CREATURE or MONSTER than the mob spawn.

AMBIENT: My custom Mob spawn when a minecraft:bat should be spawned (A bat is also an AMBIENT)

WATER_CREATURE: After 30 - 45 seconds i have an army of Plus (Almost every second a Plus gets spawned)

MONSTER: Only when a monster can spawn, my custom entity spawn too (Im using custom SpawnRules without any Lightlevel check but my entities still only spawn at night or thunder)

There must be something that i messed up but i cant figure it out myself right now.

Thanks in advance for helping out.

 

For the MONSTER, there still a light usage in MonsterEntity#getWalkTargetValue which is used during spawning, so you probably want to override and return 0.0F, or do something based on the block below.

 

For the WATER_CREATURE, I'm assuming that your Plus mob isn't registered as a WATER_CREATURE, using different types for register and spawners can cause problems like this.

Edited by lupicus
formatting

  • Author

Thanks lupicus for the answer.

It helps me with my other entity that have the classfication MONSTER.

My Plus is registered as a CREATURE and dont spawn if i do this:

spawn.getSpawns().addSpawn(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(ModEntityTypes.PLUS.get(), 14, 0, 1));

WATER_CREATURE and AMBIENT was for testing, to see if my Plus really spawns.

  • 1 month later...
  • Author

bump (the Problem still remains because i took a long break from modding)

Edited by PJack

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.