MobSpawnEvent

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.forge.api.event.entity.living.spawn.MobSpawnEvent;

Extends

MobSpawnEvent extends EntityEvent.

Members

cancel()
Cancels the event. Same as setCanceled(true)
script.zs
// MobSpawnEvent.cancel();
myMobSpawnEvent.cancel();
Getter
script.zs
// MobSpawnEvent.cancelable as bool
myMobSpawnEvent.cancelable

Return Type: bool

cancelable() as bool
script.zs
// MobSpawnEvent.cancelable() as bool;
myMobSpawnEvent.cancelable();

Return Type: bool

Getter
script.zs
// MobSpawnEvent.canceled as bool
myMobSpawnEvent.canceled

Return Type: bool

Setter
script.zs
// MobSpawnEvent.canceled = (cancel as bool);
myMobSpawnEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// MobSpawnEvent.canceled() as bool;
myMobSpawnEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// MobSpawnEvent.canceled(cancel as bool);
myMobSpawnEvent.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// MobSpawnEvent.entity as Mob
myMobSpawnEvent.entity

Return Type: Mob

Getter
script.zs
// MobSpawnEvent.hasResult as bool
myMobSpawnEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// MobSpawnEvent.hasResult() as bool;
myMobSpawnEvent.hasResult();

Return Type: bool

Getter
script.zs
// MobSpawnEvent.level as ServerLevelAccessor
myMobSpawnEvent.level

Return Type: ServerLevelAccessor

Getter
script.zs
// MobSpawnEvent.result as Result
myMobSpawnEvent.result

Return Type: EventResult

Setter
script.zs
// MobSpawnEvent.result = (result as Result);
myMobSpawnEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// MobSpawnEvent.result() as Result;
myMobSpawnEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// MobSpawnEvent.result(result as Result);
myMobSpawnEvent.result(myResult);

Parameters:

result Type: EventResult
setAllow()
sets the event's result to allow
script.zs
// MobSpawnEvent.setAllow();
myMobSpawnEvent.setAllow();
setDefault()
sets the event's result to default
script.zs
// MobSpawnEvent.setDefault();
myMobSpawnEvent.setDefault();
setDeny()
sets the event's result to deny
script.zs
// MobSpawnEvent.setDeny();
myMobSpawnEvent.setDeny();
Getter
script.zs
// MobSpawnEvent.x as double
myMobSpawnEvent.x

Return Type: double

Getter
script.zs
// MobSpawnEvent.y as double
myMobSpawnEvent.y

Return Type: double

Getter
script.zs
// MobSpawnEvent.z as double
myMobSpawnEvent.z

Return Type: double