英文:
Error loading plugin: Unsupported API version 1.2
问题
以下是您提供的内容的中文翻译:
我正在为我的服务器制作一个插件,但当我启动服务器时,它给我这个错误:
[服务器线程/错误]: 无法在文件夹 'plugins' 中加载 'plugins\CustomServer.jar'
org.bukkit.plugin.InvalidPluginException: 不支持的API版本 1.2
at org.bukkit.craftbukkit.v1_20_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:317) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:141) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:429) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
plugin.yml:
name: CustomServer
version: '1.0'
main: me.user.customserver.CustomServer
api-version: 1.20
英文:
I'm making a plugin for my server, but when I start the server, it gives me this error:
[Server thread/ERROR]: Could not load 'plugins\CustomServer.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.2
at org.bukkit.craftbukkit.v1_20_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:317) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:141) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:429) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3797-Spigot-7e2af8b-091027a]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
plugin.yml:
name: CustomServer
version: '1.0'
main: me.user.customserver.CustomServer
api-version: 1.20
答案1
得分: 2
The api-version in the yml file is seen as a number (with 2 decimals).
The 0 gets trimmed because the number is round.
Thats why the error says you are using api-version 1.2
You should make the api-version a string so it will recognize it as 1.20.
name: CustomServer
version: '1.0'
main: me.user.customserver.CustomServer
api-version: '1.20'
英文:
The api-version in the yml file is seen as a number (with 2 decimals).
The 0 gets trimmed because the number is round.
Thats why the error says you are using api-version 1.2
You should make the api-version a string so it will recognise it as 1.20.
name: CustomServer
version: '1.0'
main: me.user.customserver.CustomServer
api-version: '1.20'
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论