Home Commands Examples Getting Started With Scripts Global Keywords
BracketHandlers ForgeBracketDumpers ForgeBracketValidators

Event

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

Members

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

Return Type: bool

cancelable() as bool
script.zs
// Event.cancelable() as bool;
myEvent.cancelable();

Return Type: bool

Getter
script.zs
// Event.canceled as bool
myEvent.canceled

Return Type: bool

Setter
script.zs
// Event.canceled = (cancel as bool);
myEvent.canceled = myBool;

Parameters:

cancel Type: bool
canceled() as bool
script.zs
// Event.canceled() as bool;
myEvent.canceled();

Return Type: bool

canceled(cancel as bool)
script.zs
// Event.canceled(cancel as bool);
myEvent.canceled(myBool);

Parameters:

cancel Type: bool
Getter
script.zs
// Event.hasResult as bool
myEvent.hasResult

Return Type: bool

hasResult() as bool
script.zs
// Event.hasResult() as bool;
myEvent.hasResult();

Return Type: bool

Getter
script.zs
// Event.result as Result
myEvent.result

Return Type: EventResult

Setter
script.zs
// Event.result = (result as Result);
myEvent.result = myResult;

Parameters:

result Type: EventResult
result() as Result
script.zs
// Event.result() as Result;
myEvent.result();

Return Type: EventResult

result(result as Result)
script.zs
// Event.result(result as Result);
myEvent.result(myResult);

Parameters:

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