From d57088a9c908908ba35f93e9e87ace41af57d1bb Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 7 Aug 2016 10:53:34 +1000 Subject: [PATCH] SPIGOT-2578: Method to get PotionEffect of specific type. By: md_5 --- .../src/main/java/org/bukkit/entity/LivingEntity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index 22de9f72be..69eda6de34 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -276,6 +276,16 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti */ public boolean hasPotionEffect(PotionEffectType type); + /** + * Returns the active {@link PotionEffect} of the specified type. + *

+ * 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}. *