类的使用
org.bukkit.command.Command
使用Command的程序包
程序包
说明
与处理玩家输入的非聊天消息(即命令)相关的类.
通过Bukkit实现来模拟Minecraft原生命令(1.12后所有模拟命令被删除)并提供一些其他必要的命令.
用于操作默认的命令和主题帮助系统的类(你可以将你的命令帮助添加到系统命令帮助系统(help命令)内等等).
用Java编写的处理
插件
的类.-
org.bukkit.command中Command的使用
类型参数类型为Command的org.bukkit.command中的字段返回Command的org.bukkit.command中的方法修饰符和类型方法说明CommandMap.getCommand
(String name) 获取指定名称的注册命令.SimpleCommandMap.getCommand
(String name) Command[]
MultipleCommandAlias.getCommands()
获取与多命令别名相关的命令.Command.setAliases
(List<String> aliases) 设置这个命令的别名.Command.setDescription
(String description) 设置此命令的简介.在PluginDescriptionFile.getCommands()
的description
节点上定义介绍与本方法是等效的.Command.setPermissionMessage
(String permissionMessage) 设置当没有这个命令的权限时发送的消息.设置这个命令的用法示例.返回变量类型为Command的类型的org.bukkit.command中的方法参数类型为Command的org.bukkit.command中的方法修饰符和类型方法说明boolean
CommandExecutor.onCommand
(CommandSender sender, Command command, String label, String[] args) 执行给定的命令,成功时返回.TabCompleter.onTabComplete
(CommandSender sender, Command command, String alias, String[] args) 用命令传递的参数请求可能的补全项的list.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.类型变量类型为Command的org.bukkit.command中的方法参数修饰符和类型方法说明void
CommandMap.registerAll
(String fallbackPrefix, List<Command> commands) 注册所有属于某个插件的命令.void
SimpleCommandMap.registerAll
(String fallbackPrefix, List<Command> commands) 注册所有属于某个插件的命令.参数类型为Command的org.bukkit.command中的构造器 -
org.bukkit.command.defaults中Command的使用
修饰符和类型类说明class
class
class
class
class
class
-
org.bukkit.help中Command的使用
类型参数类型为Command的org.bukkit.help中的类修饰符和类型接口说明interface
HelpTopicFactory<TCommand extends Command>
A HelpTopicFactory is used to create customHelpTopic
objects from commands that inherit from a common base class or have executors that inherit from a common base class.声明为Command的org.bukkit.help中的字段参数类型为Command的org.bukkit.help中的构造器 -
org.bukkit.plugin.java中Command的使用
参数类型为Command的org.bukkit.plugin.java中的方法修饰符和类型方法说明boolean
JavaPlugin.onCommand
(CommandSender sender, Command command, String label, String[] args) 执行给定的命令,成功时返回.JavaPlugin.onTabComplete
(CommandSender sender, Command command, String alias, String[] args) 用命令传递的参数请求可能的补全项的list.