【问题标题】:When running the server, my plugin does not show up in minecraft (Intellij)运行服务器时,我的插件没有出现在 minecraft (Intellij)
【发布时间】:2020-11-09 08:39:57
【问题描述】:

您好,我是 Minecraft 编码的新手,我今天刚开始,我正在尝试制作一个 Minecraft 插件。当我使用 Intellij 启动服务器时,它会启动,但是当我执行 /plugins 时,它会显示“Plugins (0):”,这意味着没有插件,那么如何将插件添加到插件文件夹或使用代码或其他内容?

这是我的主要 java 文件: Link

这是我的 plugin.yml 文件: Link

我们将不胜感激!谢谢

【问题讨论】:

    标签: java intellij-idea plugins minecraft bukkit


    【解决方案1】:

    我看到你正在使用 apache maven,你必须运行 package 命令,然后转到 /target 文件夹,然后将构建的 .jar 文件移动到服务器的插件文件夹中。只有这样你才能启动你的服务器。另外,下次提问时请提供服务器日志。

    tldr; package -> 将 .jar 文件从 /target 移动到 /plugins

    你的代码也是错误的:

    Player player = null; // player is now null, you cannot send message to null player. This is bad.
    

    应该是

    Player player = (Player) commandSender; // cast command sender to player, that is good. You can now send message.
    

    Watch this tutorial to help you.

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-28
    • 2021-04-28
    • 2015-01-01
    • 2013-11-14
    • 2022-01-15
    • 2020-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多