> ## Documentation Index
> Fetch the complete documentation index at: https://minekube.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Java Plugins

> Creating custom Java Bukkit plugins with the Minekube AI assistant -- when to use Java vs. Skript, how to ask, and development tools available

# Custom Java Plugins

For complex features that go beyond what Skript can handle, the AI can write **Java Bukkit plugins**, compile them, and install them -- all directly on your server.

***

## When to Use Java vs. Skript

Most of the time, the AI uses Skript for custom features because it is faster to create and easier to modify. But some tasks are better suited to a full Java plugin.

| Use Skript When...                | Use a Java Plugin When...                                      |
| --------------------------------- | -------------------------------------------------------------- |
| Simple commands and events        | Complex game mechanics with many interacting systems           |
| Quick prototypes and experiments  | Performance-critical code (packet handling, chunk processing)  |
| Small scripts (under \~200 lines) | Large systems with many classes and features                   |
| Standard Minecraft API needs      | Custom packet handling, protocol work, or database integration |
| You want fast iteration           | You need compiled performance                                  |

<Tip>
  You do not need to decide which approach to use. Just tell the AI what you want, and it will choose the best tool. If you have a preference, mention it: "use Skript for this" or "build this as a Java plugin."
</Tip>

***

## How to Ask the AI

Describe the plugin you want. The AI handles the entire development process.

```
build a Java plugin that creates holographic leaderboards
make a Bukkit plugin for a custom enchantment system
create a Java plugin that adds rideable chairs
write a plugin that tracks player statistics and stores them in a database
```

<Steps>
  <Step title="AI creates the project structure">
    Sets up a Gradle project with the correct directory layout, `build.gradle` with Paper API dependencies, and `plugin.yml` with commands and permissions.
  </Step>

  <Step title="AI writes the Java source code">
    Creates all necessary Java classes -- main plugin class, event listeners, command handlers, utility classes, and configuration.
  </Step>

  <Step title="AI compiles the plugin">
    Runs `./gradlew build` to compile the Java code into a JAR file. If there are compilation errors, the AI fixes them and retries.
  </Step>

  <Step title="AI installs and loads the plugin">
    Copies the compiled JAR to the `plugins/` folder and hot-loads it with PlugMan. No server restart needed.
  </Step>

  <Step title="AI verifies it works">
    Checks server logs for errors and may run test commands to confirm the plugin loaded correctly.
  </Step>
</Steps>

***

## Development Tools on Your Server

Your server has a full Java development environment pre-installed:

| Tool          | Version                         | Purpose                                              |
| ------------- | ------------------------------- | ---------------------------------------------------- |
| **Java**      | 21 (Eclipse Temurin)            | Runtime and compiler                                 |
| **Gradle**    | Auto-downloaded per project     | Build tool for dependency management and compilation |
| **Paper API** | 1.21 (Bukkit/Spigot compatible) | The Minecraft server API your plugins target         |
| **PlugMan**   | Pre-installed                   | Hot-reload plugins without restarting the server     |

***

## Modifying Plugins Later

The AI saves plugin source code to a location on the server so you can ask for modifications later:

```
add a reload command to my hologram plugin
fix the bug where chairs don't work on stairs
add MySQL support to the leaderboard plugin
change the particle effect in the custom enchantment plugin
add a config file to the statistics plugin
```

The AI finds the existing source code, makes the changes, recompiles, and reinstalls the updated plugin.

<Info>
  Plugin source code and compiled JARs persist across server restarts and hibernation. Your custom plugins survive indefinitely.
</Info>

***

## Examples

<AccordionGroup>
  <Accordion title="Holographic leaderboards">
    ```
    build a Java plugin that shows floating holographic leaderboards
    with top 10 players by kills, displayed above a block at spawn
    ```

    The AI creates a plugin using hologram APIs, stores scores, and updates the display periodically.
  </Accordion>

  <Accordion title="Custom GUI menus">
    ```
    create a Java plugin with a /menu command that opens a chest GUI
    with clickable items for teleporting, kits, and settings
    ```

    The AI writes inventory-based GUI code with click handlers for each menu item.
  </Accordion>

  <Accordion title="Integration with other plugins">
    ```
    write a plugin that uses Vault for economy and creates a /pay command
    that lets players send money to each other
    ```

    The AI sets up Vault as a dependency, hooks into the economy API, and creates the transfer command.
  </Accordion>
</AccordionGroup>

<Warning>
  Custom Java plugins are powerful but more complex to debug than Skript. For most custom features (commands, events, scoreboards, kits, minigames), Skript is the faster and simpler choice. Reserve Java plugins for features that genuinely need compiled performance or access to APIs that Skript cannot reach.
</Warning>
