PlayerXpEvent

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.xp.PlayerXpEvent;

Extends

PlayerXpEvent extends PlayerEvent.

Members

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

Return Type: bool

cancelable() as bool
script.zs
// PlayerXpEvent.cancelable() as bool;
myPlayerXpEvent.cancelable();

Return Type: bool

Getter
script.zs
// PlayerXpEvent.canceled as bool
myPlayerXpEvent.canceled

Return Type: bool

Setter
script.zs
// PlayerXpEvent.canceled = (cancel as bool);
myPlayerXpEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// PlayerXpEvent.canceled() as bool;
myPlayerXpEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// PlayerXpEvent.canceled(cancel as bool);
myPlayerXpEvent.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// PlayerXpEvent.entity as Player
myPlayerXpEvent.entity

Return Type: Player

Getter
script.zs
// PlayerXpEvent.entity as LivingEntity
myPlayerXpEvent.entity

Return Type: LivingEntity

Getter
script.zs
// PlayerXpEvent.entity as Entity
myPlayerXpEvent.entity

Return Type: Entity

Getter
script.zs
// PlayerXpEvent.hasResult as bool
myPlayerXpEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// PlayerXpEvent.hasResult() as bool;
myPlayerXpEvent.hasResult();

Return Type: bool

Getter
script.zs
// PlayerXpEvent.result as Result
myPlayerXpEvent.result

Return Type: EventResult

Setter
script.zs
// PlayerXpEvent.result = (result as Result);
myPlayerXpEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// PlayerXpEvent.result() as Result;
myPlayerXpEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// PlayerXpEvent.result(result as Result);
myPlayerXpEvent.result(myResult);

Parameters:

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