将事件注册到主类
public class Main extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void yourEvent(Event e) {
//...
}
}
public class Main extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void yourEvent(Event e) {
//...
}
}