I've been thinking about homebrewing some things. One of the benefits that I've been considering is a resistance to non-magical damage (for example, for a sort of Rage-lite feat), or perhaps immunity (for a sort of door-barring spell). I thought this was a neat idea, because it gives the DM the ability to override it if they need (give important baddies magic weapons), but also gives it a high cost (the party gets to loot a magic weapon if they have to contend with someone who cancels this advantage.)
But, thinking about it, there might be a lot of monsters with magical attacks available. Or maybe attacks from non-humanoid, non-beasts are magical by default or something. If either of those were the case, that benefit doesn't do anything in most cases. So, How common are magical attacks (including ranged/melee/spell, in terms of quantity of monsters in released sources (Monster manual, Volo's guide, Mordenkainen's Tome, etc.)?
A good answer would give a general idea of whether this benefit would apply often enough to be useful in the way I hoped (enemies that are unaffected are generally special) (e.g. "As a DM, I find that nearly all/very few of the monsters I use have a way of doing magical damage"), but the best answer would have actual numbers.
I'd love to have a nice table that just lists out these things (like something that says by CR ranges, here's how many have no magical attacks, here's how many whose attacks count as magical, and here's how many have spells, or whatever categories make the most sense), but I don't know if there are databases that tabulate information like that (Could a search for "counts as magical for the purposes of overcoming resistance", or the like, work?). Perhaps a random sampling of a more manageable number of monsters could be considered representative?