TNTUtils

TNTUtils

11M Downloads

[Request] Block Drop Chance - Per Explosion Source

Opened this issue ยท 2 comments

commented

It would be useful to configure the drop chance on a per explosion source basis; e.g. creeper explosion drops 10%, wither explosion drops 0%, ghast explosion drops 90%, etc. or whatever. In my case, I want to completely remove drops for all mob explosions and still have TNT drop blocks, but I figure being able to configure it by explosion source could be useful for other people and meet my desired outcome.

commented

My above statement isn't true in newer Minecraft versions (such as 1.21), so it is actually possible to distinguish explosion sources.
Although it might be a bit complicated since I need to mix into one of the Level.explode overloads to capture the Level.ExplosionInteraction argument, and I need to figure out how to make it work comfortably with the config systems.

commented

Yeah, per source configurations for not only drop chance but other features as well sounds like a good idea.

However it might not always be possible to find out the source of an explosion. For instance, I can't distinguish a Ghast fireball from an exploding bed in the nether, or an exploding ender crystal. I'll see if I can work around that.