Bukkit is a simple API that allows for modifying the normal Minecraft multiplayer experience using plugins.
Bukkit is now discontinued, and is no longer available for newer versions of Minecraft. Spigot, a version of Bukkit that boasts improving server performance is available. The API for Spigot is essentially the same as Bukkit.
Few Bukkit API methods are thread-safe and can be called asynchronously. For this reason, Bukkit API methods should only, with a few exceptions, be run on the main thread.
Code run inside of scheduleSync
methods, as well as the runTask
method will be run on the main thread.
Code run inside of runTaskAsynchronously
will be run asynchronously from the main thread. Asynchronous methods are very useful for doing large math or database operations without lagging the server, yet will cause undefined behavior if used to call Bukkit API methods. For this reason, Bukkit API methods that should be run after the asynchronous code should always be put in a runTask
method.
When registering an event, take a look if you're not registering it twice! Or your plugin will act twice for the registered event.
Take an extra look for how to handle specific events:
The Bukkit configuration files are straight-forward Y.A.M.L (Yet Another Markup Language) files, and are implemented as so.
Events are better covered in StackOverflow's List of Events documentation
Refer to Entities Documentation to understand EntityType better
There currently isn't any consistent way to avoid an entity gravity suffering, even if you cancel it's movement, the client-side of the player would still try to fall before the event is cancelled.
Refer to World Generation for world generation topics
The Bukkit API is a wrapper or abstraction layer for NMS that allows plugin developers to interact with the server without worrying about changes made to the internal codebase.
Use of NMS code is discouraged as it breaks often between Minecraft version changes and cannot be supported by Bukkit or Spigot as they do not create, own, or maintain it.