Is it possible to force a block to be "mined" rather than broken?

Started by grtwatkins on

Topic category: Help with modding (Java Edition)

Last seen on 16:52, 14. Sep 2023
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to force a block to be "mined" rather than broken?

I'm very new to Mcreator so please excuse my ignorance!

Is there a procedure element to simulate breaking a block and dropping items as if it were broken with a pickaxe?

 

I'm making a practice mod that essentially just mines blocks, but I don't want to simply break the block and place it in an inventory, I'd like the block to be treated like it was mined with a pickaxe.

So rather than break a coal block and spit out a coal block, it breaks a coal block and spits out a few random pieces of coal following Minecraft's loot table.

I know I can do a check for block type every time and then use RNG to imitate Minecraft's loot tables, but that wouldn't work for modded ore blocks that I can't plan for. Was just curious if something like this was already built in. Thanks!

Last seen on 05:10, 3. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you are calling on the…
Sat, 09/23/2023 - 17:28

When you are calling on the loot table, you should be able to use a "get block ID" or "get block registry name" that way you can check for the loot table of the specific block, which should in theory be able to call other mods loot tables.