Cancellablepublic class EntityTargetLivingEntityEvent extends EntityTargetEvent
LivingEntity and can only target
 LivingEntity's.EntityTargetEvent.TargetReasonEvent.Resultentity| Constructor | Description | 
|---|---|
| EntityTargetLivingEntityEvent(Entity entity,
                             LivingEntity target,
                             EntityTargetEvent.TargetReason reason) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| LivingEntity | getTarget() | Get the entity that this is targeting. | 
| void | setTarget(Entity target) | Set the Entity that you want the mob to target. | 
getEntity, getEntityTypegetHandlerList, getHandlers, getReason, isCancelled, setCancelledcallEvent, getEventName, isAsynchronouspublic EntityTargetLivingEntityEvent(@NotNull
                                     Entity entity,
                                     @Nullable
                                     LivingEntity target,
                                     @Nullable
                                     EntityTargetEvent.TargetReason reason)
@Nullable public LivingEntity getTarget()
EntityTargetEventThis will be null in the case that the event is called when the mob forgets its target.
getTarget in class EntityTargetEventpublic void setTarget(@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 EntityTargetEventtarget - The entity to targetCopyright © 2020. All rights reserved.