Seeloewen / Random-Item-Giver-Datapack

Get a random item every x seconds! The time is fully customizable and you can also select which types of items you want to receive.
16 stars 6 forks source link

Run a command to give random item to a specific player #5

Closed dotnetian closed 2 years ago

dotnetian commented 2 years ago

Hi again & thanks for your great support on this awesome datapack. Is there a function to give a specific player random item?

Seeloewen commented 2 years ago

Actually, Github has a feature to transfer issues to another repo, I will transfer this to the Random Item Giver Repo myself.

Seeloewen commented 2 years ago

You could execute the command /loot give {player} loot randomitemgiver:1item/main which gives the player a random item from the main loot table. There are also other loot tables, I can give you a list of them if you want.

dotnetian commented 2 years ago

Hello again. Thanks. But what are loot tables?

Seeloewen commented 2 years ago

Loot Tables are files, which contain information about what items you can get. For example, there's a loot table in my datapack which contains all vanilla items, one which contains potions etc.

There are also other uses of loot tables in Minecraft besides Datapacks. You know how you get different items when fishing? Well, fishing gives you items based on a loot table. You could modify that loot table and get different items when fishing, same goes for chests and so on.

If you use the /loot command above, you will only get one of the items listed in that loot table.

So to make it short, loot tables are files which contain a list of items.

dotnetian commented 2 years ago

Thanks