minecraft:uses_legacy_ambient_sounds for you with a switch.Get GodCraftOverview
minecraft:uses_legacy_ambient_sounds is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Picks the idle sound automatically: ambient.in.air while off the ground, ambient.in.water with its head underwater, ambient.baby for babies, and ambient the rest of the time.
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:uses_legacy_ambient_sounds": {}
}