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.neoforge.api.event.entity.player.PlayerEvent;

Extends

PlayerEvent extends LivingEvent.

Members

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();