类的使用
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
(@NotNull String name) 获取指定名称的注册命令.SimpleCommandMap.getCommand
(@NotNull String name) MultipleCommandAlias.getCommands()
获取与多命令别名相关的命令.Command.setAliases
(@NotNull List<String> aliases) 设置这个命令的别名.Command.setDescription
(@NotNull String description) 设置此命令的简介.在PluginDescriptionFile.getCommands()
的description
节点上定义介绍与本方法是等效的.Command.setPermissionMessage
(@Nullable String permissionMessage) 已过时。自1.13版本, 权限消息对玩家执行的命令已不再可用, 因为没有执行相关命令的权限的客户端不知晓其存在性, 因此不会向服务端发送执行的命令.设置这个命令的用法示例.返回变量类型为Command的类型的org.bukkit.command中的方法参数类型为Command的org.bukkit.command中的方法修饰符和类型方法说明boolean
CommandExecutor.onCommand
(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) 执行给定的命令,成功时返回.TabCompleter.onTabComplete
(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) 用命令传递的参数请求可能的补全项的list.boolean
CommandMap.register
(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) 注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
SimpleCommandMap.register
(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) 注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.boolean
注册一个命令.如果成功返回true,如果名称已被占据、fallback已被使用则返回false.类型变量类型为Command的org.bukkit.command中的方法参数修饰符和类型方法说明void
注册所有属于某个插件的命令.void
注册所有属于某个插件的命令.参数类型为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
(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) 执行给定的命令,成功时返回.JavaPlugin.onTabComplete
(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) 用命令传递的参数请求可能的补全项的list.