====== MCServer Plugin API ======
MCServer plugins are written in Lua. Each plugin resides in a separate folder inside the Plugins folder. When a plugin is enabled in the settings.ini, the plugin folder is scanned for files and all files with the ".lua" extensions are loaded. Then the single entrypoint function, [[API:Initialize|Initialize]](), is called.

Plugins can register to handle special events, called [[API:plugin:Hooks|Hooks]]. A function within the plugin is called every time the event is encountered. The plugin may choose to "hide" the hook call from other plugins. This is why the order in which the plugins are loaded is important.

MCServer exports several [[API:plugin:Classes|classes]] to the Lua environment for the plugins to use, as well as some [[API:plugin:Globals|global functions]].

Each plugin has its own Lua state, meaning that plugins do not share their global variables. However, there is a limited support for calling other plugin's functions.

===== Important Plugin Topics =====
  * [[API:plugin:hooks|Hooks]] - get notified of stuff
  * [[API:plugin:Classes|Classes]] - know how to do stuff
  * [[API:plugin:Globals|Helper global functions]] - know how to get help on stuff


===== Want to learn how to create plugins? =====
The best way to learn how to create plugins for MCServer is to look at examples!
Check out the current plugins on [[http://forum.mc-server.org/forumdisplay.php?fid=2 | The forum]] and especially check out the [[http://code.google.com/p/mc-server/source/browse/#svn%2Ftrunk%2FMCServer%2FPlugins%2FCore | Core plugin]]
