(Moderation Edit) ** PLEASE NOTE: **
This guide is no longer updated and therefore lacking new information plus may contain (now) false information. Please head over to the SpongeDocs to get the latest information including updates.
This tutorial is not complete yet and since the project isn’t even fully developed anything and everything in this document is subject to change. As the project develops this tutorial will most likely expand as I add in more details once they are decided upon and I learn how everything works.
Introduction
So, you’ve heard about this new project, Sponge, which looks like the savior to the Minecraft plugin community. You hurry to rush and port your plugins over, yet everything seems new and unfamiliar. You’re right! It is new, brand new, so new you can’t download it yet. With that in mind, here’s your first tip:
Tip #1: This isn’t Bukkit
Yup, that’s right, it isn’t, there may be some things that may look similar, but you need to remember: This isn’t Bukkit, don’t whine and complain when things don’t work exactly like they did in Bukkit.
Where is the plugin.yml File?
There isn’t one (yet)! Instead you put a line like this before your class declaration:
@Plugin(id = "PluginID", name = "Human Friendly Name", version="Version Number")
Here’s an example:
@Plugin(id = "MultiInv", name = "MultiInv", version="3.1.8")
public class MultiInv {
onEnable() and onDisable(), Where are They?
Ah, the famous onEnable and onDisable. They aren’t there! Instead they are replaced by a series of events. If you’ve ever made a mod for Forge, they should sound familiar to you. Here’s how you declare them:
@SpongeEventHandler
public void onDisable(ServerStoppingEvent event) {}
Here’s the list of events for your reference:
- ServerAboutToStartEvent
- ServerStartingEvent
- ServerStartedEvent
- ServerStoppingEvent
- ServerStoppedEvent
How Will Commands Be Handled?
Useful Links
- Official SpongeAPI Git Repo
- Tux2’s Builds of the SpongeAPI (Will be replaced by the official link when it becomes available)