Truly simple example config could be: Instant Harm II enabled: (true of false) Regen II enabled: (true or false) etc etc BadPotion is close to this but doesn't actually block the brewing or simply delete the items when they're in hand. Please respond I know I'm not the only one who knows potions are too strong.
So you just want to be able to configure which potions are allowed to be used? Would you want it to block the brewing as well? Or just when they try to drink it the potion would be replaced with an empty water bottle, get a message saying that potion isn't allowed, and cancel the drinking event?
I would like in particular something that deletes item in hand if it gets the type of item (banned potions)
How would you want it deleted? Because I have a plugin that cancels you clicking on the invisibility potions so it disables them that way on my server. I could just make it so you can configure it to work with any potion and just remove the potion and not give an empty bottle?
If you could be so kind as to make this plugin it would be amazing for my server. I would like a listener for iteminhand and if the plugin gets a banned potion type as configured in the players hand it will replace the potion with air. If you don't want to bother with the configuration it could just remove all poison potions and level II potions but other than my idea I am open to as many suggestions of how to remove certain potions as possible. Thanks please reply.
It would be much easier to just cancel the drinking of the potion then check for items in hand. I'm not saying I will make it, I'm just trying to clarify what you want and if it would be something I could easily do to help you out And what do you mean you want a listener? The point of requesting a plugin is that someone else makes it. I would probably just use 1 class for this.
My idea is one of two things, and both achieve the same goal with varying levels of difficulty: 1: A plugin that will block potionisthrown events for banned potions, and block the drinking of banned potions. 2: A plugin that uses the iteminhand bukkit function and if a banned potion is in hand then it replaces with air. (Probably laggier and harder to do)
I would use the PlayerInteractEvent, and on every rightclick a player makes check if the item in hand is a banned potion. If yes, cancel the event and replace the item in hand with air. Shouldn't be that hard to do.