LivingHurtEvent
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.LivingHurtEvent;
Extends
LivingHurtEvent extends LivingEvent
.
Implements
LivingHurtEvent
implements the following interfaces:
Listening to the event
This event can be listened to like so:
events.register<crafttweaker.neoforge.api.event.entity.living.LivingHurtEvent>(event => { println("LivingHurtEvent ran!");});
Members
Getter
// LivingHurtEvent.amount as floatevent.amount
Return Type:
float
Setter
// LivingHurtEvent.amount = (amount as float);event.amount = myFloat;
Parameters:
amount: float
Type: float
cancel()
Cancels the event. Same as script.zs
setCanceled(true)
// LivingHurtEvent.cancel();event.cancel();
Getter
// LivingHurtEvent.canceled as boolevent.canceled
Return Type:
bool
Setter
// LivingHurtEvent.canceled = (cancel as bool);event.canceled = myBool;
Parameters:
cancel: bool
Type: bool
canceled() as bool
// LivingHurtEvent.canceled() as bool;event.canceled();
Return Type:
bool
canceled(cancel as bool)
// LivingHurtEvent.canceled(cancel as bool);event.canceled(myBool);
Parameters:
cancel: bool
Type: bool
Getter
// LivingHurtEvent.entity as LivingEntityevent.entity
Return Type:
LivingEntity
Getter
Getter
// LivingHurtEvent.source as DamageSourceevent.source
Return Type:
DamageSource