BukkitstrPlugin is a Minecraft plugin that integrates with the Nostr relay to authenticate players. Players must authenticate by signing a valid Nostr event before they can move in the game.
Copy the generated `bukkitstr-plugin-1.0-SNAPSHOT.jar` file from the `target` directory to your Minecraft server's `plugins` directory.
5.**Start your server**:
Start your Minecraft server and check the console for any errors. The plugin should initialize and connect to the Nostr relay.
## Usage
### Authentication Command
Players need to use the `/auth` command to start the authentication process. The plugin will wait for a Nostr event containing the player's Minecraft username in the `d` tag content.
```sh
/auth
```
### Sign Event
Next, you need to sign a event kind "13378008" and the "d" tag to be your Minecraft username.
Then send to the relay you've specified in src/../BukkitstrPlugin.java
### Player Authentication Process
1.**Connect to the Nostr relay**: The plugin connects to the specified Nostr relay when the server starts.
2.**Send Authentication Request**: The plugin sends an initial request to the Nostr relay to listen for authentication events.
3.**Wait for Nostr Event**: When a player uses the `/auth` command, the plugin waits for a Nostr event containing the player's username in the `d` tag.
4.**Authenticate Player**: If the received Nostr event's `d` tag content matches the player's username, the player is authenticated and can move freely. Otherwise, they will receive an authentication failure message.
## Developer Information
### Source Code
The main source code is located in the `src/main/java/family/vanderwarker/bukkitstr/BukkitstrPlugin.java` file.
### Dependencies
Ensure the following dependencies are added to your `pom.xml`:
```xml
<dependencies>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
</dependency>
</dependencies>
```
## Acknowledgments
- Thanks to the SpigotMC community for their documentation and support.
- Thanks to the Nostr community for their innovative protocol.
- Thanks to [npub1826v365he5ty69lk3xgvzqrwy8587vdfrxnsz0k09khzustf8r7s6j7t95](nostr:npub1826v365he5ty69lk3xgvzqrwy8587vdfrxnsz0k09khzustf8r7s6j7t95)