程序包 org.bukkit.block
接口 CommandBlock
- 所有超级接口:
BlockState,Metadatable
代表命令方块(快照)/Represents a captured state of a command block.
-
方法概要
修饰符和类型方法说明获取这个命令方块激活时运行的命令。getName()获取这个命令方块的名字.这个名字被用于命令方块执行命令。voidsetCommand(String command) 设置这个命令方块激活时运行的命令。void设置这个命令方块的名字。从接口继承的方法 org.bukkit.block.BlockState
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
-
方法详细资料
-
getCommand
String getCommand()获取这个命令方块激活时运行的命令。本方法不会返回null,若此命令方块还没有设置命令,会返回空字符.原文:Gets the command that this CommandBlock will run when powered. This will never return null. If the CommandBlock does not have a command, an empty String will be returned instead.
- 返回:
- 当激活时这个命令方块将要运行的命令
-
setCommand
设置这个命令方块激活时运行的命令。设置这个命令为null等价于设置命令为空字符串.原文:Sets the command that this CommandBlock will run when powered. Setting the command to null is the same as setting it to an empty String.
- 参数:
command- 当激活时这个命令方块将要运行的命令
-
getName
String getName()获取这个命令方块的名字.这个名字被用于命令方块执行命令。这个名字永远不会为空,默认为“@”.原文:Gets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. This name will never be null, and by default is "@".
- 返回:
- 这个命令方块的名字
-
setName
设置这个命令方块的名字。这个名字用于命令方块执行命令。设置名字为null等价于设置为“@”.原文:Sets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. Setting the name to null is the same as setting it to "@".
- 参数:
name- 这个命令方块的新名字
-