我不明白为什么我不能将 Public void onEnable() 放在 public static void main 中;如果没有它,我无法运行插件 [关闭]

I don't understand why i can't put the Public void onEnable() in public static void main; I cannot run the plugin without that [closed]

提问人:potatoplugin 提问时间:11/16/2023 更新时间:11/16/2023 访问量:27

问:


这个问题是由错别字或无法再现的问题引起的。虽然类似的问题可能在这里是主题,但这个问题的解决方式不太可能帮助未来的读者。

6天前关闭。

这是我的代码(有点)

public class Plugin extends JavaPlugin
{
  
  public static void main(String[] args){
  
  private static final Logger LOGGER=Logger.getLogger("customweapons");
  
  public void onEnable()
  {
    LOGGER.info("customweapons enabled");
  }

  public void onDisable()
  {
    LOGGER.info("customweapons disabled");
  }
}
}

为什么公共空白在那里不起作用,我如何运行代码以查看插件是否有效。

我尝试运行它,但没有任何反应或收到错误消息

Java visual-studio-code 插件

评论


答: 暂无答案