Home Commands Examples Getting Started With Scripts Global Keywords

CommandSource

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.

script.zs
import crafttweaker.api.command.CommandSource;

Methods

Return Type: boolean

script.zs
// CommandSource.acceptsFailure() as boolean
myCommandSource.acceptsFailure();

Return Type: boolean

script.zs
// CommandSource.acceptsSuccess() as boolean
myCommandSource.acceptsSuccess();

Return Type: boolean

script.zs
// CommandSource.alwaysAccepts() as boolean
myCommandSource.alwaysAccepts();
script.zs
CommandSource.sendMessage(component as Component)
ParameterType
Parameter
component
Type
Component

Return Type: boolean

script.zs
// CommandSource.shouldInformAdmins() as boolean
myCommandSource.shouldInformAdmins();

Properties

NameTypeHas GetterHas Setter
Name
acceptsFailure
Type
boolean
Has Getter
true
Has Setter
false
Name
acceptsSuccess
Type
boolean
Has Getter
true
Has Setter
false
Name
alwaysAccepts
Type
boolean
Has Getter
true
Has Setter
false
Name
shouldInformAdmins
Type
boolean
Has Getter
true
Has Setter
false