Источник MCCommandSource

Импорт класса

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.commands.custom.MCCommandSource;

Methods

getName

Return Type: string

ZenScript
Copy
MCCommandSource.getName() as string
myMCCommandSource.getName();

getPlayer

Return Type: MCPlayerEntity?

ZenScript
Copy
MCCommandSource.getPlayer() as MCPlayerEntity?
myMCCommandSource.getPlayer();

getPlayerNames

Return Type: Collection<string>

ZenScript
Copy
MCCommandSource.getPlayerNames() as Collection<string>
myMCCommandSource.getPlayerNames();

Целевая сущность

Return Type: Collection<string>

ZenScript
Copy
MCCommandSource.getTargetedEntity() as Collection<string>
myMCCommandSource.getTargetedEntity();

getTeamNames

Return Type: Collection<string>

ZenScript
Copy
MCCommandSource.getTeamNames() as Collection<string>
myMCCommandSource.getTeamNames();

hasPermissionLevel

Return Type: boolean

ZenScript
Copy
MCCommandSource.hasPermissionLevel(p_197034_1_ as int) as boolean
ПараметрТипDescription
p_197034_1_intNo Description Provided

isPlayer

Return Type: boolean

ZenScript
Copy
MCCommandSource.isPlayer() as boolean
myMCCommandSource.isPlayer();

отправить сообщение об ошибке

Return Type: void

ZenScript
Copy
MCCommandSource.sendErrorMessage(message as string) as void
ПараметрТипDescription
messagestringNo Description Provided

sendFeedback

Return Type: void

ZenScript
Copy
MCCommandSource.sendFeedback(feedback as string, allowLogging as boolean) as void
ПараметрТипDescription
обратная связьstringNo Description Provided
allowLoggingbooleanNo Description Provided

обратная связь отключена

Return Type: MCCommandSource

ZenScript
Copy
MCCommandSource.withFeedbackDisabled() as MCCommandSource
myMCCommandSource.withFeedbackDisabled();

с уровнем разрешений

Return Type: MCCommandSource

ZenScript
Copy
MCCommandSource.withMinPermissionLevel(p_197026_1_ as int) as MCCommandSource
ПараметрТипDescription
p_197026_1_intNo Description Provided

уровень снятия

Return Type: MCCommandSource

ZenScript
Copy
MCCommandSource.withPermissionLevel(p_197033_1_ as int) as MCCommandSource
ПараметрТипDescription
p_197033_1_intNo Description Provided