Event
Link to event
The event is not cancelable.
The event does not have a result.
Importare la Classe
Link to importare-la-classe
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.event.Event;
Metodi
Link to metodi
Name: cancel
Cancels the event. Same as setCanceled(true)
ZenScript Copy// Event.cancel()
myEvent.cancel();
Name: getResult
Return Type: EventResult
ZenScript Copy// Event.getResult() as EventResult
myEvent.getResult();
Name: hasResult
Return Type: boolean
ZenScript Copy// Event.hasResult() as boolean
myEvent.hasResult();
Name: isCancelable
Return Type: boolean
ZenScript Copy// Event.isCancelable() as boolean
myEvent.isCancelable();
Name: isCanceled
Return Type: boolean
ZenScript Copy// Event.isCanceled() as boolean
myEvent.isCanceled();
Name: setAllow
sets the event's result to allow
ZenScript Copy// Event.setAllow()
myEvent.setAllow();
Name: setCanceled
ZenScript CopyEvent.setCanceled(cancel as boolean)
Parametro | Tipo |
---|---|
Parametro cancel | Tipo boolean |
Name: setDefault
sets the event's result to default
ZenScript Copy// Event.setDefault()
myEvent.setDefault();
Name: setDeny
sets the event's result to deny
ZenScript Copy// Event.setDeny()
myEvent.setDeny();
Name: setResult
ZenScript CopyEvent.setResult(result as EventResult)
Parametro | Tipo |
---|---|
Parametro result | Tipo EventResult |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter |
---|---|---|---|
Nome | Tipo Event | Ha Getter no | Ha Setter sì |
Nome cancelable | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome canceled | Tipo boolean | Ha Getter sì | Ha Setter sì |
Nome hasResult | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome result | Tipo EventResult | Ha Getter sì | Ha Setter no |