Bukkit/Bukkit — pull request #706 by turt2live (2012-11-03 02:56:18+00:00)
Title: Added PlayerPotionEffectChangeEvent

Long name, I know. This PR (and the associated Bukkit PR) is likely not going to get pulled, I'm aware of that.

I kinda meant for this PR to show what kinds of things are to be expected of an event like this.

Halfway through writing this thing, I thought of more ways to improve it. I'll do it if asked enough, but as is I'm satisfied. Such ways include:

- Using living entities instead
- Incorporating real durations and amplifications to the event

I'm sure there are more.

Associated CraftBukkit Pull Request: https://github.com/Bukkit/CraftBukkit/pull/912
Main ticket: https://bukkit.atlassian.net/browse/BUKKIT-2817

USE CASE:
For me personally, I would like a way to stop certain players from gaining beacon effects, and after much research (well, not really...) it was found they were just potion effects.

This new event allows plugin authors to better control what potion effects players (and maybe entities, if this were to be expanded) can, and cannot, have.

Although it is noted that you are unable to cancel a loss of an effect, this is described in the commit as "You cannot stop time".

Suggestions are welcome, I will do as much as I can to help ensure this (or something like it) ends up in Bukkit so I can continue my plugin easily.

(PS: I'm sure a lot of other developers would love this event as well, like WorldGuard, and region plugin, permissions plugins, etc, etc...)