Spawning a random item from minecraft database pool

Started by Marwinekk256 on

Topic category: Help with modding (Java Edition)

Last seen on 23:55, 17. Sep 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Spawning a random item from minecraft database pool

Hello,

I've been trying to make my custom block drop a random item of all the items in minecraft (not specific items, but ALL items) when destroyed but I can't think of anything that would work :(

I know that I can do that with a loot table in which I could just put every item into pool by hand - but that's the problem - how to do that in quicker and more clever way, than just putting every each of item into the loot pool

I'll be grateful for any help <3

Last seen on 23:55, 17. Sep 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would still appreciate…
Sun, 05/01/2022 - 17:18

I would still appreciate help with this thingy ;0

Last seen on 13:56, 19. Dec 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Somewhat of what you want…
Sun, 05/01/2022 - 18:18

Somewhat of what you want will be added in the next version of mcreator, but you need to somehow add the entire minecraft database pool to a tag.

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The only way to do this…
Tue, 05/03/2022 - 07:24

The only way to do this without custom code or a lot of if statements in mcreator is a loot table. Use a loot table generator to help you. I use https://misode.github.io/loot-table/.

Last seen on 23:55, 17. Sep 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yea I know I can use a loot…
Thu, 05/05/2022 - 12:27

Yea I know I can use a loot table but thats the problem - how to do it without a loot table? I don't mind a bit of coding, so I'd appreciate if y'all showed me how to access (even with custom coding) the item database so I don't have to define every single item in loot pools

Last seen on 23:55, 17. Sep 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also I don't want a loot…
Thu, 05/05/2022 - 12:35

Also I don't want a loot table method, cuz I want the block to spawn not only a random item from vanilla minecraft, but also items from other mods. That's why I need to know how to tell the code that it should spawn ANY item