How do I give player a random item

Started by odchody on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I give player a random item
Sun, 06/29/2025 - 18:39 (edited)

Does anyone know how can I give player a completely random item from the game?

Edited by odchody on Sun, 06/29/2025 - 18:39
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I do not believe that there…
Sun, 06/29/2025 - 20:34

I do not believe that there currently is any procedure block that can do that. If you explain what you're trying to do (ex: make a loot crate) then I can help you figure out a workaround.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A basic workaround for…
Sun, 06/29/2025 - 20:49

A basic workaround for pretty much any situation is to create a new item tag, put every item in vanilla Minecraft into the tag, then use the get random item from tag procedure block.

However, it wouldn't work with items from other mods.