On block destroyed trigger - Drop item from block

Issue description

Would it be feasible to add the ability to drop an item from a block after the "a block is broken" trigger rather than having to spawn in an item after the block is destroyed to fake the action? Similar to how this is done in Java through the event handler.

I'm sure you know what I mean, but I'm referring to this just as an example:

@SubscribeEvent
 public void onDrops(BlockEvent.HarvestDropsEvent event) {
 
 if (event.block == Blocks.bookshelf && event.harvester.getHeldItem() != null && event.harvester.getHeldItem().getItem() == Items.blaze_powder)
 event.drops.add(new ItemStack(Blocks.bedrock));
 }

 

This adds the item (or block as an itemstack) to be dropped from that block rather than needing to spawn in the item as an entity when the block is broken. Not sure if event handling like this is possible with MCreator, but I would love to see more of it implemented in the future for better vanilla altering if possible.

Issue comments

I just realized that example is pretty convoluted and random, but the event.drops.add method is mainly what I'm referring to. And just general event handling like this overall.

This is now controlled by loot tables so this is not the right way to do it. We do plan on improving loot tables instead.

Thanks Klemen for that information. Do you know of any specific documentation or tutorials around for implementing loot tables in this manner? I've seen some general loot table tutorials, but haven't yet found anything on this specific subject. Also, do loot tables still allow for things like checking for fortune enchantments to drop multiple of the same item?

My apologies for not being clear. I do understand how loot tables function, just not in the context of how I would use one in MCreator to adjust vanilla block drops this way. I was more meaning is there any documentation or tutorials on how to implement this using MCreator? I really only have ever used loot tables for dungeon chests and the like.

Been playing around with this a bit and I have learned how to set drops to a vanilla block through a loot table, but I still don't understand how to apply fortune on a vanilla block through a loot table. If you or anyone else knows how this can be done, I would greatly appreciate the help because that's all I really needed from all of this.

Right now MCreator in UI does not support this, but with JSON it should be possible.

I suggest making a forum topic for this and checking vanilla loot tables for examples too.

Once I understood that you could still manipulate the JSON files the same as when doing it through Java, I was able to figure it out. Thank you so much for the feedback and talking me through this. I really appreciate it!

P.S. Out of curiosity, will there ever be support for texture animated tick updating in GUIs to be able to add the furnace burn time and progress bar animations like vanilla furnaces have?

GUIs to be able to add the furnace burn time and progress bar animations like vanilla furnaces have?

There is a ticket for this already.

For animated textures, possibly, but not soon as this is out of scope currently