CommandSource
Link to commandsource
导入类
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.command.CommandSource;
使用方式
Link to 使用方式
Name: acceptsFailure
Return Type: boolean
ZenScript Copy// CommandSource.acceptsFailure() as boolean
myCommandSource.acceptsFailure();
Name: acceptsSuccess
Return Type: boolean
ZenScript Copy// CommandSource.acceptsSuccess() as boolean
myCommandSource.acceptsSuccess();
Name: alwaysAccepts
Return Type: boolean
ZenScript Copy// CommandSource.alwaysAccepts() as boolean
myCommandSource.alwaysAccepts();
Name: sendMessage
ZenScript CopyCommandSource.sendMessage(component as Component, senderUUID as invalid)
参数 | 类型 |
---|---|
参数 component | 类型 Component |
参数 senderUUID | 类型 invalid |
Name: shouldInformAdmins
Return Type: boolean
ZenScript Copy// CommandSource.shouldInformAdmins() as boolean
myCommandSource.shouldInformAdmins();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 acceptsFailure | 类型 布尔值 | 可获得 true | 可设置 false |
名称 acceptsSuccess | 类型 布尔值 | 可获得 true | 可设置 false |
名称 alwaysAccepts | 类型 布尔值 | 可获得 true | 可设置 false |
名称 shouldInformAdmins | 类型 布尔值 | 可获得 true | 可设置 false |