英文:
Could not load 'plugins\HelloWorld.jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
问题
大家好,我最近开始使用Java进行编码,制作Minecraft插件等等。大约一个月前我才开始尝试这种类型的事情,并学会了在Eclipse中进行项目的启动所需的所有有趣操作。我已经查阅了许多教程,但基本上所有教程都不起作用,因为每次都会出现以下错误。如果有人可以帮忙,那将非常棒。
以下是加载时出现的错误信息
> [16:52:22] [Server thread/ERROR]: 无法在文件夹 'plugins' 中加载 'plugins\HelloWorld.jar'
> org.bukkit.plugin.InvalidDescriptionException: 命令类型错误
> at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:969)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:165)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:202)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:775)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at java.lang.Thread.run(Unknown Source) [?:1.8.0_251] Caused by: java.lang.ClassCastException: 无法将java.lang.String转换为
> java.util.Map
> at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:951)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> ... 7 more
请帮帮我,我该如何解决这个问题!!
(顺便说一句,我会链接plugin.yml和Main等所有内容,但我不知道怎么做,所以如果有人能回复我告诉我怎么做,我也可以把那些内容发出来。非常感谢任何帮助)
英文:
Hi Y`all i recently start coding in java to make minecraft plugins and that sort of thing i just started doin this type of thing about a month ago and learned how to do all of the fun stuff in eclipse to start my project, i have looked at a bunch of tutorials but all of them basicly dont work because i get this error every time, if anyone could help that would be fanstastic.
This is the error message when i load it up
> [16:52:22] [Server thread/ERROR]: Could not load
> 'plugins\HelloWorld.jar' in folder 'plugins'
> org.bukkit.plugin.InvalidDescriptionException: commands are of wrong
> type
> at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:969)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:165)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:202)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:775)
> [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> at java.lang.Thread.run(Unknown Source) [?:1.8.0_251] Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to
> java.util.Map
> at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:951)
> ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
> ... 7 more
Please help how do i fix this!!
(btw i would link the plugin.yml and Main, and all that stuff but idk how so if someone can reply to this and tell me how to do that i can post that too, thank you any help is very aprreciated)
答案1
得分: 1
以下是翻译好的内容:
我的Minecraft爱好者在这里。通过http://www.yamllint.com/或任何其他YML验证工具检查您的YML格式。
以一个例子来说明:
错误的格式
name: HelloWorld
main: com.company.HelloWorld
version: 1.0
commands:
hello:
description: testing //description should take more indent than above because it's inside region
usage: /helloworld
aliases: [helloworld]
正确的格式
name: HelloWorld
main: com.company.HelloWorld
version: 1.0
commands:
hello:
description: testing //correct one
usage: /helloworld
aliases: [helloworld]
英文:
Minecraft avid here. Check your YML format through http://www.yamllint.com/ or any other YML validator.
Take an example:
Wrong format
name: HelloWorld
main: com.company.HelloWorld
version: 1.0
commands:
hello:
description: testing //description should take more indent than above because it's inside region
usage: /helloworld
aliases: [helloworld]
Correct format
name: HelloWorld
main: com.company.HelloWorld
version: 1.0
commands:
hello:
description: testing //correct one
usage: /helloworld
aliases: [helloworld]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论