How can I get items from a loot table to *drop* on a trigger?

Started by liarbag on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I get items from a loot table to *drop* on a trigger?

So basically, I have an item that, when right clicked, I want to drop an item from a loot table in front of the player. I know the spawn item command, and I have a loot table, but how can I link the two? I don't know if there's a 'loot table data block' or something I can plug into the gem. Thanks!

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You dont need spawn item…
Tue, 10/15/2024 - 16:25

You dont need spawn item command. Just use the spanw item procedure block. 

Use:

For each item from loot table [mod_name:type/custom_loot_table_name] as [itemstack iterator]

       spawn item [itemstack iterator] at x y z

 

Also make a logic if the trigger is a tick.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Works great, thanks!
Wed, 10/16/2024 - 03:44

Works great, thanks!