garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
196 stars 151 forks source link

Feature Request: New Setting: remove-empty-bottles #736

Open Nesseley opened 2 years ago

Nesseley commented 2 years ago

Feature request

Short description Empty bottles from potions are annoying, lets remove them after a player drinks them!

Implementation details Adds a new arena setting: remove-empty-bottles: true/false Default state should be false The setting should remove the potion right after the player drinks it, in both main hand and off hand slot.

Additional info Mule is great!

garbagemule commented 2 years ago

I'm not sure how viable this is. From what I recall, there's an ordering issue in terms of when a player drinks a potion and that potion changing to a water bottle. Definitely requires a bit of experimentation. We'd only want to remove empty water bottles that are "created" as the result of drinking a potion and not pre-existing water bottles that a player may be holding in their inventory.

Nesseley commented 2 years ago

I am already using a plugin which has this exact functionality, so it is possible :)

garbagemule commented 2 years ago

Yes, of course it's possible, but that doesn't mean it's viable. We've never worked from an "any means necessary" perspective. The question is whether it can be done in a clear, reasonable, predictable, and maintainable way, or if we need to implement a set of heuristics. There's no AddWaterBottleToInventoryAfterPotionDrinkEvent to cancel, so some investigation is necessary to figure out what the moving parts are and in which order they play out between a player consuming a potion and a water bottle spawning in their inventory.

But if there already is a plugin that does this, why do we need to implement it here as well?

Nesseley commented 2 years ago

But if there already is a plugin that does this, why do we need to implement it here as well?

Because the plugin is outdated and doesn't support offhand potions. And this feature is something I know people have asked for in the past, and something I've thought about everytime I play 😅

I think the plugin listened for some potiondrink event, then ran a remove item if glass bottle or something after