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
-
public class LivingSetAttackTargetEvent extends LivingEvent
LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.
This event is fired whenever an Entity sets a target to attack inEntityLiving#setAttackTarget(EntityLivingBase)
andEntityLivingBase#setRevengeTarget(EntityLivingBase)
.
This event is fired via theForgeHooks#onLivingSetAttackTarget(EntityLivingBase, EntityLivingBase)
.
target
contains the newly targeted Entity.
This event is notCancelable
.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.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.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private LivingEntity
target
-
Constructor Summary
Constructors Constructor Description LivingSetAttackTargetEvent(LivingEntity entity, LivingEntity target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LivingEntity
getTarget()
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
target
private final LivingEntity target
-
-
Constructor Detail
-
LivingSetAttackTargetEvent
public LivingSetAttackTargetEvent(LivingEntity entity, LivingEntity target)
-
-
Method Detail
-
getTarget
public LivingEntity getTarget()
-
-