Honeypot Help

Storage Providers

Technical Information

Storage Providers allow developers to create different methods of storing Honeypot blocks should the built-in methods not be enough for their specific use case.

There are three different types of Storage Provider in Honeypot: REGION, PLAYER, and PLAYER_HISTORY. Developers can create Storage Providers for as many or as few types as they wish, and one provider can support more than one type if desired.

Honeypot only contains one native storage method for each type. Player information, player history, and Block Data (the location and action of Honeypot) are stored within the default SQLite stores. It is necessary to have different methods of storage allows server managers to pick what is best for them.

The built-in SQLite Store has been architected to use an R*-Tree data structure, a variant of an R-Tree data structure but with better query performance. In testing, Honeypot's DB architecture allowed it to search a 2,000,0003 block area within milliseconds (That's 8E18, or eight quintillion blocks).

Because Honeypot can achieve such extreme query times without nearly any overhead, it's recommended that you stick with the native Honeypot storage methods unless you know you absolutely need something else.

Creating and Registering Storage Providers

To create a Storage Provider for one or more Store types, create a class and annotate it with the @HoneypotStore annotation. This annotation requires two arguments.

name

The name of the storage provider. This must be unique across all storage providers regardless of type. For example, no two REGION may be called "mysql", even if one is a REGION Store and the other is a PLAYER store.

type

The type or types this store supports. Can be a single item or a list of multiple

@HoneypotStore(name = "myStoreA", type = StoreType.REGION) public class MyStoreA implements RegionStore { // Implementation... } @HoneypotStore(name = "myStoreB", type = { StoreType.PLAYER, StoreType.PLAYER_HISTORY }) public class MyStoreB implements PlayerStore, PlayerHistoryStore { // Implementation... }

Notice that a Honeypot Store must implement the correct Interface for the type. Each type has a dedicated interface, and you must implement it.

Once the storage provider is complete, you must register it in your onLoad() method.

public class Test extends JavaPlugin { @Override public void onLoad() { // **MUST** be registered within your `onLoad()` method. Registry.getStorageManagerRegistry().register(new DemoHoneypotStore()); } @Override public void onEnable() { this.getLogger().info("Enabling!"); } @Override public void onDisable(){ this.getLogger().info("Disabling!"); } }

Honeypot will allow registrations of storage providers only at load time, so you cannot reload Honeypot using /reload or a plugin like PlugManX. To use the Storage Provider that was added, see Configuring Honeypot. You must update the name of the storage method to what you set in the @HoneypotStore annotation.

Using Storage Providers

The static Registry class provides a lot of functionality for working with Honeypot data without needing to know the inner workings of the storage provider.

A getter exists for each Store type to get the currently selected Storage Provider.

Registry#getRegionStore()

Gets the currently loaded Storage Provider for REGION data.

Registry#getPlayerStore()

Gets the currently loaded Storage Provider for PLAYER data.

Registry#getPlayerHistoryStore()

Gets the currently loaded Storage Provider for PLAYER_HISTORY data.

If you need to be able to get a Store Provider by name and/or type, you may do so using the methods on the StoreRegistry.

// Get the currently selected Storage Manager Registry // Honeypot supports custom registries, but it is not documented in the Wiki. Check the JavaDoc to learn more. var registry = Registry.getStorageManagerRegistry(); // Get a specific Storage Provider without knowing its type // Returns Optional<Object> since the type is unknown var someStore = registry.get("my-store"); // Get a specific Storage Provider with a known type // Returns Optional<T> since it's not guaranteed to exist var someRegionStore = registry.get("my-region-store", RegionStore.class); // Get all Storage Providers of a given type // Returns List<T> as it filters registered Stores instead of attempting to get a specific one var allPlayerStores = registry.getByType(StoreType.PLAYER, PlayerStore.class);
Last modified: 05 May 2026