Class LivingSetAttackTargetEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent
@Deprecated(since="1.19.2",
forRemoval=true)
public class LivingSetAttackTargetEvent
extends LivingEvent
Deprecated, for removal: This API element is subject to removal in a future version.
This event is deprecated. Use
LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.
This event is fired whenever an Entity sets a target to attack in
This event is fired via the
This event is not
This event does not have a result.
This event is fired on the
LivingChangeTargetEvent
instead.LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.
This event is fired whenever an Entity sets a target to attack in
Mob.setTarget(LivingEntity)
or StartAttacking.setAttackTarget(Mob, LivingEntity)
This event is fired via the
ForgeHooks.onLivingSetAttackTarget(LivingEntity, LivingEntity)
.getTarget()
returns the newly targeted Entity.getTargetType()
returns the target type that caused the change of targets.This event is not
Cancelable
.This event does not have a result.
Event.HasResult
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final LivingEntity
Deprecated, for removal: This API element is subject to removal in a future version.private final LivingChangeTargetEvent.ILivingTargetType
Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorDescriptionLivingSetAttackTargetEvent
(LivingEntity entity, LivingEntity target) Deprecated, for removal: This API element is subject to removal in a future version.LivingSetAttackTargetEvent
(LivingEntity entity, LivingEntity target, LivingChangeTargetEvent.ILivingTargetType targetType) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Returns the target this living entity had after changing its target to a new target, but before posting this event..Deprecated, for removal: This API element is subject to removal in a future version.Returns the target type of this event..Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
targetType
Deprecated, for removal: This API element is subject to removal in a future version. -
originalTarget
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
LivingSetAttackTargetEvent
Deprecated, for removal: This API element is subject to removal in a future version. -
LivingSetAttackTargetEvent
public LivingSetAttackTargetEvent(LivingEntity entity, LivingEntity target, LivingChangeTargetEvent.ILivingTargetType targetType) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getTarget
Deprecated, for removal: This API element is subject to removal in a future version.Returns the target this living entity had after changing its target to a new target, but before posting this event..- Returns:
- the target this living entity had after changing its target to a new target, but before posting this event.
-
getTargetType
Deprecated, for removal: This API element is subject to removal in a future version.Returns the target type of this event..- Returns:
- the target type of this event.
-