Minecraft Java 1.12.2服务器插入插件错误

时间:2020-05-25 16:34:07

标签: java minecraft

我需要Minecraft服务器插件的帮助,我的服务器给我一个错误 Cannot find main class `harvey.plugin.jmsg.JoinMsg'和我的Plugin.yml:

main: harvey.plugin.jmsg.JoinMsg
version: 10.1
author: harvey
commands:

这是我的插件本身

package harvey.plugin.jmsg;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class JoinMsg extends JavaPlugin implements Listener{

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
    }

    @Override
    public void onDisable() {

    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) throws FileNotFoundException {
        Player p = e.getPlayer();
        String joianquitmsg = null;
        File joinquitmsg = new File("/CJAL/msg.txt");
        Scanner msginfo = new Scanner(joinquitmsg);
        e.setJoinMessage(joianquitmsg);
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent e) {
        Player p = e.getPlayer();
        e.setQuitMessage(getName() + "Welcome!");
    }
}

有谁能帮助我,那太神奇了! 我对此并不陌生,所以任何技巧都将对您有所帮助! :)

1 个答案:

答案 0 :(得分:0)

您可能在IDE中将其导出错误

仅尝试导出src和plugin.yml