LivingIncomingDamageEvent
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.neoforge.api.event.entity.living.LivingIncomingDamageEvent;
Extends
LivingIncomingDamageEvent extends LivingEvent
.
Implements
LivingIncomingDamageEvent
implements the following interfaces:
Listening to the event
This event can be listened to like so:
events.register<crafttweaker.neoforge.api.event.entity.living.LivingIncomingDamageEvent>(event => { println("LivingIncomingDamageEvent ran!");});
Members
addReductionModifier(type as Reduction, reductionFunc as IReductionFunction)
// LivingIncomingDamageEvent.addReductionModifier(type as DamageContainerReduction, reductionFunc as IReductionFunction);event.addReductionModifier(myReduction, myIReductionFunction);
Parameters:
type: DamageContainerReduction
Type: DamageContainerReduction
reductionFunc: IReductionFunction
Type: IReductionFunction
Getter
// LivingIncomingDamageEvent.amount as floatevent.amount
Return Type:
float
Setter
// LivingIncomingDamageEvent.amount = (newDamage as float);event.amount = myFloat;
Parameters:
newDamage: float
Type: float
cancel()
Cancels the event. Same as script.zs
setCanceled(true)
// LivingIncomingDamageEvent.cancel();event.cancel();
Getter
// LivingIncomingDamageEvent.canceled as boolevent.canceled
Return Type:
bool
Setter
// LivingIncomingDamageEvent.canceled = (cancel as bool);event.canceled = myBool;
Parameters:
cancel: bool
Type: bool
canceled() as bool
// LivingIncomingDamageEvent.canceled() as bool;event.canceled();
Return Type:
bool
canceled(cancel as bool)
// LivingIncomingDamageEvent.canceled(cancel as bool);event.canceled(myBool);
Parameters:
cancel: bool
Type: bool
Getter
// LivingIncomingDamageEvent.container as DamageContainerevent.container
Return Type:
DamageContainer
Getter
// LivingIncomingDamageEvent.entity as LivingEntityevent.entity
Return Type:
LivingEntity
Getter
Getter
// LivingIncomingDamageEvent.originalAmount as floatevent.originalAmount
Return Type:
float
setInvulnerabilityTicks(ticks as int)
// LivingIncomingDamageEvent.setInvulnerabilityTicks(ticks as int);event.setInvulnerabilityTicks(myInt);
Parameters:
ticks: int
Type: int
Getter
// LivingIncomingDamageEvent.source as DamageSourceevent.source
Return Type:
DamageSource