Honeypot Help

Develop with Honeypot

Develop with Honeypot

There may be situations in which even custom actions aren't enough to meet the needs of your server.

Honeypot provides a simple but powerful API which allows you to extend its functionality. Currently, you can listen to Events, add custom behaviors, and add custom block storage solutions should PDC and SQLite not fit your use case. See the sidebar for the various features and functions Honeypot exposes

Honeypot's JavaDocs are automatically published via JitPack. You can view the docs for the latest version here.

Configuring Honeypot In Your Project

I personally use Gradle, however I find most people use Maven for their plugins when first starting out. If you are using Gradle, the instructions are similar.

Using Maven and Jitpack

Add the repo and the dependency to your pom.xml

<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
<dependency> <groupId>org.reprogle.Honeypot</groupId> <artifactId>honeypot-api</artifactId> <version>API_VERSION</version> <scope>provided</scope> </dependency>

Replace the API_VERSION with the version of the API you want. You can also enter something like [3.4.0,) to use, at minimum, version 3.4.0 but try to use the latest available. If the version hasn't been built by Jitpack yet, then it may look like Maven will "freeze" on downloading. Don't worry! It's just building the API, and this may take a while (3-5 minutes usually).

Using Maven and GitHub Packages

Add the repo and the dependency to your pom.xml

<repositories> <repository> <id>github</id> <name>GitHub TerrorByteTW Apache Maven Packages</name> <url>https://maven.pkg.github.com/TerrorByteTW/Honeypot</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
<dependency> <groupId>org.reprogle.Honeypot</groupId> <artifactId>honeypot-api</artifactId> <version>API_VERSION</version> <scope>provided</scope> </dependency>

Replace the API_VERSION with the version of the API you want. You can also enter something like [3.4.0,) to use, at minimum, version 3.4.0 but try to use the latest available.

Add the authentication to the Package Registry in your global settings.xml: USER_HOME\.m2\settings.xml

<servers> <server> <id>github</id> <username>YOUR_USERNAME</username> <password>YOUR_AUTH_TOKEN</password> </server> </servers>

For more information on creating an auth token, see this article: Creating a personal access token

Replace the YOUR_AUTH_TOKEN with a generated GitHub personal access token: GitHub > Settings > Developer Settings > Personal access tokens > Generate new token. The token needs at least the read:packages scope.

Shading is not necessary as Honeypot Core is required for use with this API. You will need to either "depend" or "softdepend" Honeypot in your plugin.yml

Last modified: 02 November 2024