I'm trying to create a command on my Minecraft realm that kills all items if there are more than 500 items. My only issue is, I can't figure out how to test for any specific number of items, much less more than. I'm wondering if there is any way to do this in a single execute command, without need for scoreboards, that just execute if there are 500 of a specific entity. I have tried this:
/execute if entity @e[type=item,limit=500] run kill @e[type=item]
I know why this wouldn't work, but it was the only thing I could think of. I couldn't find anything on the Minecraft wiki for it, nor could I find any questions about it. Is it possible to do this?