Jump to content

[1.7.10] LivingSpawnEvent.CheckSpawn not working for passive mobs?


McJty

Recommended Posts

I am struggling with a problem with LivingSpawnEvent.CheckSpawn. It works perfectly fine for hostile mobs but passive mobs that are generated at chunk generation time (i.e. passive sheep, cows and so on) are not going through that even it seems. Even though according to the Minecraft code it should. Here is the code snippet:

 

    @SubscribeEvent
    public void onEntitySpawnEvent(LivingSpawnEvent.CheckSpawn event) {
        System.out.println("event.entity.toString() = " + event.entity.toString());
    }

 

This code works fine for hostile mob spawns. I can see the print in my console but nothing happens for passive mobs.

 

Any clue?

Link to comment
Share on other sites

this event is not fired for EntityAnimal or any derived class. try using EntityJoinWorld instead

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

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.