Jump to content

[1.7.10] LivingSpawnEvent.CheckSpawn never fires


wwrpg

Recommended Posts

In my postInit I register my SpawningEventHandler.

 

    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
        MinecraftForge.EVENT_BUS.register(new SpawningEventHandler());
    }

 

And in my SpawningEventHandler, I just print out a line as well log a debug line that an entity tried to spawn.

 

public class SpawningEventHandler {

    @SubscribeEvent
    public void onCheckIfCanSpawn(CheckSpawn event) 
    {   
        System.out.println("[MRC] checking monster"); 
        FMLCommonHandler.instance().getFMLLogger().log(Level.DEBUG, "[WWRPG] checking if monster " + event.entityLiving + " can spawn at x,z,y " + event.x + "," + event.z + "," + event.y);
    }
}

 

 

Neither MRC nor WWRPG ever appear in my logs after seeing numerous creatures and monsters spawn.

Link to comment
Share on other sites

I should note that I see both creatures (chickens, sheep, cows) and monsters (skeletons, zombies, creepers) all spawning in my world.

I have re-generated my world multiple times as well tried moving the "MinecraftForge.EVENT_BUS.register(new SpawningEventHandler());" to the preInit and load.

 

Still no success in ever seeing an entry into the onCheckIfCanSpawn!

public class SpawningEventHandler {

    @SubscribeEvent
    public void onCheckIfCanSpawn(CheckSpawn event) 
    {   
        System.out.println("[MRC] checking monster"); 
        FMLCommonHandler.instance().getFMLLogger().log(Level.DEBUG, "[WWRPG] checking if monster " + event.entityLiving + " can spawn at x,z,y " + event.x + "," + event.z + "," + event.y);
    }
}

 

I do see that the performWorldGenSpawning in SpawnerAnimals.java does spawn EnumCreatureType.creature without ever firing forge's canEntitySpawn method, but I can't figure out how monsters are spawning???

 

For extra debug, I added an event handler for WorldEvent.PotentialSpawns to check if the monster list isn't null since it is called in the spawnRandomCreature before the ForgeEventFactory.canEntitySpawn method is called.

 

   @SubscribeEvent
    public void onPotentialSpawn(WorldEvent.PotentialSpawns event) 
    {   
        if ( event.type == EnumCreatureType.monster && event.list != null && !event.list.isEmpty() ){
           System.out.println("[MRC] potential random monster list is valid!"); 
        }
    }

 

And I get lots of debug hits for that as I explore the world... so I'm guessing either the "spawnlistentry == null" every time or the getConstructor is throwing an exception (even though I see no stack trace in the logs).

But regardless... this does not explain how monsters are still spawning??? I'm going crazy... what is spawning them?

Link to comment
Share on other sites

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.