@SubscribeEvent
public static void zombieHealth(EntityJoinLevelEvent event)
{
if(event.getEntity() instanceof Zombie zombie)
{
zombie.setHealth(50);
}
}
this is the code im trying to use to set the zombies health to 50 from 20. It does not work. I have another event, livinghurtevent, that tells me the mobs health everytime i hit it and it works. I just cant get the zombie health part to work. Also as a test i wanted to add a part in the current event that would send a chat message that a zombie spawned and with what health it had. How would i fix this?