FANDOM


onEnable() is one of the methods used in the development of bukkit plugins. It is one of the two required methods, the other being onDisable(), that are in all bukkit plugins.

onEnable() is the method used to tell the plugin what to do when it has been activated, whether it has been activated by the server starting up or by a server reload. In the following example the onEnable method tells the server log to display the message: [INFO][PluginName] has been activated!.

Example:

@Override
public void onEnable() {
  Bukkit.getLogger().info("[PluginName] has been activated!");
}