Posted August 12, 20196 yr Hello, I'm having trouble getting a custom mob spawn at night in my custom biome. Adding a spawn for a vanilla Zombie will automatically make it spawn only at night, addSpawn(EntityClassification.MONSTER, Biome.SpawnListEntry(EntityType.ZOMBIE, 100, 5, 8)) but doing the same with my custom entity, which extends the ZombieEntity class and has EntityClassification.MONSTER classification will still make it spawn during the day
August 12, 20196 yr It looks like spawning conditions are handled by EntitySpawnPlacementRegistry in 1.14. You need to call EntitySpawnPlacementRegistry.register with your EntityType and a predicate that determines the conditions under which it can spawn. Zombies and other hostile mobs use MonsterEntity::func_223325_c for the predicate, this checks the difficulty and the light level. Edited August 12, 20196 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
August 12, 20196 yr Author 19 minutes ago, Choonster said: It looks like spawning conditions are handled by EntitySpawnPlacementRegistry in 1.14. You need to call EntitySpawnPlacementRegistry.register with your EntityType and a predicate that determines the conditions under which it can spawn. Zombies and other hostile mobs use MonsterEntity::func_223325_c for the predicate, this checks the difficulty and the light level. Thank you, but the register function is private inside EntitySpawnPlacementRegistry, isn't there any forge registry to handle this, or do I have to use reflection?
August 12, 20196 yr 3 minutes ago, Alex Sim said: Thank you, but the register function is private inside EntitySpawnPlacementRegistry, isn't there any forge registry to handle this, or do I have to use reflection? It was made public again in this PR (1.14.4-28.0.37). Update Forge. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
August 12, 20196 yr Author 21 minutes ago, Choonster said: It was made public again in this PR (1.14.4-28.0.37). Update Forge. Thank you, that worked Edited August 12, 20196 yr by Alex Sim
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.