MobDespawnEvent

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.spawn.MobDespawnEvent;

Extends

MobDespawnEvent extends MobSpawnEvent.

Listening to the event

This event can be listened to like so:

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

Members

Getter
script.zs
// MobDespawnEvent.entity as Mob
event.entity

Return Type: Mob

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

Return Type: Entity

Getter
script.zs
// MobDespawnEvent.level as ServerLevelAccessor
event.level

Return Type: ServerLevelAccessor

Getter
script.zs
// MobDespawnEvent.result as Result
event.result

Return Type: MobDespawnEventResult

Setter
script.zs
// MobDespawnEvent.result = (result as Result);
event.result = myResult;

Parameters:

Getter
script.zs
// MobDespawnEvent.x as double
event.x

Return Type: double

Getter
script.zs
// MobDespawnEvent.y as double
event.y

Return Type: double

Getter
script.zs
// MobDespawnEvent.z as double
event.z

Return Type: double