PlayerEvent

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.player.PlayerEvent;

Extends

PlayerEvent extends LivingEvent.

Members

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

Return Type: bool

cancelable() as bool
script.zs
// PlayerEvent.cancelable() as bool;
myPlayerEvent.cancelable();

Return Type: bool

Getter
script.zs
// PlayerEvent.canceled as bool
myPlayerEvent.canceled

Return Type: bool

Setter
script.zs
// PlayerEvent.canceled = (cancel as bool);
myPlayerEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// PlayerEvent.canceled() as bool;
myPlayerEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// PlayerEvent.canceled(cancel as bool);
myPlayerEvent.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// PlayerEvent.entity as Player
myPlayerEvent.entity

Return Type: Player

Getter
script.zs
// PlayerEvent.hasResult as bool
myPlayerEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// PlayerEvent.hasResult() as bool;
myPlayerEvent.hasResult();

Return Type: bool

Getter
script.zs
// PlayerEvent.result as Result
myPlayerEvent.result

Return Type: EventResult

Setter
script.zs
// PlayerEvent.result = (result as Result);
myPlayerEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// PlayerEvent.result() as Result;
myPlayerEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// PlayerEvent.result(result as Result);
myPlayerEvent.result(myResult);

Parameters:

result Type: EventResult
setAllow()
sets the event's result to allow
script.zs
// PlayerEvent.setAllow();
myPlayerEvent.setAllow();
setDefault()
sets the event's result to default
script.zs
// PlayerEvent.setDefault();
myPlayerEvent.setDefault();
setDeny()
sets the event's result to deny
script.zs
// PlayerEvent.setDeny();
myPlayerEvent.setDeny();