Jump to content

[1.14 ]Getting the count of all ChickenEntity


FunkyDonkyPunky

Recommended Posts

MC 1.14.4

I'm fairly new into mc modding, like 4 hours. So what i'm saying is probably not giving much sense but anyway, i'm trying to count all living chickens and i thought that it would be really simple but i guess it ain't.

I've got 
 

   @SubscribeEvent
   public void onLivingSpawnEvent(LivingEvent event)
   {

      LivingEntity entity = event.getEntityLiving();
      if(!(entity instanceof ChickenEntity && entity.hasCustomName()))
         return;

         LOGGER.warn(entity);

   }

I saw that each entity has its own id so i thought that i'd just remove the duplicates and get the final count but that wouldn't work and it's probably nowhere near the real solution.
So what's the proper way to count all living chickens per tick?

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.