类的使用
net.md_5.bungee.api.chat.BaseComponent
使用BaseComponent的程序包
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与处理玩家输入的非聊天消息(即命令)相关的类.
为在
世界内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.用于操作可以存储在
物品堆的额外数据的接口.-
net.md_5.bungee.api.chat中BaseComponent的使用
修饰符和类型类说明final classfinal classThis component displays the score based on a player score on the scoreboard.final classThis component processes a target selector into a pre-formatted set of discovered names.final classfinal class修饰符和类型方法说明ComponentBuilder.create()Returns the components needed to display the message created by this builder.gitabstract BaseComponentBaseComponent.duplicate()克隆本组件并返回克隆副本.BaseComponent.duplicateWithoutFormatting()已过时。不鼓励使用本 API, 建议使用传统克隆副本static BaseComponent[]TextComponent.fromLegacyText(String message) Converts the old formatting system that usedChatColor.COLOR_CHARinto the new json based system.static BaseComponent[]TextComponent.fromLegacyText(String message, ChatColor defaultColor) Converts the old formatting system that usedChatColor.COLOR_CHARinto the new json based system.ComponentBuilder.getComponent(int pos) Gets the component part at the position of given index.ComponentBuilder.getCurrentComponent()Gets the component at the position of the cursor.HoverEvent.getValue()已过时。返回变量类型为BaseComponent的类型的net.md_5.bungee.api.chat中的方法修饰符和类型方法说明BaseComponent.getExtra()继承该组件的格式和事件的附加组件.ComponentBuilder.getParts()TranslatableComponent.getWith()The components to substitute into the translation参数类型为BaseComponent的net.md_5.bungee.api.chat中的方法修饰符和类型方法说明voidBaseComponent.addExtra(BaseComponent component) Appends a component to the component.voidTranslatableComponent.addWith(BaseComponent component) Adds a component substitution to the component.ComponentBuilder.append(BaseComponent component) Appends a component to the builder and makes it the current target for formatting.ComponentBuilder.append(BaseComponent[] components) Appends the components to the builder and makes the last element the current target for formatting.ComponentBuilder.append(BaseComponent[] components, ComponentBuilder.FormatRetention retention) Appends the components to the builder and makes the last element the current target for formatting.ComponentBuilder.append(BaseComponent component, ComponentBuilder.FormatRetention retention) Appends a component to the builder and makes it the current target for formatting.voidBaseComponent.copyFormatting(BaseComponent component) 复制指定 BaseComponent 的事件和格式.voidBaseComponent.copyFormatting(BaseComponent component, boolean replace) 复制指定 BaseComponent 的事件和格式.voidBaseComponent.copyFormatting(BaseComponent component, ComponentBuilder.FormatRetention retention, boolean replace) 复制某个 BaseComponent 中的指定格式.static StringBaseComponent.toLegacyText(BaseComponent... components) 将聊天组件转化为颜色代码文本.static StringBaseComponent.toPlainText(BaseComponent... components) 将聊天组件转化为字符串, 丢弃所有格式.类型变量类型为BaseComponent的net.md_5.bungee.api.chat中的方法参数修饰符和类型方法说明voidBaseComponent.setExtra(List<BaseComponent> components) voidTranslatableComponent.setWith(List<BaseComponent> components) Sets the translation substitutions to be used in this component.参数类型为BaseComponent的net.md_5.bungee.api.chat中的构造器限定符构造器说明ComponentBuilder(BaseComponent component) Creates a ComponentBuilder with the given component as the first part.HoverEvent(HoverEvent.Action action, BaseComponent[] value) TextComponent(BaseComponent... extras) Creates a TextComponent with blank text and the extras set to the passed array -
net.md_5.bungee.api.chat.hover.content中BaseComponent的使用
-
net.md_5.bungee.chat中BaseComponent的使用
类型参数类型为BaseComponent的net.md_5.bungee.chat中的字段修饰符和类型方法说明ComponentSerializer.deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) static BaseComponent[]参数类型为BaseComponent的net.md_5.bungee.chat中的方法修饰符和类型方法说明protected voidBaseComponentSerializer.deserialize(JsonObject object, BaseComponent component, JsonDeserializationContext context) protected voidBaseComponentSerializer.serialize(JsonObject object, BaseComponent component, JsonSerializationContext context) static StringComponentSerializer.toString(BaseComponent component) static StringComponentSerializer.toString(BaseComponent... components) -
org.bukkit中BaseComponent的使用
参数类型为BaseComponent的org.bukkit中的方法修饰符和类型方法说明voidServer.Spigot.broadcast(BaseComponent component) 向全体玩家广播一条消息.voidServer.Spigot.broadcast(BaseComponent... components) 将多个聊天消息组件作为单条消息广播给所有在线玩家. -
org.bukkit.command中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.command中的方法修饰符和类型方法说明voidCommandSender.Spigot.sendMessage(UUID sender, BaseComponent component) 向命令发送者发送一个聊天消息组件.voidCommandSender.Spigot.sendMessage(UUID sender, BaseComponent... components) 将多个聊天消息组件作为单条消息发送给命令发送者.voidCommandSender.Spigot.sendMessage(BaseComponent component) 向命令发送者发送一个聊天消息组件.voidCommandSender.Spigot.sendMessage(BaseComponent... components) 将多个聊天消息组件作为单条消息发送给命令发送者. -
org.bukkit.entity中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.entity中的方法修饰符和类型方法说明voidPlayer.Spigot.sendMessage(BaseComponent component) voidPlayer.Spigot.sendMessage(BaseComponent... components) voidPlayer.Spigot.sendMessage(ChatMessageType position, UUID sender, BaseComponent component) 向玩家发送在指定位置展示的聊天消息组件.voidPlayer.Spigot.sendMessage(ChatMessageType position, UUID sender, BaseComponent... components) 将多个聊天消息组件作为单条消息发送给玩家, 并指定消息的展示位置.voidPlayer.Spigot.sendMessage(ChatMessageType position, BaseComponent component) 向玩家发送在指定位置展示的聊天消息组件.voidPlayer.Spigot.sendMessage(ChatMessageType position, BaseComponent... components) 将多个聊天消息组件作为单条消息发送给玩家, 并指定消息的展示位置. -
org.bukkit.inventory.meta中BaseComponent的使用
参数类型为BaseComponent的org.bukkit.inventory.meta中的方法修饰符和类型方法说明voidBookMeta.Spigot.addPage(BaseComponent[]... pages) 在书本末尾追加新的书页.voidBookMeta.Spigot.setPage(int page, BaseComponent... data) 设置书本指定书页的内容.voidBookMeta.Spigot.setPages(BaseComponent[]... pages) 清除书本所有书页, 并设置书本使用提供的书页内容.