SPIGOT-2578: Method to get PotionEffect of specific type.

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2016-08-07 10:53:34 +10:00
parent bab2e9ce17
commit d57088a9c9

View file

@ -276,6 +276,16 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
*/ */
public boolean hasPotionEffect(PotionEffectType type); public boolean hasPotionEffect(PotionEffectType type);
/**
* Returns the active {@link PotionEffect} of the specified type.
* <p>
* If the effect is not present on the entity then null will be returned.
*
* @param type the potion type to check
* @return the effect active on this entity, or null if not active.
*/
public PotionEffect getPotionEffect(PotionEffectType type);
/** /**
* Removes any effects present of the given {@link PotionEffectType}. * Removes any effects present of the given {@link PotionEffectType}.
* *