---
url: /v7.2.0-SNAPSHOT/guide/advanced/external-plugin-api.md
---

# External Plugin API

This guide describes the API as of v7.0.0 on Paper 26.3 with Java 25. For a 6.x plugin, start with the [upgrade guide](./upgrading-to-7#external-paper-plugins) or consult the [archived 6.5.0 guide](/v6.5.0/guide/advanced/external-plugin-api.html).

An external plugin remains a regular `JavaPlugin`. Paper loads its JAR from `plugins/`; UltiTools does not load it as a module. Connecting gives its components access to UltiTools dependency injection, commands, data and other services without extending `UltiToolsPlugin`.

## Quick Start

### 1. Build dependency

```xml
<dependency>
    <groupId>com.ultikits</groupId>
    <artifactId>UltiTools-API</artifactId>
    <version>7.1.0</version>
    <scope>provided</scope>
</dependency>
```

Resolve the build dependency from Maven Central. Do not bundle UltiTools-API in your JAR; Gradle uses `compileOnly`. Download the framework JAR from GitHub Releases or Maven Central, as described in [Quick Start](/v7.2.0-SNAPSHOT/guide/quick-start).

### 2. Dependencies in plugin descriptors

If your plugin calls `connect` unconditionally, declare UltiTools as a required server dependency in the descriptor your plugin uses.

For `plugin.yml`, use `depend`:

```yaml
name: MyExternalPlugin
main: com.ultikits.docs.external.MyExternalPlugin
version: '1.0'
api-version: '26.3'
depend: [UltiTools]
```

For an optional integration in `plugin.yml`, use `softdepend: [UltiTools]` instead. Check that UltiTools is enabled before entering code that uses its types; do not call `connect` unconditionally.

For `paper-plugin.yml`, use [`dependencies.server`](https://docs.papermc.io/paper/dev/getting-started/paper-plugins/#dependency-declaration):

```yaml
name: MyExternalPlugin
main: com.ultikits.docs.external.MyExternalPlugin
version: '1.0'
api-version: '26.3'
dependencies:
  server:
    UltiTools: {load: BEFORE, required: true, join-classpath: true}
```

Keep `load: BEFORE` explicit. If you omit it, Paper does not guarantee that UltiTools loads before your plugin. If your plugin enables first, `connect` throws `IllegalStateException` with the message `Failed to connect plugin <name> to UltiTools`. `required: true` requires UltiTools to be installed; `join-classpath: true` lets your plugin access UltiTools classes.

In both descriptors, `api-version: '26.3'` is the Paper API version, not the UltiTools module level `700`.

### 3. Connection and disconnection

Call `connect` in `onEnable()`, after any plugin state needed by scanned bean initializers has been prepared, and before using connected services. It creates and refreshes the child container before returning. Both overloads return `void`. Call `disconnect` in `onDisable()`; it is a no-op if there is no adapter. UltiTools also disconnects on `PluginDisableEvent` and during its own shutdown.

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

public class MyExternalPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        UltiToolsAPI.connect(this);
        // Your plugin is now wired into UltiTools!
    }

    @Override
    public void onDisable() {
        UltiToolsAPI.disconnect(this);
    }
}

```

On success, the console includes `[UltiTools-API] External plugin connected: <name> v<version>`. Repeating `connect` on the same connected instance is ignored and logs `[UltiTools-API] Plugin <name> is already connected. Ignoring duplicate connect().` It does not rescan or add entities to that connection.

If UltiTools has not loaded, `connect` throws `IllegalStateException`. If registration throws an `Exception`, the API wraps it in `IllegalStateException` with `Failed to connect plugin <name> to UltiTools`; inspect the cause. An `Error` that escapes registration, such as `NoClassDefFoundError`, propagates without being wrapped by `connect`. The framework unwinds resources already registered, including the stage that failed, then releases the container and data scope for failures during registration. Inspect suppressed cleanup failures before retrying; plugin code's own side effects are not rolled back. Treat `isConnected` as a status check outside the connection call, not as a readiness signal from a bean initializer.

As of v7.1.0, `connect` rejects conflicting entity ownership or data folders before creating any components. A message namespace conflict is still refused before component scanning, as in v7.0.0: storage is not opened and the plugin data folder is not created. If scanning itself fails (for example, because a service needs a proxy but its class is `final`), storage may already be open.

## Component scanning

The default scan starts at the package of `main` and includes its subpackages. It does not start at the JAR root or include sibling packages. If `main` is in the default package, UltiTools skips component scanning. If you move the example main class, put the example components in the same package or below it. The separate `@Table` scan looks in the plugin's own JAR, not just that component package.

| Component | Registration |
|---|---|
| `@Service` | Creates a managed bean with constructor or `@Autowired` field injection. As of v7.1.0, requesting `Plugin` or any class from the runtime class through `PluginBase` gives you the plugin itself. See [Plugin injection types](#plugin-injection). |
| `@CmdExecutor` | An annotated `BaseCommandExecutor` bean is compiled into a Brigadier tree unless `manualRegister = true`. The framework also discovers managed `BrigadierCommand` beans. |
| `@EventListener` | A bean implementing Bukkit `Listener` is registered unless `manualRegister = true`. Use Bukkit `@EventHandler` on its methods. |
| `@Scheduled` | Scheduled methods on managed beans use the framework scheduler and are cancelled on disconnect. Use literal `delay` and `period`; an asynchronous literal period is measured in wall-clock time at 50 ms per configured tick. |
| `@PlayerCache` | Registers per-player cache fields for quit handling, including any configured save hook; the fields stop being tracked on disconnect. |
| `@ModuleEventHandler` | A public method on a managed bean with one `ModuleEvent` parameter (or a subtype) subscribes to the shared EventBus. Publish with `UltiToolsAPI.getEventBus().publish(event)`. |

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

@Service
public class GreetingService {

    @Autowired
    private StatsService statsService; // Injected by the IoC container

    public void greetPlayer(Player player) {
        player.sendMessage("Welcome! You have " + statsService.getVisits(player) + " visits.");
    }
}

```

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

@EventListener
public class JoinListener implements Listener {

    @Autowired
    private GreetingService greetingService;

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        greetingService.greetPlayer(event.getPlayer());
    }
}

```

## Plugin injection types {#plugin-injection}

As of v7.1.0, the following rules apply to an external plugin that calls `UltiToolsAPI.connect(this)`. Modules are unchanged: injecting Bukkit's `Plugin` into an `UltiToolsPlugin` module still gives you UltiTools.

| Constructor parameter or field type | Injected object |
|---|---|
| `Plugin`, `PluginBase` | The plugin that called `connect`. In v7.0.0 these types normally returned UltiTools. |
| `JavaPlugin`, the plugin's main class, its runtime class | The same plugin instance. Code already injecting `JavaPlugin` or the main class needs no change. |
| An author-defined base class between the main class and `JavaPlugin` | The same plugin instance. In v7.0.0 an unbound intermediate class could not be injected. |
| `CommandExecutor`, `TabExecutor`, `TabCompleter`, `LifecycleEventOwner`, `Namespaced` | These interfaces are not bound to the plugin instance. You get a local component implementing the interface, or UltiTools if there is none. |

The last row is a [known limitation (#1129)](https://github.com/UltiKits/UltiTools-Reborn/issues/1129). For your own command handler, declare a component that implements the required interface. For the plugin itself, inject `Plugin` or the main class. Paper marks `LifecycleEventOwner` as non-extendable, so do not implement it in a component; to use your plugin as the lifecycle owner, inject `Plugin` or the main class. To obtain UltiTools explicitly, use `Bukkit.getPluginManager().getPlugin("UltiTools")`. A `@Bean` product is registered by its concrete class: declaring the method's return type as `Plugin` or another bound type does not change what is injected for that type.

### Migration from v7.0.0

Check code that uses an injected `Plugin` or `PluginBase`. Tasks and listeners registered with that object now belong to your plugin. `new NamespacedKey(plugin, key)` uses your plugin's namespace; `getDataFolder()`, `getConfig()`, `saveConfig()` and `saveResource()` use your plugin's data folder.

If your plugin wrote data under the UltiTools name on v7.0.0, upgrading neither removes nor migrates it, and there is no migration notice at startup. Move it yourself:

* Read the new key first. Only if it is absent, read `ultitools:<key>`. If you find an old value, write it to the new key and persist the object that holds the data. Leave the old key in place.
* Stop the server and make a backup. Move only your plugin's files out of `plugins/UltiTools/` into your data folder. Copy only your settings from `plugins/UltiTools/config.yml` into your configuration. Do not move the whole folder or replace the UltiTools configuration file.

See the framework's [7.1 compatibility notes](https://github.com/UltiKits/UltiTools-Reborn/blob/main/COMPATIBILITY.md#71) for the full procedure and a Java example for persistent data.

## Command registration

As of v7.0.0, `connect` discovers and compiles commands; UltiTools hands the trees to Paper's registrar at `LifecycleEvents.COMMANDS`. The `LifecycleEvents.COMMANDS` handler is registered with the lifecycle manager of UltiTools, not that of the external `JavaPlugin`. On normal Paper 26.3 startup, `POSTWORLD` plugins finish enabling before the initial command event, so connecting in `onEnable()` is early enough. Use `@CmdExecutor` and `@CmdMapping` without a `commands:` entry or a separate Bukkit `onCommand` handler. The Paper event registers command labels; `@CmdExecutor` supplies the aliases, permission and description.

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

@CmdExecutor(alias = {"greet"}, permission = "myplugin.greet", description = "Greet command")
@CmdTarget(CmdTarget.CmdTargetType.PLAYER)
public class GreetCommand extends BaseCommandExecutor {

    @Autowired
    private GreetingService greetingService;

    @CmdMapping(format = "")
    public void greet(@CmdSender Player player) {
        greetingService.greetPlayer(player);
    }

    @Override
    protected void handleHelp(CommandSender sender) { }
}

```

An external plugin's `description` is literal even when it has its own message catalogue. Use `Messages` explicitly for replies written by your plugin. See [Command Executor](/v7.2.0-SNAPSHOT/guide/essentials/cmd-executor) for parsing and completion.

Leave `manualRegister` at its default of `false` for external annotation executors. `connect` skips executors with `manualRegister = true`, and the external plugin API has no method to register them later. If an executor uses a custom `TypeParser`, register it with `TypeParserRegistry.getInstance().register(...)` before calling `connect`, which compiles the command tree. Custom parsers do not replace built-in argument mappings.

As of v7.1.0, each diagnostic has three lines: `What happened:`, `How to fix:` and `Where to read:`. The table shows the first line.

| Situation | Console diagnostic |
|---|---|
| A new root or changed tree is connected after the initial event | `[ULTI-4020] What happened: Command /<label> from <owner> (<executor class>) was registered after start-up and will stay inactive until the next Paper command lifecycle.` |
| The label collides with a command already bound by UltiTools for another owner | `[ULTI-4017] What happened: Command /<label> from <owner> (<executor class>) conflicts with <previous owner> (<previous class>); rejected.` |
| The Paper registrar does not return the requested label | `[ULTI-4019] What happened: Command label /<label> from <owner> (<executor class>) was not registered by Paper (label occupied).` |

An invalid mapping can cause the connection to fail. The registration diagnostic, as of v7.1.0, starts with `[ULTI-<code>] What happened: Cannot register command for <owner>; every command of <owner> was unregistered: <detail>`, where `<owner>` is the plugin name and the code depends on the cause. For a rejected format, `<detail>` has the form described in [Rejected formats](/v7.2.0-SNAPSHOT/guide/essentials/cmd-executor#rejected-formats). A label conflict alone does not mean that `connect` failed.

`/minecraft:reload` reloads data packs and fires another commands event; it does not disconnect the plugin. `/ul reload` does not reconnect the plugin, rebind commands, or reload its configuration or catalogue overrides. Stop and restart the server after installing or replacing a JAR. Bukkit `/reload` and plugin-manager hot reload are not supported.

## Data storage and transactions

As of v7.0.0, `connect` discovers `@Table` entities in the plugin's own JAR using that plugin's class loader. For an entity your plugin owns in a separate library on its classpath, pass its class in `UltiToolsAPI.connect(this, LibraryEntity.class)`. This adds to JAR discovery; it does not let you claim another plugin's entities. Use `UltiToolsAPI.getDataOperator(plugin, Entity.class)` with the same plugin instance. A class not registered to that plugin is refused with `ULTI-3010` (`ENTITY_NOT_OWNED`).

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

@Data @Builder @NoArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("player_stats")
public class StatsEntity extends BaseDataEntity<String> {
    @Column("player_id") private String playerId;
    @Column("visits") private int visits;
}

```

```java
package com.ultikits.docs.external;

import com.ultikits.ultitools.abstracts.command.BaseCommandExecutor;
import com.ultikits.ultitools.abstracts.data.BaseDataEntity;
import com.ultikits.ultitools.annotations.*;
import com.ultikits.ultitools.annotations.command.*;
import com.ultikits.ultitools.api.UltiToolsAPI;
import com.ultikits.ultitools.interfaces.DataOperator;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;

@Service
public class StatsService {

    private final DataOperator<StatsEntity> dataOp;

    public StatsService() {
        JavaPlugin plugin = JavaPlugin.getPlugin(MyExternalPlugin.class);
        this.dataOp = UltiToolsAPI.getDataOperator(plugin, StatsEntity.class);
    }

    public int getVisits(Player player) {
        StatsEntity stats = dataOp.query()
            .where("player_id").eq(player.getUniqueId().toString())
            .first();
        return stats != null ? stats.getVisits() : 0;
    }
}

```

Use mapped column names in queries.

Annotate a managed service method with `@Transactional` and call it through the injected bean, rather than creating the service with `new`. The framework attaches the transaction manager for the external plugin's data scope. The same [proxy and transaction rules](/v7.2.0-SNAPSHOT/guide/advanced/transactions) apply as for a module.

As of v7.1.0, the data scope and aspects are ready before component scanning. Even if injection into a `@Configuration` class creates a service during the scan, calls through that service now honor `@Transactional` rollback rules and `@ExceptionCatch` fallback values. In v7.0.0 both annotations were ignored on these early instances. A component created during the scan can also request data operators for the plugin's own entities from its initializer.

If such a service has a method that would be intercepted, `connect` fails if the class is `final` or `sealed`, or has only private constructors. Make the class subclassable and the target method overridable, and provide a non-private constructor. If interception is unnecessary, remove the annotation instead. Kotlin classes and Lombok `@Value` classes are final by default.

## Data and configuration locations

The server administrator selects the [storage backend](/v7.2.0-SNAPSHOT/guide/essentials/data-storage#entity-registration) for the whole server. External plugins cannot choose a different backend through UltiTools. Local files for your plugin go in its own data folder, `plugins/<plugin name>/`, not in UltiTools' module directories.

| Backend or file | Location |
|---|---|
| SQLite | `plugins/<plugin name>/data.db` |
| JSON | `plugins/<plugin name>/data/<table name>/`, where the table name is the value of `@Table`. |
| MySQL | The shared database configured by the server administrator. UltiTools uses the value of `@Table` without a prefix; choose a table name that does not collide with another plugin's or module's table. If MySQL is unavailable at startup, the server falls back to JSON and the JSON location applies. |
| Message overrides | `plugins/<plugin name>/messages/<locale>.yml`, if your plugin bundles a [message catalogue](#external-plugin-messages). Put only changed keys in these files. |
| Plugin configuration | `plugins/<plugin name>/config.yml`. Use your `JavaPlugin`'s own `getConfig()` to read it and `reloadConfig()` to reload it. UltiTools does not manage this file. |

After a successful connection with a bundled catalogue, UltiTools writes reference copies such as `plugins/<plugin name>/messages/reference/en.yml`. These copies show the bundled messages and are not read as overrides. On each successful connection, UltiTools rewrites them and deletes other message `.yml` files in `messages/reference/` (names containing only letters, digits, underscores or hyphens before `.yml`). Put overrides directly in `messages/`, not in `messages/reference/`. A refused connection does not write reference copies. Disconnect removes the in-memory catalogue without deleting its files.

## External plugin messages {#external-plugin-messages}

As of v7.0.0, bundle at least one `messages/<locale>.yml` directly under `messages/` in the plugin's own JAR, for example `messages/en.yml` or `messages/zh-CN.yml`. The filename stem must be recognized by the text engine as a locale; `messages/config.yml`, nested files and `.yaml` files do not enable a catalogue. In v7.0.0 an unpacked class directory does not enable a catalogue. As of v7.1.0 the same catalogue rules apply to the entry class's own output directory, including `target/classes/messages/` in Maven. UltiTools does not search other classpath roots. Use the same [catalogue format and language selection](/v7.2.0-SNAPSHOT/guide/essentials/messages) as a module. Choose `source-language` in `paper-plugin.yml` or, if there is no `paper-plugin.yml`, in `plugin.yml`; absent or invalid values use `en`.

With a catalogue, the injected `Messages` is bound to your plugin's normalized name. For `MyExternalPlugin`, `messages.key("greet.welcome")` gives `myexternalplugin:greet.welcome`. The framework refuses a connection if that namespace belongs to UltiTools, a loaded module or another external catalogue; a module arriving later cannot take over an existing external catalogue. Without a recognized bundled catalogue, there is no plugin-owned catalogue or generated messages directory. The bean inherits the framework `Messages` instance, with no namespace guarantee. To render a framework key, use an explicit key, such as `MessageKey.of("ultitools", "ul.help")`.

A namespace conflict is refused before component scanning and does not create the plugin data folder. Look under `Caused by` in Paper's console entry for the failed enable. For example, if a loaded module has the same name as the plugin, the cause includes:

`[ULTI-6001] External plugin 'MatchingProbe' cannot use message namespace 'matchingprobe': it is already used by module 'MatchingProbe'`

Call `UltiToolsAPI.reloadMessages(this)` from your own reload command to reread the bundled files and overrides. It can run on any thread, but performs synchronous file I/O under the text engine lock. Call it after `connect` returns successfully, not during bean initialization. Before connection, during registration or after disconnect, it throws `IllegalStateException` with `Plugin <name> is not connected to UltiTools`. A connected plugin without a bundled catalogue gets a no-op. Malformed override files warn in the console and are ignored; bundled text remains the fallback. `/ul reload` does not refresh external catalogues.

## Module-only features

| Feature | External plugin |
|---|---|
| Module lifecycle | No `@UltiToolsModule` lifecycle, `registerSelf()`, or module `onReload()` hook. Use `JavaPlugin` lifecycle methods and manage your own reload command. |
| Module bootstrap | `connect` is an enable-time API, not an entry point to UltiTools' early bootstrap for module enchantments, tags and data packs. An external plugin does not get `ModuleBootstrapContext`, regardless of which descriptor it uses. |
| Configuration entities | No module `@ConfigEntity` registration or typed `UltiToolsPlugin.getConfig(Class)`. |
| Config-bound timing | A config-bound `@Scheduled` or `@CmdCD` on a discovered bean refuses connection. Use literal `delay` / `period` / `value`, or manage your own scheduling and configuration. |
| Module admission and updates | Module-level `api-version` and `/upm` do not apply. Install your JAR as a server plugin. |

## Command tests

The [UltiTools external-plugin example repository](https://github.com/UltiKits/UltiTools-External-Example) demonstrates the `JavaPlugin` integration. Choose an example revision that targets your framework version.

As of v7.1.0, the experimental test kit can load an ordinary `JavaPlugin` in-process with `@UltiToolsTest(externalPlugins = MyPlugin.class)`. After the plugin calls `UltiToolsAPI.connect(this)` in `onEnable()`, dispatch its registered annotated command through MockBukkit and check the mock player's reply.

Declare `com.ultikits:ultitools-testkit` in test scope and use UltiTools-API on the same major.minor line, such as the 7.1.0 dependency shown above. A 7.1 kit cannot be paired with a 7.0.x framework dependency. The annotation is `com.ultikits.ultitools.testkit.UltiToolsTest`. Add this test dependency inside your existing `<dependencies>` element:

```xml
<dependency>
    <groupId>com.ultikits</groupId>
    <artifactId>ultitools-testkit</artifactId>
    <version>7.1.0</version>
    <scope>test</scope>
</dependency>
```

The kit requires `depend: [UltiTools]` in `plugin.yml`, or the required `paper-plugin.yml` server dependency shown above (`load: BEFORE` with classpath access). It does not accept `softdepend`. The main class must be non-final, have a public no-argument constructor and connect during enable.

As of v7.1.0, when a plugin is loaded from a compiled class directory, UltiTools loads bundled messages and discovers `@Table` entities in the entry class's package and subpackages. An entry class in the unnamed package scans the whole directory. Other classpath roots are not searched. For an entity in a sibling package in the same output directory, `ULTI-3010` names the entity and the scanned package: move it under the entry package or pass it explicitly to `UltiToolsAPI.connect(this, MyEntity.class)`. On Paper, the scan covers the plugin's entire JAR. Under the kit's MockBukkit class loader, `JavaPlugin.getPlugin(MyPlugin.class)` cannot look up the plugin. In a plugin service, use constructor injection with `JavaPlugin` or your own plugin main class instead. See [Testing modules and plugins](./testing) for test examples and dependency setup.

Without the kit, or to test a handler on its own, call command handlers and completion providers directly, or use reflection to check the declared mappings, aliases and permissions. Direct calls bypass framework dispatch and cannot verify argument binding or permission checks.

On Paper, verify that the commands and aliases register, that players with and without permission see the expected commands and suggestions, and that dispatch and syntax-error feedback work through the actual command tree.

If you do not use the kit and your tests depend directly on `org.mockbukkit.mockbukkit:mockbukkit-v26.3:4.123.0` and fail during registry initialization, check the fixture `registries/registry_key_class_relation.json`. That version lacks the `minecraft:timeline` and `minecraft:world_clock` mappings needed by Paper 26.3. The framework's matching fixture lives in `src/test/resources/registries/registry_key_class_relation.json` in [UltiTools-Reborn](https://github.com/UltiKits/UltiTools-Reborn). Keep it under `src/test/resources`, not in your plugin JAR.

As of v7.1.0, the test kit includes `registries/registry_key_class_relation.json` for its pinned MockBukkit and Paper versions. Kit users do not need to copy the registry patch. Declare the test kit before any direct MockBukkit dependency in Maven, or remove that direct dependency and use the version the kit brings.
