Jump to content

1.16.5 Problem with natural spawning


PJack

Recommended Posts

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.

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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.