Package org.bukkit.event.entity
Class EntityTargetLivingEntityEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- org.bukkit.event.entity.EntityEvent
-
- org.bukkit.event.entity.EntityTargetEvent
-
- org.bukkit.event.entity.EntityTargetLivingEntityEvent
-
- All Implemented Interfaces:
Cancellable
public class EntityTargetLivingEntityEvent extends EntityTargetEvent
Called when an Entity targets aLivingEntity
and can only target LivingEntity's.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bukkit.event.entity.EntityTargetEvent
EntityTargetEvent.TargetReason
-
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
-
Field Summary
-
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
-
Constructor Summary
Constructors Constructor Description EntityTargetLivingEntityEvent(@NotNull Entity entity, @Nullable LivingEntity target, @Nullable EntityTargetEvent.TargetReason reason)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable LivingEntity
getTarget()
Get the entity that this is targeting.void
setTarget(@Nullable Entity target)
Set the Entity that you want the mob to target.-
Methods inherited from class org.bukkit.event.entity.EntityTargetEvent
getHandlerList, getHandlers, getReason, isCancelled, setCancelled
-
Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityType
-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Constructor Detail
-
EntityTargetLivingEntityEvent
public EntityTargetLivingEntityEvent(@NotNull @NotNull Entity entity, @Nullable @Nullable LivingEntity target, @Nullable @Nullable EntityTargetEvent.TargetReason reason)
-
-
Method Detail
-
getTarget
@Nullable public @Nullable LivingEntity getTarget()
Description copied from class:EntityTargetEvent
Get the entity that this is targeting.This will be null in the case that the event is called when the mob forgets its target.
- Overrides:
getTarget
in classEntityTargetEvent
- Returns:
- The entity
-
setTarget
public void setTarget(@Nullable @Nullable Entity target)
Set the Entity that you want the mob to target.It is possible to be null, null will cause the entity to be target-less.
Must be a LivingEntity, or null.
- Overrides:
setTarget
in classEntityTargetEvent
- Parameters:
target
- The entity to target
-
-