How do I add a custom loot table to a vanilla block when using a custom tool? (2023.3)

Started by Resudog35 on

Topic category: Help with MCreator software

Last seen on 09:50, 6. Feb 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add a custom loot table to a vanilla block when using a custom tool? (2023.3)

I'm trying to make a seperate loot table for dirt when broken with a custom tool, how can I accomplish this?

Last seen on 16:02, 15. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Normally you would make a…
Mon, 02/12/2024 - 12:44

Normally you would make a loot table with the same registry name to replace the dirt loot table. But if you want it to be specific to a custom tool, you would have to make a procedure for it.

The basic idea would be to use the 'block broken' global trigger, then check if the block is dirt, and the item in the main hand of the target entity is your custom tool. If both are true, you would then spawn the item you want it to drop. You can use a 'random integer' function to randomize the number of items dropped, or to allow for multiple different items to drop.