Error loading plugin: 不支持的API版本 1.2

huangapple go评论103阅读模式
英文:

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'

huangapple
  • 本文由 发表于 2023年6月13日 18:39:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76464042.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定