Posted June 1, 20232 yr I am trying to make a mod that revamps pre-existing hostile mobs in minecraft. I want to make zombies spawn in hordes and change some of the base stats, however I can not find any tutorial that really covers this. I can program Java just fine but all the libraries and necessary files confuse me. I am using forge and intelliJ to make this mod. Any help would be appreciated.
June 2, 20232 yr 14 hours ago, sandbag11 said: I want to make zombies spawn in hordes and change some of the base stats, however I can not find any tutorial that really covers this. This sounds like a datapack imo. To change the weights for zombies, you can apply a biome modifier. As for hanging the base stats, you can apply the values using the EntityJoinLevelEvent event.
June 2, 20232 yr Author If it is not too much of a bother, can you point me to some resources that better explain those two concepts, biome modifiers and EntityJoinLevelEvent. Thank you for the advice!
June 5, 20232 yr We have docs on biome modifiers; however, EntityJoinLevelEvent only has the javadocs on the class itself. The basic concept is that it allows you to set values on the entity before it spawns into the world.
June 5, 20232 yr Author @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?
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.