minecraft-plugin-dev

Minecraft plugin development: create, modify, and debug server plugins for current Paper 26.x (Java 25) or legacy Bukkit-derived 1.21.x (Java 21) servers using the JavaPlugin API (events, commands, schedulers, configuration, PDC, and Adventure). Does not cover client mods or vanilla datapacks.

Last repository push
GitHub Stars
218
Forks
12
Issues / PRs
0

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "minecraft-plugin-dev" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5d21f7d966b835fc35a6cba206e717140b0292ab06ab90e50a32a929bc475b21. Verify the upstream source and version against https://github.com/Jahrome907/minecraft-agent-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Minecraft plugin development: create, modify, and debug server plugins for current Paper 26.x (Java 25) or legacy Bukkit-derived 1.21.x (Java 21) servers using the JavaPlugin API (events, commands, schedulers, configuration, PDC, and Adventure). Does not cover client mods or vanilla datapacks.

0 Downloads

Introduction source: third_party · Jahrome907 · 0.0.1 Reference

SkillPi interpretation

Tasks
Develop Minecraft server plugins using the Paper/Bukkit/Spigot API for Minecraft 26.x (and the 1.21.x line). Handles creating Paper plugins with JavaPlugin, event listeners with @EventHandler, commands, schedulers (sync/async/Folia-safe), Persistent Data Container (PDC), Adventure text components, Vault economy integration, BungeeCord/Velocity messaging, plugin.yml and paper-plugin.yml configuration, YAML config management, and Paper-specific enhancement APIs. Targets Paper API 26.2 (Java 25; 1.21.x servers use Java 21) with Gradle (Kotlin DSL). Plugins run server-side only and do not require client installation. Use when creating or modifying Minecraft server plugins, working with Paper/Bukkit/Spigot APIs, or developing server-side features involving event handlers, commands, or plugin.yml configuration.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: minecraft-plugin-dev
description: "Develop Minecraft server plugins using the Paper/Bukkit/Spigot API for Minecraft 26.x (and the 1.21.x line). Handles creating Paper plugins with JavaPlugin, event listeners with @EventHandler, commands, schedulers (sync/async/Folia-safe), Persistent Data Container (PDC), Adventure text components, Vault economy integration, BungeeCord/Velocity messaging, plugin.yml and paper-plugin.yml configuration, YAML config management, and Paper-specific enhancement APIs. Targets Paper API 26.2 (Java 25; 1.21.x servers use Java 21) with Gradle (Kotlin DSL). Plugins run server-side only and do not require client installation. Use when creating or modifying Minecraft server plugins, working with Paper/Bukkit/Spigot APIs, or developing server-side features involving event handlers, commands, or plugin.yml configuration."

Minecraft Plugin Development Skill

Platform Overview

Platform Base API Notes
Paper Bukkit/Spigot + Paper extensions Recommended; async chunk loading, Adventure native
Spigot Bukkit + Spigot extensions Legacy; fewer APIs, slower
Bukkit Base API only Avoid for new plugins
Folia Paper fork Region-threaded; requires special scheduler APIs

Paper is the recommended target. Paper includes all Bukkit and Spigot APIs plus significant performance improvements and additional APIs.

Routing Boundaries

  • Use when: the target is server-side Paper/Bukkit/Spigot plugin behavior with JavaPlugin APIs.
  • Do not use when: the task requires client-side installable mods or loader APIs (minecraft-modding / minecraft-multiloader).
  • Do not use when: the task is pure vanilla datapack/command content (minecraft-datapack / minecraft-commands-scripting).
  • Do not use when: the task is a Bedrock add-on or Script API pack (minecraft-bedrock-addon-dev).
  • Do not use when: the task is installing, configuring or operating an existing plugin (minecraft-server-admin, minecraft-permissions-admin, minecraft-essentials-ops).
  • Do not use when: the task is writing automated tests (minecraft-testing) or release pipelines (minecraft-ci-release).

Bundled References

  • Read references/runtime-patterns.md when the task touches scheduling, Folia support, PDC, Adventure/MiniMessage, YAML config, Vault, or Paper-specific APIs.

Project Setup

settings.gradle.kts

rootProject.name = "my-plugin"

build.gradle.kts

plugins {
    java
    id("com.gradleup.shadow") version "8.3.0"
}

group = "com.example"
version = "1.0.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    // For Vault (economy API)
    maven("https://jitpack.io")
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:26.2.build.+")
    // Optional: Vault economy/permission integration
    compileOnly("com.github.MilkBowl:VaultAPI:1.7")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}

tasks {
    processResources {
        // Substitutes ${version} in plugin.yml with the Gradle project version
        filesMatching(listOf("plugin.yml", "paper-plugin.yml")) {
            expand("version" to project.version)
        }
    }
    shadowJar {
        archiveClassifier.set("")
    }
    build {
        dependsOn(shadowJar)
    }
}

gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip

Project Layout

my-plugin/
├── build.gradle.kts
├── settings.gradle.kts
├── gradle/
│   └── wrapper/
│       └── gradle-wrapper.properties
└── src/main/
    ├── java/com/example/myplugin/
    │   ├── MyPlugin.java          ← main class (extends JavaPlugin)
    │   ├── listeners/
    │   │   └── PlayerListener.java
    │   ├── commands/
    │   │   └── MyCommand.java
    │   └── managers/
    │       └── DataManager.java
    └── resources/
        ├── plugin.yml
        ├── paper-plugin.yml      ← optional, Paper-only metadata
        └── config.yml

Core Files

plugin.yml (Bukkit-compatible default)

name: MyPlugin
version: "${version}"
main: com.example.myplugin.MyPlugin
description: An example Paper plugin
author: YourName
website: https://github.com/example/my-plugin
api-version: '26.2'

commands:
  myplugin:
    description: Main plugin command
    usage: /myplugin <subcommand>
    permission: myplugin.use
    aliases: [mp]

permissions:
  myplugin.use:
    description: Allows use of /myplugin
    default: true
  myplugin.admin:
    description: Admin access
    default: op

Minecraft Java now uses year-based versions (26.1, 26.2, 26.3). Use api-version: '26.2' to target Paper 26.2. Older servers on the 1.21 line still use api-version: '1.21' or '1.21.<patch>'. In this repo, the validator accepts 1.21, positive 1.21.<patch> values, and 26.<minor> or 26.<minor>.<hotfix> values. A 26.x minor newer than the documented example (26.2) is allowed but warned, so new Paper releases do not force an immediate validator edit. Values such as 1.21.0, 1.21.01, 1.22 or 26.0 are rejected. Paper 26.x needs Java 25. Paper 26.3 is still beta; confirm the build on https://papermc.io/downloads/paper before you pin it.

paper-plugin.yml (Paper-only metadata)

Use paper-plugin.yml when you need Paper-specific metadata such as folia-supported or server/bootstrap dependency ordering. Keep plugin.yml if you must stay portable to Bukkit-derived servers that do not understand the Paper-specific file.

name: MyPlugin
version: "${version}"
main: com.example.myplugin.MyPlugin
api-version: '26.2'
folia-supported: true

dependencies:
    server:
        Vault:
            load: BEFORE
            required: false

Main Plugin Class

package com.example.myplugin;

import com.example.myplugin.commands.MyCommand;
import com.example.myplugin.listeners.PlayerListener;
import org.bukkit.plugin.java.JavaPlugin;

public final class MyPlugin extends JavaPlugin {

    private static MyPlugin instance;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        // Register listeners
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);

        // Register commands
        var cmd = getCommand("myplugin");
        if (cmd != null) {
            cmd.setExecutor(new MyCommand(this));
            cmd.setTabCompleter(new MyCommand(this));
        }

        getLogger().info("MyPlugin enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("MyPlugin disabled.");
    }

    public static MyPlugin getInstance() {
        return instance;
    }
}

Event Listeners

package com.example.myplugin.listeners;

import com.example.myplugin.MyPlugin;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

public class PlayerListener implements Listener {

    private final MyPlugin plugin;

    public PlayerListener(MyPlugin plugin) {
        this.plugin = plugin;
    }

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onPlayerJoin(PlayerJoinEvent event) {
        event.joinMessage(
            Component.text(event.getPlayer().getName() + " joined!", NamedTextColor.GREEN)
        );
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        event.quitMessage(
            Component.text(event.getPlayer().getName() + " left.", NamedTextColor.YELLOW)
        );
    }

    @EventHandler(ignoreCancelled = true)
    public void onPlayerDeath(PlayerDeathEvent event) {
        // Modify death message using Adventure components
        event.deathMessage(
            Component.text("☠ ", NamedTextColor.RED)
                .append(Component.text(event.getPlayer().getName(), NamedTextColor.WHITE))
                .append(Component.text(" died!", NamedTextColor.RED))
        );
    }
}

EventPriority order

LOWEST → LOW → NORMAL → HIGH → HIGHEST → MONITOR
Use MONITOR for logging only (never modify outcome). Use ignoreCancelled = true unless you have a specific reason to handle cancelled events.

Cancellable events

@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
    if (event.getPlayer().hasPermission("myplugin.break.deny")) {
        event.setCancelled(true);
        event.getPlayer().sendMessage(Component.text("You cannot break blocks!", NamedTextColor.RED));
    }
}

Commands

package com.example.myplugin.commands;

import com.example.myplugin.MyPlugin;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class MyCommand implements CommandExecutor, TabCompleter {

    private final MyPlugin plugin;

    public MyCommand(MyPlugin plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command,
                             @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage(Component.text("Only players can use this command.", NamedTextColor.RED));
            return true;
        }

        if (!player.hasPermission("myplugin.use")) {
            player.sendMessage(Component.text("No permission.", NamedTextColor.RED));
            return true;
        }

        if (args.length == 0) {
            player.sendMessage(Component.text("Usage: /myplugin <reload|info>", NamedTextColor.YELLOW));
            return true;
        }

        return switch (args[0].toLowerCase()) {
            case "reload" -> {
                plugin.reloadConfig();
                player.sendMessage(Component.text("Config reloaded.", NamedTextColor.GREEN));
                yield true;
            }
            case "info" -> {
                player.sendMessage(Component.text("Version: " + plugin.getDescription().getVersion(), NamedTextColor.AQUA));
                yield true;
            }
            default -> {
                player.sendMessage(Component.text("Unknown subcommand.", NamedTextColor.RED));
                yield false;
            }
        };
    }

    @Override
    public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command,
                                                @NotNull String label, @NotNull String[] args) {
        if (args.length == 1) {
            return List.of("reload", "info").stream()
                .filter(s -> s.startsWith(args[0].toLowerCase()))
                .toList();
        }
        return List.of();
    }
}

Schedulers

For classic Paper plugins, BukkitScheduler is still fine. If you claim Folia support, route player, entity, region, global, and async work through the matching Folia-aware scheduler. Keep scheduling behind a small project-local interface when one plugin must support both Paper and Folia.

See references/runtime-patterns.md for copy-ready sync, async, cancelable, and Folia-safe scheduler examples.


Persistent Data Container (PDC)

PDC stores arbitrary data on any PersistentDataHolder (players, entities, items, chunks). Data is saved with the world and persists across restarts.

Create NamespacedKey instances once, keep data types stable after release, and use PDC for small metadata rather than large datasets. Prefer config files or a database for large or query-heavy plugin state.

See references/runtime-patterns.md for player, item, chunk, and world PDC examples.


Adventure Text Components

Paper uses Adventure natively for all text. No legacy chat colors. Use Component builders for code-owned messages and MiniMessage for config-driven messages. Avoid legacy ChatColor unless the target project already depends on it for compatibility.

See references/runtime-patterns.md for simple messages, hover/click events, MiniMessage parsing, titles, and action bars.


Configuration (YAML)

src/main/resources/config.yml

# Default config
settings:
  max-players: 20
  welcome-message: "<green>Welcome to the server!"
  cooldown-seconds: 30

database:
  host: localhost
  port: 3306
  name: myplugin_db

Accessing config values

Call saveDefaultConfig() in onEnable(), provide explicit defaults when reading values, and validate config shape before starting long-running tasks.

Custom config file

Use custom YAML files only when separating user config from mutable plugin data is worth the extra file handling. Keep blocking disk writes off hot event paths.

See references/runtime-patterns.md for config read/write and custom YAML examples.


Vault Integration (Economy / Permissions)

Declare Vault as compileOnly, soft-depend on it in plugin metadata, and disable economy features cleanly when the service provider is unavailable. Never assume a Vault-compatible economy plugin is installed just because Vault itself is present.

See references/runtime-patterns.md for a minimal economy setup and charge example.


Paper-Specific APIs

Use Paper APIs when they remove main-thread blocking or simplify Adventure-native behavior. Keep optional plugin integrations behind presence checks and metadata soft-dependencies.

See references/runtime-patterns.md for async chunk loading, custom item meta, profile lookup, and protection-plugin integration examples.


Common Tasks Checklist

Creating a new event listener

  • [ ] Create class implementing Listener
  • [ ] Annotate methods with @EventHandler
  • [ ] Call getServer().getPluginManager().registerEvents(listener, plugin) in onEnable()
  • [ ] Add ignoreCancelled = true unless you need cancelled events

Adding a new command

  • [ ] Define command in plugin.yml under commands:
  • [ ] Create executor class implementing CommandExecutor
  • [ ] (Optional) implement TabCompleter for autocomplete
  • [ ] Register with getCommand("name").setExecutor(new MyExecutor())

Saving plugin data

  • [ ] For simple values: use config.yml via getConfig() / saveConfig()
  • [ ] For per-entity data: use PDC with a NamespacedKey
  • [ ] For large datasets: use async scheduler + file I/O or a database

Scheduling a repeating task

  • [ ] Determine if task needs main thread (use runTaskTimer) or is I/O (use runTaskTimerAsynchronously)
  • [ ] Store the BukkitTask reference so you can cancel in onDisable()
  • [ ] Cancel all tasks in onDisable() or use getServer().getScheduler().cancelTasks(plugin)

Build, Validate, and Run

  1. Build the plugin JAR:
    ./gradlew shadowJar
    # Output: build/libs/my-plugin-1.0.0-SNAPSHOT.jar
  2. Run the bundled validator to catch config and layout errors:
    ./scripts/validate-plugin-layout.sh --root /path/to/plugin-project
    # Strict mode treats warnings as failures:
    ./scripts/validate-plugin-layout.sh --root /path/to/plugin-project --strict
  3. Fix any reported errors and re-run until clean.
  4. Deploy: copy JAR to server/plugins/ and restart, or use the dev server:
    ./gradlew runServer

The validator checks:

  • plugin.yml required keys (name, version, main, api-version) and repo-supported 1.21, positive 1.21.<patch> and 26.<minor>[.<hotfix>] api-version values, with warnings for versions newer than the repo's current example
  • Main class path exists and extends JavaPlugin
  • /reload anti-pattern detection in source snippets

References

Version history

  1. v2.5.4 GitHub ↗
    Original release notes

    - Correct version-specific examples and source links across the skill library. - Trim obsolete snippets, preserve legacy guidance, and sync all skill copies. Validated with the repository checks and all 13 skill validators. No game runtime testing was performed.

  2. v2.5.3 GitHub ↗
    Original release notes

    Updates the 13-skill Minecraft bundle for GPT-6 Astra and Claude Fable 5.1 workflows while preserving existing project versions and host tool boundaries. - Refreshes current Minecraft 26.x / Java 25 guidance and keeps explicit Minecraft 1.21.x / Java 21 and Forge 1.20.1 / Java 17 lanes. - Corrects pack metadata, resource references, mod and GameTest registration, Paper commands, world-generation examples, server operations, and publishing instructions. - Addresses all PR #11 review findings and strengthens regression coverage for implicit legacy GameTest templates and class-specific registration. - Synchronizes Codex, Claude Code, and plugin skill copies; package, lockfile, and both plugin manifests are version 2.5.3. Validation: full repository checks and focused positive/negative regression cases passed locally. GitHub Skills Audit and secret scanning passed on the released commit. These are content, packaging, and static-validator checks; they do not certify Java compilation or in-game behavior. Fable 5.1 guidance was checked against official documentation, without a live authenticated model evaluation. See the [September skill audit](https://github.com/Jahrome907/minecraft-agent-skills/blob/v2.5.3/docs/skill-audit-2026-09.md) for sources, coverage, and validation limits. Changes: https://github.com/Jahrome907/minecraft-agent-skills/pull/11

  3. v2.5.2 GitHub ↗
    Original release notes

    Refreshes the skill set for current Minecraft 26.2 and Java 25 while preserving explicit Minecraft 1.21.x and Forge 1.20.1 legacy lanes. Adds current pack metadata, Paper and MockBukkit examples, 26.2 multiloader validation, corrected GameTest structure paths, refreshed self-contained YAML tooling and Markdown lint dependencies, and Node 24-compatible pinned GitHub Actions. Validated by the full repository check and secret scan.

  4. v2.5.1 GitHub ↗
    Original release notes

    ## Added - Added a README quick-install prompt for installing the Codex or Claude Code skill bundle without manually cloning the repo. ## Changed - Corrected worldgen, resource-pack, command-script, and server-ops examples. - Hardened datapack, worldgen, Paper plugin, testing, multiloader, and workflow validation coverage. - Clarified Codex plugin install requirements and aligned CI with the full local check gate. - Pinned workflow actions to full commit SHAs. - Bumped package and plugin metadata to version 2.5.1.

  5. v2.5.0 GitHub ↗
    Original release notes

    ### Changed - Refreshed 1.21.x version guidance for Fabric 1.21.11, Architectury multiloader artifacts, MockBukkit 4.x, and Gradle setup actions. - Corrected 1.21.9+ datapack/resource-pack metadata examples and validators to use exact `[major, minor]` pack versions instead of JSON decimals. - Added resource-pack validator coverage for 1.21.4+ `assets/<namespace>/items/*.json` item model definitions. - Updated command examples for 1.21.9 spawn rotation syntax and 1.21.11 namespaced gamerules, and made the bundled stopwatch `.mcfunction` copyable. - Hardened server-admin, WorldEdit, and EssentialsX ops guidance around Velocity forwarding, backup quiescing, WorldEdit history cleanup, sign-shop permissions, and spawn-module checks. - Added local mirror-sync validation to `npm run check` and aligned CI to use the same npm script entrypoints. - Clarified that this bundle remains centered on 1.21.x and that Minecraft 26.1.x requires a separate Java/API/data-format verification pass. - Bumped package and plugin metadata to version `2.5.0`.

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 提供完整的Minecraft服务端插件开发指南,涵盖从项目搭建到部署的全流程
  • 针对Paper 26.x和Bukkit 1.21.x两大主流平台,实用性强
  • 包含详细的代码示例、配置模板和最佳实践,显著提升开发效率
Trigger Precision95/100

Highlights

  • 触发条件描述清晰,明确区分服务端插件开发与客户端模组、数据包等边界
  • 详细列出了适用和不适用场景,避免误触发
Structure and Standards88/100

Areas to improve

  • 文档长度 Reported severity: Minor

    主文档内容较长(约800+行),可能影响阅读体验

    Recommendation: 考虑将部分内容拆分为独立的参考文件,保持主文档简洁

Highlights

  • 结构清晰,分阶段组织内容,从概述到具体实现逐步深入
  • 包含完整的项目布局、核心文件模板和常用任务清单
  • 提供了丰富的代码示例和配置片段
Execution Reliability94/100

Highlights

  • 所有依赖库版本明确指定,构建配置完整可靠
  • 代码示例展示了正确的错误处理和资源管理实践
  • 提供了验证脚本确保项目结构和配置正确性
  • 调度器使用示例包含了必要的取消机制
Evidence Verifiability (mean of the first four)92/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • docs.advntr.dev
  • docs.papermc.io
  • github.com
  • javadoc.io
  • jd.papermc.io
  • jitpack.io
  • papermc.io
  • repo.papermc.io

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.