Event
Link to event
The event is not cancelable.
The event does not have a result.
导入类
Link to 导入类
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;
使用方式
Link to 使用方式
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)
参数 | 类型 |
---|---|
参数 cancel | 类型 布尔值 |
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();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 | 类型 Event | 可获得 false | 可设置 true |
名称 cancelable | 类型 布尔值 | 可获得 true | 可设置 false |
名称 canceled | 类型 布尔值 | 可获得 true | 可设置 true |
名称 hasResult | 类型 布尔值 | 可获得 true | 可设置 false |
名称 result | 类型 EventResult | 可获得 true | 可设置 false |