FinalizeMobSpawnEvent

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.FinalizeMobSpawnEvent;

Extends

FinalizeMobSpawnEvent extends MobSpawnEvent.

Implements

FinalizeMobSpawnEvent 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.spawn.FinalizeMobSpawnEvent>(event => {
println("FinalizeMobSpawnEvent ran!");
});

Members

Getter
script.zs
// FinalizeSpawnEvent.blockEntitySpawner as BlockEntity
event.blockEntitySpawner

Return Type: BlockEntity

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

Return Type: bool

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

Parameters:

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

Return Type: bool

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

Parameters:

cancel Type: bool
Getter
script.zs
// FinalizeSpawnEvent.difficulty as DifficultyInstance
event.difficulty

Return Type: DifficultyInstance

Setter
script.zs
// FinalizeSpawnEvent.difficulty = (inst as DifficultyInstance);
event.difficulty = myDifficultyInstance;

Parameters:

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

Return Type: Mob

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

Return Type: Entity

Getter
script.zs
// FinalizeSpawnEvent.entitySpawner as Entity
event.entitySpawner

Return Type: Entity

Getter
script.zs
// FinalizeSpawnEvent.isSpawnCancelled as bool
event.isSpawnCancelled

Return Type: bool

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

Return Type: ServerLevelAccessor

Setter
script.zs
// FinalizeSpawnEvent.spawnCancelled = (cancel as bool);
event.spawnCancelled = myBool;

Parameters:

cancel Type: bool
Getter
script.zs
// FinalizeSpawnEvent.spawnType as MobSpawnType
event.spawnType

Return Type: MobSpawnType

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

Return Type: double

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

Return Type: double

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

Return Type: double