summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index feef438c..cffa778f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -313,6 +313,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().hasEffect(MobEffectList.fromId(type.getId()));
}
+ @Override
+ public PotionEffect getPotionEffect(PotionEffectType type) {
+ MobEffect handle = getHandle().getEffect(MobEffectList.fromId(type.getId()));
+ return (handle == null) ? null : new PotionEffect(PotionEffectType.getById(MobEffectList.getId(handle.getMobEffect())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isShowParticles());
+ }
+
public void removePotionEffect(PotionEffectType type) {
getHandle().removeEffect(MobEffectList.fromId(type.getId()));
}