Hi, once again now with a supported version, how am i supposed to count all living ChickenEntities?
I was thinking about getting every chicken entity uid on LivingEvent and then remove duplicates which could potentionally result in a chicken count.
But there has to be some better way to do that.
I've got like 5 hours of experience so dont expect much from me.
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?