@boformerHubJoinEvent is just a example. I want this event to trigger when a player joins the server. When a player joins the server, an announcement will be made to all the players. The player who triggered the event will also recieve a custom welcome message such as:
===
Welcome to the Blockenton City Server
– Type /rules for rules
– Use the compass to select a game
This. It’s extremely pointless to make custom events unless you actually have a valid reason to make them. In this case this isn’t a valid reason and it would be much easier to just used the internal events.
Like I said, HubJoinEvent is complete useless and pointless, because I could just @Subscribe to PlayerJoinEvent. But if I were to create hub jumppads, and create a HubJumppadEvent, how do I run the event when a player enters a jumppad?
I am currently inspecting JavaDocs. The amount of inheritance the confusing, but I will manage. Just a question - What does the @Inject, @Subscribe annotations even do? The SpongeDocs doesn’t seem the purpose of @Inject.
@Inject injects for example a Logger or in this case a Game automatically at the right time for you. I only know these both usecases. @Subscribe is described somewhere in the docs.
@Inject is used for quite a few injections. Logger, PluginContainer, File (ConfigDir), File (DefaultConfig), ServiceManager, etc.
EDIT: @Subscribe just tells Sponge which events you’re going to be listening to when you register the class as an Event handler. Note, that the class which utilizes @Plugin is automatically registered as such.
EDIT2: If you’re familiar with Bukkit’s @EventHandler, you’ll realize that @Subscribe is a fairly similar concept.