LivingKnockBackEvent

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.

script.zs
import crafttweaker.neoforge.api.event.entity.living.LivingKnockBackEvent;

Extends

LivingKnockBackEvent extends LivingEvent.

Implements

LivingKnockBackEvent implements the following interfaces:

ICancellableEvent

Listening to the event

This event can be listened to like so:

script.zs
events.register<crafttweaker.neoforge.api.event.entity.living.LivingKnockBackEvent>(event => {
println("LivingKnockBackEvent ran!");
});

Members

cancel()
Cancels the event. Same as setCanceled(true)
script.zs
// LivingKnockBackEvent.cancel();
event.cancel();
Getter
script.zs
// LivingKnockBackEvent.canceled as bool
event.canceled

Return Type: bool

Setter
script.zs
// LivingKnockBackEvent.canceled = (cancel as bool);
event.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// LivingKnockBackEvent.canceled() as bool;
event.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// LivingKnockBackEvent.canceled(cancel as bool);
event.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// LivingKnockBackEvent.entity as LivingEntity
event.entity

Return Type: LivingEntity

Getter
script.zs
// LivingKnockBackEvent.entity as Entity
event.entity

Return Type: Entity

Getter
script.zs
// LivingKnockBackEvent.originalRatioX as double
event.originalRatioX

Return Type: double

Getter
script.zs
// LivingKnockBackEvent.originalRatioZ as double
event.originalRatioZ

Return Type: double

Getter
script.zs
// LivingKnockBackEvent.originalStrength as float
event.originalStrength

Return Type: float

Getter
script.zs
// LivingKnockBackEvent.ratioX as double
event.ratioX

Return Type: double

Setter
script.zs
// LivingKnockBackEvent.ratioX = (ratioX as double);
event.ratioX = myDouble;

Parameters:

ratioX Type: double
Getter
script.zs
// LivingKnockBackEvent.ratioZ as double
event.ratioZ

Return Type: double

Setter
script.zs
// LivingKnockBackEvent.ratioZ = (ratioZ as double);
event.ratioZ = myDouble;

Parameters:

ratioZ Type: double
Getter
script.zs
// LivingKnockBackEvent.strength as float
event.strength

Return Type: float

Setter
script.zs
// LivingKnockBackEvent.strength = (strength as float);
event.strength = myFloat;

Parameters:

strength Type: float