---
url: /v6.3.2/guide/advanced/economy.md
---
# Economy

::: info As of v6.3.0
The economy states and diagnostics below are available in UltiTools-API v6.3.0. In v6.2.5 and earlier, `EconomyUtils` reports unavailability silently.
:::

UltiTools integrates with Vault's economy API as an optional, soft dependency. A server without
Vault installed runs UltiTools and every module normally — no economy feature is required for the
framework or any other module to work. A module that does call an economy operation goes through
`EconomyUtils`, never through Vault directly.

## Economy states

The economy service is always in exactly one of three states, and the console reports which one
applies once at server start:

| State | Console line at start | Meaning |
|---|---|---|
| Vault not installed | `[UltiTools-API] Vault not installed - economy service unavailable.` | No plugin named `Vault` is present |
| No provider registered | `[UltiTools-API] Vault detected, but no economy provider is registered - economy service unavailable.` | Vault is present, but no economy plugin (for example EssentialsX) has registered an `Economy` provider with it |
| Available | `[UltiTools-API] Hooked into Vault, economy provider: <provider name>.` | Vault is present and a provider is registered |

The state is re-checked on every call, not cached at start-up — a provider that registers after the
framework has already started is seen on the very next call, since plugin load order gives no
ordering guarantee beyond declared dependencies.

## Calling the façade

A module never checks for Vault itself. It calls `EconomyUtils`, which reports the current state
and behaves safely in every one of the three states above:

```java
if (EconomyUtils.isAvailable()) {
    double balance = EconomyUtils.getBalance(player);
    EconomyUtils.withdraw(player, 10.0);
}
```

When the economy service is unavailable, every `EconomyUtils` operation returns a safe default
(zero, `false`, or a plain formatted string) rather than throwing, and the console logs one
WARNING the first time a given module makes a request in that server session — not on every call.
That warning names the calling module, distinguishes "Vault is not installed" from "Vault is
installed but no provider is registered," states plainly that this is the server's own
environment rather than a defect in UltiTools or in the calling module, and gives the install
instruction. A module author does nothing to opt into this — every existing `EconomyUtils` call
site already receives it.

The caller is found from the call stack. As of v6.3.0 the warning can name:

* a loaded module, through the packages its `@UltiToolsModule` scans and, in addition, its main
  class's own package ([issue #489](https://github.com/UltiKits/UltiTools-Reborn/issues/489));
* a module that is still being registered — a request from its constructor, a `@PostConstruct`
  method or `registerSelf()` ([issue #483](https://github.com/UltiKits/UltiTools-Reborn/issues/483));
* a plain Bukkit plugin connected through the [External Plugin API](./external-plugin-api.md), by its
  plugin name, until it disconnects ([issue #462](https://github.com/UltiKits/UltiTools-Reborn/issues/462)).

The most specific matching package wins; a package claimed by two different callers names neither.
A request none of these covers is reported as `an unknown caller`, once per calling package rather
than once for all of them, so a second unknown caller is not silenced.

A known limitation, documented rather than changed
([issue #567](https://github.com/UltiKits/UltiTools-Reborn/issues/567)): the main class's own package
counts together with its sub-packages, like a scanned package. A module whose main class sits in a
broad package shared with other code -- `com.example`, while other plugins or libraries also live under
`com.example` -- may be named as the caller for code there that is not its own, and that request uses
up the module's one warning for the session. Put the main class in a package of its own, such as
`com.example.myplugin`, as every first-party module does.

## What this does not change

Vault stays an optional, soft dependency of UltiTools: `plugin.yml` still lists
`Vault` under `softdepend`, and the Maven dependency on Vault's API is still `provided` scope. No module
needs to change how it calls `EconomyUtils`. A public, multi-currency economy interface is under
design for a future release; it is not part of v6.3.0, and no code in this release depends on it.
