Started by
willmod4food
on
Topic category: Help with Minecraft modding (Java Edition)
I made a sort of infected version of a cow and I want it to spawn instead of cows naturally.
I have sort of pulled it off with a procedure that's called on the "Entity Spawns" global trigger, and it checks if the entity is a cow and if it is it spawns the infected cow and cancels the event so the normal cow doesint spawn. But it does this when a cow spawns in ANY way but I want you to be able to spawn normal cows from eggs and mob spawners.
I only want to replace the cow when it is spawned naturally by the world.
you can use this custom code snippet,
entity instanceof Mob _mob && _mob.getSpawnType() == EntitySpawnReason.NATURALthis is for NeoForge 1.21.8. If you're on a different version, just say so and I'll figure it out