Cancellable
public class EntityTargetLivingEntityEvent extends EntityTargetEvent
LivingEntity
and can only target
LivingEntity's.EntityTargetEvent.TargetReason
Event.Result
entity
Constructor | Description |
---|---|
EntityTargetLivingEntityEvent(@NotNull Entity entity,
@Nullable LivingEntity target,
@Nullable EntityTargetEvent.TargetReason reason) |
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.
|
getEntity, getEntityType
getHandlerList, getHandlers, getReason, isCancelled, setCancelled
callEvent, getEventName, isAsynchronous
public EntityTargetLivingEntityEvent(@NotNull @NotNull Entity entity, @Nullable @Nullable LivingEntity target, @Nullable @Nullable EntityTargetEvent.TargetReason reason)
@Nullable public @Nullable LivingEntity getTarget()
EntityTargetEvent
This will be null in the case that the event is called when the mob forgets its target.
getTarget
in class EntityTargetEvent
public void setTarget(@Nullable @Nullable Entity target)
It is possible to be null, null will cause the entity to be target-less.
Must be a LivingEntity, or null.
setTarget
in class EntityTargetEvent
target
- The entity to targetCopyright © 2020. All rights reserved.