Intellij启动Spigot服务器后插件未加载问题求助
Hey there! Let's get your Spigot plugin up and running—this is such a common first hurdle, so don't stress 😊
Fixing "Plugins (0):" Issue in Spigot
1. Compile and Export Your Plugin Jar Correctly
First, you need to turn your code into a Jar file that Spigot can recognize. Here's how to do it in IntelliJ:
- Open the
Gradlepanel on the right (if it's hidden, go toView > Tool Windows > Gradleto show it) - Expand your project, navigate to
Tasks > build > build, then double-click it. This will generate a Jar file in your project'sbuild/libsfolder (it'll look likeYourProjectName-Version.jar) - Copy this Jar file into the
pluginssubfolder of your Spigot server directory
2. Double-Check Your plugin.yml Configuration
This is the most common mistake for new devs! The plugin.yml is what tells Spigot about your plugin, so it must have these required fields:
name: MyFirstPlugin # Replace with your plugin's name main: com.yourname.myplugin.MyPlugin # Full path to your main Java class (package + class name) version: 1.0 api-version: 1.20 # Match this to your Spigot server version (e.g., 1.19, 1.20.1)
Critical notes:
- The
mainvalue must exactly match your main class's full path. For example, if your main class is in packagecom.example.testpluginand namedMain, you need to writecom.example.testplugin.Mainhere api-versionhas to align with your server's version—mismatches often cause plugins to fail silently
3. Verify IntelliJ's Server Run Configuration
Sometimes IntelliJ is pointing to a different server directory than you think! Let's check:
- Click the dropdown next to the run button in the top-right corner of IntelliJ, then select
Edit Configurations - Find your Spigot server configuration and look at the
Working directoryfield. It should point directly to your Spigot server root folder (the one containingplugins,worlds, and the Spigot Jar) - If it's wrong, update the path and restart the server
4. Check Server Logs for Errors
If the plugin still isn't loading, dig into the server logs to find clues:
- Open
logs/latest.login your server directory - Look for lines like "Could not load plugin" or "Invalid plugin.yml"—these will tell you exactly what's broken (e.g., wrong main class path, missing required fields)
Quick Test Tip
Try launching the server manually (without IntelliJ) to rule out IDE configuration issues:
- Put your plugin Jar into the
pluginsfolder - Run
java -jar spigot-[your-version].jarin your server directory - Watch the console—you should see a line like "[MyFirstPlugin] Enabled!" if everything works
内容的提问来源于stack exchange,提问作者Anton Bakulin
相关产品推荐
相关产品推荐

