The event is not cancelable.

The event does not have a result.

Importing the class

Link to importing-the-class

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
Copy
import crafttweaker.api.event.MCEvent;

Name: cancel

Cancels the event. Same as setCanceled(true)

Return Type: void

ZenScript
Copy
// MCEvent.cancel() as void

myMCEvent.cancel();

Link to g--1

Name: hasResult

Return Type: boolean

ZenScript
Copy
// MCEvent.hasResult() as boolean

myMCEvent.hasResult();

Link to g--2

Name: isCancelable

Return Type: boolean

ZenScript
Copy
// MCEvent.isCancelable() as boolean

myMCEvent.isCancelable();

Link to g--3

Name: isCanceled

Return Type: boolean

ZenScript
Copy
// MCEvent.isCanceled() as boolean

myMCEvent.isCanceled();

Link to g--4

Name: setAllow

sets the event's result to allow

Return Type: void

ZenScript
Copy
// MCEvent.setAllow() as void

myMCEvent.setAllow();

Link to g--5

Name: setCanceled

Return Type: void

ZenScript
Copy
MCEvent.setCanceled(cancel as boolean) as void
ParameterTypeDescription
Parameter
cancel
Type
boolean型
Description
No Description Provided

Link to g--6

Name: setDefault

sets the event's result to default

Return Type: void

ZenScript
Copy
// MCEvent.setDefault() as void

myMCEvent.setDefault();

Name: setDeny

sets the event's result to deny

Return Type: void

ZenScript
Copy
// MCEvent.setDeny() as void

myMCEvent.setDeny();
名称TypeHas GetterHas SetterDescription
名称
cancelable
Type
boolean型
Has Getter
true
Has Setter
false
Description
No Description Provided
名称
canceled
Type
boolean型
Has Getter
true
Has Setter
true
Description
No Description Provided
名称
hasResult
Type
boolean型
Has Getter
true
Has Setter
false
Description
No Description Provided