MC命令源

导入相关包

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.

import crafttweaker.api.commands.custom.MCCommandSource;

方法

getName

Return Type: string

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

getPlayer

Return Type: MCPlayerEntity?

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

getPlayer名称

Return Type: Collection<string>

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

getTargetEntity

Return Type: Collection<string>

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

获取团队名称

Return Type: Collection<string>

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

hasPermissionLevel

Return Type: boolean

MCCommandSource.hasPermissionLevel(p_197034_1_ as int) as boolean
参数类型描述
p_197034_1_intNo Description Provided

isPlayer

Return Type: boolean

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

发送错误消息

Return Type: void

MCCommandSource.sendErrorMessage(message as string) as void
参数类型描述
messagestringNo Description Provided

sendFeedback

Return Type: void

MCCommandSource.sendFeedback(feedback as string, allowLogging as boolean) as void
参数类型描述
反馈stringNo Description Provided
allowLogging #允许记录日志booleanNo Description Provided

反馈已禁用

Return Type: MCCommandSource

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

withMin权限级别

Return Type: MCCommandSource

MCCommandSource.withMinPermissionLevel(p_197026_1_ as int) as MCCommandSource
参数类型描述
p_197026_1_intNo Description Provided

拒绝权限级别

Return Type: MCCommandSource

MCCommandSource.withPermissionLevel(p_197033_1_ as int) as MCCommandSource
参数类型描述
p_197033_1_intNo Description Provided