Is there any way to get a random item without naming every item in minecraft?

If you can use datapacks, then the following method is a possibility. The method can take a lot of time to make, but requires a few commands to run. So in a datapack make a loot table with every item as a possibility. You can use misode.github.io as a generator. This loot table doesn't need to be a specific type of loot table, but if you want to get the item in a chest, I'm pretty you have to set it to a chest type. With a loot table you can add weight to make one item appear more often the others. If you don't want to spend the time creating this loot table , then if you know a programming language, you can automate it with an executable or a script. I know a programming language, so if you want me to automate it for you, I can. After you finished your loot table and properly installed it, then you have a few options. 1: Give a player a container with the item in it. 2: Give a player the item itself to the player. 3: Drop the item on the ground so the player can pick it up. I will start with number 1. For this method, use the command give <player selector> chest{BlockEntityTag:{LootTable:"<your loot table>"}}

Next is number 2. For this method use the following command.

loot give <player selector> loot <your loot table>

The next and final method is number 3. For this method use the following command.

loot spawn <coordinates> loot <your loot table>

For filling up the spots I didn't put in, use the in game command line. If you need help with anything let me know.