ServerEvents
Note: the original plugin and almost all of the work done on it is by croemmich. He doesn't have the time to work it any more, so he's allowed me to maintain it.
ServerEvents prints customizable messages to chat, Twitter, a database, or to a file. See the configuration file below for a better idea of what the plugin does.
If you appreciate this plugin, you are welcome to .
Installation
- Download mysql-connector-java-bin.jar and twitter4j-core.jar and place them in the root server directory.
- Download ServerEvents.jar and place it in the plugin directory.
- Start the Minecraft server to generate the configuration file.
- To enable output to Twitter, run the command /serverevents register (requires permission serverevents.register) and follow the directions it gives. It can be run from server console or in-game. Alternately, if for whatever reason you don't want to use the command, you can use the old method of running "java -jar ServerEvents.jar" from the command line.
- Edit server_events.xml to your liking.
- Restart the server, or use the command /serverevents reload (requires permission serverevents.reload) to make the plugin re-load any changes you've made to server_events.xml.
Developer API
ServerEvents now has a developer API that allows developers to add, remove, and trigger messages. Currently there is not built in support for custom message types, however you can implement that on your own.
Implementation
Add ServerEvents.jar to your build path. In Eclipse -> Add External Jar
Place the following in your plugin's onEnable().
Plugin serverevents = this.getServer().getPluginManager().getPlugin("ServerEvents"); if (serverevents != null) { if (!serverevents.isEnabled()) { getServer().getPluginManager().enablePlugin(serverevents); } } else { log.info("ServerEvents plugin not installed. Disabling plugin."); this.getServer().getPluginManager().disablePlugin(this); }
Then simply make API calls anywhere in your code.
/* Add/Remove Messages */ ServerEvents.addMessage(Messages.Type.RANDOM, "Hello World!"); ServerEvents.removeMessage(Messages.Type.RANDOM, "Hello World!"); /* Add a message with parameters */ HashMap<String, String> params = new HashMap<String, String>(); params.put("cmd", "/i 1 64"); params.put("full", "true"); ServerEvents.addMessage(Messages.Type.COMMAND, "%n used the command: %cmd", params); /* Display a message right now. */ ServerEvents.displayMessage("Hello World!");
Source - https://github.com/Brettflan/ServerEvents
For old discussion of this mod, you can head over to the main Bukkit forum:
http://forums.bukkit.org/threads/1796/
Thanks to mrgreaper for the idea and messages!
Copied from the forum thread:
Feel like testing out a dev build with that option? The new option defaults to "false", not adding the timestamp. Let me know if it works for you, and if you have time for it, test enabling it in your config (by adding add_timestamp="true" to the twitter setting) to see if that adds the timestamp back like it should.
http://wimbli.com/minecraft/ServerEvents/ServerEvents_1.4.2_dev.zip
If it works as intended, I'll push it out as a public release.
@HmmmQuestionMark Agreed! Twitter has it's own time-stamping. Having the mod post a time is kind of redundant.
I would love if we had the option to remove the time-stamp.
4. To enable Twitter, run java -jar ServerEvents.jar from the command line.
Does this mean there needs to be another process running outside of the bukkit server?
Do you have to do his every time the server gets restarted/rebooted?
You usually can't do this on hosted servers - solution?