Class LivingChangeTargetEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingChangeTargetEvent
This event allows you to change the target an entity has. 
This event is fired before
 
This event is fired via the
 
 
 
 
 
This event is
 
If you cancel this event, the target will not be changed and it will stay the same. Cancelling this event will prevent
 
This event does not have a result.
 
This event is fired on the
This event is fired before
LivingSetAttackTargetEvent. This event is fired via the
ForgeHooks.onLivingChangeTarget(LivingEntity, LivingEntity, ILivingTargetType)getOriginalTarget() returns the target that should originally be set.
 The return value cannot be affected by calling setNewTarget(LivingEntity).getNewTarget() returns the new target that this entity will have.
 The return value can be affected by calling setNewTarget(LivingEntity).getTargetType() returns the target type that caused the change of targets.This event is
Cancelable.If you cancel this event, the target will not be changed and it will stay the same. Cancelling this event will prevent
LivingSetAttackTargetEvent from being posted.This event does not have a result.
Event.HasResultThis event is fired on the
MinecraftForge.EVENT_BUS.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceA living target type indicates what kind of system caused a change of targets.static enumThis enum contains two default living target types.Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEventLivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructingNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate LivingEntityprivate final LivingEntityprivate final LivingChangeTargetEvent.ILivingTargetType
- 
Constructor SummaryConstructorsConstructorDescriptionLivingChangeTargetEvent(LivingEntity entity, LivingEntity originalTarget, LivingChangeTargetEvent.ILivingTargetType targetType) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the new target of this entity..Returns the original entity MC intended to use as a target before firing this event..Returns the living target type..voidsetNewTarget(LivingEntity newTarget) Sets the new target this entity shall have.Methods inherited from class net.minecraftforge.event.entity.living.LivingEventgetEntityMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
targetType
- 
originalTarget
- 
newTarget
 
- 
- 
Constructor Details- 
LivingChangeTargetEventpublic LivingChangeTargetEvent(LivingEntity entity, LivingEntity originalTarget, LivingChangeTargetEvent.ILivingTargetType targetType) 
 
- 
- 
Method Details- 
getNewTargetReturns the new target of this entity..- Returns:
- the new target of this entity.
 
- 
setNewTargetSets the new target this entity shall have.- Parameters:
- newTarget- The new target of this entity.
 
- 
getTargetTypeReturns the living target type..- Returns:
- the living target type.
 
- 
getOriginalTargetReturns the original entity MC intended to use as a target before firing this event..- Returns:
- the original entity MC intended to use as a target before firing this event.
 
 
-