The Assistant 是一个面向开发者的多功能库,旨在简化 Minecraft 插件开发流程。它提供了一系列 API 和集成服务,帮助开发者轻松处理命令、依赖、经济、区域、NPC 等常见功能。
通过 TheAssistantAPI 接口,开发者可以访问库的所有核心服务。
public interface TheAssistantAPI {
public CommandProvider<AssistantCommand> getCommandProvider();
public DependencyResolver getDependencyResolver();
public AddonsService getAddons();
public NMS getNms();
public Plugin getPlugin();
}这是 Assistant 最强大的功能之一,可以轻松地集成和管理其他插件(Hooks)。
支持 Vault、PlayerPoints 和 TokenManager。
public interface EconomyAddon extends DependencyPlugin {
public double getMoney(final OfflinePlayer player);
public void depositMoney(final OfflinePlayer player, final double amount);
public void withdrawMoney(final OfflinePlayer player, final double amount);
}支持 WorldGuard、Residence 和 UltraRegions。
public interface RegionAddon extends DependencyPlugin {
public default boolean isInAnyRegion(final Location location, final List<String> regions) { ... }
public default boolean isInRegion(final Location location, final String region) { ... }
public Set<String> getRegions(final Location location);
}支持 WorldEdit,用于粘贴 schematic 文件。
public interface PasterAddon extends DependencyPlugin {
public CompletableFuture<PasterSession> pasteSchematic(final Location location, final Schematic schematic);
}支持 Citizens,用于判断实体是否为 NPC。
public interface NPCAddon extends DependencyPlugin {
public boolean isNPC(final Entity entity);
}支持 PlaceholderAPI 和 MVdW PlaceholderAPI,用于注册自定义变量。
public interface PlaceholdersAddon extends DependencyPlugin {
public void registerPlaceholders(final String identifier, final PlaceholderReplacer replacer);
}使用 CommandProvider 可以实时注册命令。请注意,命令仍需在 plugin.yml 中声明。
首先需要构建并注册一个 `LabelProvider` 来定义命令的基本信息。 LabelProvider.builder()
.id("theAssistantCommand")
.label("assistant")
.plugin(box.plugin())
.useHelpMessage("&cUse Help")
.unknownCommandMessage("&cUnknown Command")
.onlyForPlayersMessage("&cThis command can be executed only for players!")
.noPermissionMessage("&cYou don't have permission to use that command!")
.build()
.register();通过 `TheAssistantCommandProvider` 将具体的命令与对应的处理器绑定。 public final class TheAssistantCommandProvider implements CommandProvider<AssistantCommand> {
public void registerCommand(final AssistantCommand command, final CommandHandler<AssistantCommand> handler);
}友情链接: 网易我的世界 | 泰拉瑞亚 | ocent云计算 | 米饭Minecraft插件文档 | 友链合作
历史访问人数:2,621,652 | 历史访问人次:3,178,714
今日访问人数:42,851 | 今日访问人次:48,335
昨日访问人数:24,332 | 昨日访问人次:29,698
Copyright © 2019-2026 我的世界服务器列表站. All rights reserved.
❤ Powered by GermMC 京ICP备17023959号-6