Commits
md_5 authored 18490e51b16
269 269 | |
270 270 | /** |
271 271 | * Returns whether the living entity already has an existing effect of |
272 272 | * the given {@link PotionEffectType} applied to it. |
273 273 | * |
274 274 | * @param type the potion type to check |
275 275 | * @return whether the living entity has this potion effect active on them |
276 276 | */ |
277 277 | public boolean hasPotionEffect(PotionEffectType type); |
278 278 | |
279 + | /** |
280 + | * Returns the active {@link PotionEffect} of the specified type. |
281 + | * <p> |
282 + | * If the effect is not present on the entity then null will be returned. |
283 + | * |
284 + | * @param type the potion type to check |
285 + | * @return the effect active on this entity, or null if not active. |
286 + | */ |
287 + | public PotionEffect getPotionEffect(PotionEffectType type); |
288 + | |
279 289 | /** |
280 290 | * Removes any effects present of the given {@link PotionEffectType}. |
281 291 | * |
282 292 | * @param type the potion type to remove |
283 293 | */ |
284 294 | public void removePotionEffect(PotionEffectType type); |
285 295 | |
286 296 | /** |
287 297 | * Returns all currently active {@link PotionEffect}s on the living |
288 298 | * entity. |