Topic category: Help with Minecraft modding (Java Edition)
I'm looking for a way to disable item-drops for blocks destroyed by explosions, without disableing item-drops of the player (eg. mining a block with a pickaxe).
I've got a few ideas on how to tackle this issue. Sadly I don't know, how to get these ideas to work. That's why I'm reaching out to you guys. Maybe you can figure this out.
Idea 1: /gamerule "doTileDrops"
Find a way to exclude player item-drops from the gamerule "doTileDrops".
By default it disables all kind of item-drops from Blocks.
Idea 2: Modify /gamerule tntExplosionDropDecay
If set to "true" only 20% of the destroyed blocks actually drop. If there was a way to bring these 20% down to zero, no destroyed blocks would drop anymore.
Idea 3: Checking for "IF destroyed by explosion"
There seems to be is no way to check if a block was broken by an explosion. A trigger for this sadly doesn't exist for vanilla blocks.
Idea 4: Global trigger: "An explosion accours"
This trigger can be used to despawn item-entities in a specified area around where the explosion accoured.
Altough it works, it isn't desirable, because it may also delete item-drops caused by the player nearby.
Idea 5: The old "Explode at x: [x] y: [x] z: [z] with power..."-block
Consider this last "Idea" a Suggestion.
In previous versions of MCreator, when using the block "Explode at x: [x] y: [x] z: [z] with power..." from the "World precedures"-tab, there was a drop-down menu called "type" in which
there were the options: NONE, BREAK and DESTROY.
BREAK would break the block an drop the corresponding item, but DESTROY would only break the block without dropping a item.
Would there be a way to reimplement this old functionality along the with the new "source type"?