public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable
Event.Result
entity
Constructor and Description |
---|
PotionSplashEvent(@NotNull ThrownPotion potion,
@NotNull Map<LivingEntity,Double> affectedEntities) |
Modifier and Type | Method and Description |
---|---|
@NotNull Collection<LivingEntity> |
getAffectedEntities()
Retrieves a list of all effected entities
|
@NotNull ThrownPotion |
getEntity()
Returns the Entity involved in this event
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
double |
getIntensity(@NotNull LivingEntity entity)
Gets the intensity of the potion's effects for given entity; This
depends on the distance to the impact center
|
@NotNull ThrownPotion |
getPotion()
Gets the potion which caused this event
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Whether to cancel the action that occurs when the projectile hits.
|
void |
setIntensity(@NotNull LivingEntity entity,
double intensity)
Overwrites the intensity for a given entity
|
getHitBlock, getHitBlockFace, getHitEntity
getEntityType
callEvent, getEventName, isAsynchronous
public PotionSplashEvent(@NotNull @NotNull ThrownPotion potion, @NotNull @NotNull Map<LivingEntity,Double> affectedEntities)
@NotNull public @NotNull ThrownPotion getEntity()
EntityEvent
getEntity
in class ProjectileHitEvent
@NotNull public @NotNull ThrownPotion getPotion()
@NotNull public @NotNull Collection<LivingEntity> getAffectedEntities()
public double getIntensity(@NotNull @NotNull LivingEntity entity)
entity
- Which entity to get intensity forpublic void setIntensity(@NotNull @NotNull LivingEntity entity, double intensity)
entity
- For which entity to define a new intensityintensity
- relative to maximum effectpublic boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
isCancelled
in class ProjectileHitEvent
public void setCancelled(boolean cancel)
ProjectileHitEvent
FireworkExplodeEvent
).
setCancelled
in interface Cancellable
setCancelled
in class ProjectileHitEvent
cancel
- true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class ProjectileHitEvent
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.