I cannot get my custom entities to spawn naturally in the world. They spawn successfully from a spawn egg. I have tried a video and did what they said, but still doesn't work.
I put this in the entity's class:
public static boolean canSpawn(EntityType<CarnAchillobator> entityType, ServerLevelAccessor levelAccessor, MobSpawnType mobSpawnType, BlockPos pos, RandomSource randomSource) {
return Monster.checkMonsterSpawnRules(entityType, levelAccessor, mobSpawnType, pos, randomSource);
}
I this in the main class:
@SubscribeEvent
public static void registerSpawnPlacementsEvent(@NotNull SpawnPlacementRegisterEvent event) {
event.register(ModEntities.ACHILLOBATOR.get(), SpawnPlacements.Type.ON_GROUND, Heightmap.Types.WORLD_SURFACE, CarnAchillobator::canSpawn, SpawnPlacementRegisterEvent.Operation.AND);
In the modid/biome_modifier directory, spawn_achillobator.json file:
{
"type": "forge:add_spawns",
"biomes": [
"minecraft:jungle",
"minecraft:sparse_jungle",
"minecraft:windswept_forest",
"minecraft:dark_forest",
"minecraft:old_growth_birch_forest"
],
"spawners": {
"type": "wilddinos:achillobator",
"weight": 100,
"minCount": 1,
"maxCount": 1
}
}