What you need to make a Minecraft plugin in Java
Writing a plugin by hand starts with a small Java project. You need a JDK (Java Development Kit) that matches your server: Minecraft 1.20.5 and later require Java 21 or newer, while earlier releases run on earlier Java versions. You also need a build tool, usually Maven or Gradle, and an editor such as IntelliJ IDEA or VS Code.
In the build file, declare the server API as a provided (Maven) or compileOnly (Gradle) dependency: paper-api from the PaperMC repository, or spigot-api from the Spigot repository. Choose the API version of the server you will actually run. A plugin compiled against a newer API can call methods that do not exist on an older server.
- A JDK that meets your server's Java requirement
- Maven or Gradle to build the .jar
- The paper-api or spigot-api dependency for your target version
- A local Paper or Spigot server to try the result
