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!
@GodsDead
You can use it as long as you have a way to get to and edit the configuration files, and a way to upload extra jar files into your root CraftBukkit folder for the Twitter and MySQL functionality.
I haven't tested it thoroughly in 1.7.2, but from what I've seen the latest release version is working fine.
It doesn't use a lot of resources.
Will I be albe to use this on a shared hosting account?
Will it work with 1.7.2+?
Does this use many resources? I have a very small server package.
Very nice plugin!
@Brettflan Thank you very much !
@Demy37
Looks like all that's needed is to update the Twitter lib. You can download the updated version (3.0.5 over the old 3.0.3) in the same place:
http://wimbli.com/minecraft/ServerEvents/twitter4j-core.jar
Just overwrite your existing copy of the file.
ServerEvents Twitter: Server returned HTTP response code: 403 for URL: http://api.twitter.com/1.1/statuses/update.json
Could you fix it ? I think it is because Twitter don't accept HTTP request... Now it is HTTPS.
@Maximvdw
There isn't, sorry.
Is there a way to detect if a player killed a mob? F.ex I want to post whenever a player kills the enderdragon
@rob5300
You're using the old Twitter lib. Actually I just noticed I hadn't updated the twitter lib linked in the installation instructions (just in the release notes), so you probably got it there. I've updated that now. Download it again to get the new version of twitter4j-core.jar and it will work.
I get this error in the console, may be of help! 07.07 12:58:57 [Server] INFO {"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
I added the twitter information to the XML file and it doesn't seem to be sending the tweets to the account :(
It should (disclaimer: haven't tested it yet), but since they've updated the entity damage events and deprecated the provided damage value, I plan to release an update to address that and future-proof it.
EDIT:
Brief testing indicates it still works fine.
Can anyone confirm this works with 1.6?
@whbski2
Good to hear about your problem and what worked for you to fix it, that could be helpful for others who might run into the same thing.
Hi, after the twitter related API updates, I was still having an issue getting tweets over to twitter. However, I just solved my issue. I completely revoked serverevents access on my twitter account and then followed your instructions again above to re-add it - all good now. Our server is now pumping out your fabulous messages to our twitter again. Great plugin.
I just deleted the config too and couldn't do it. Wish I could figure this out :( Guess I'll let you know if I come up with anything new
@Blockey13
I just now removed my config so it could be recreated and ran back through the process to make sure there are no problems. It worked fine. Server console log (tokens altered slightly):
How did you go about it?
Did you just install it, then run /serverevents register with a fresh twitter account?
@Blockey13
I don't know, really... the Twitter functionality has worked fine for me and I don't know of any cause beyond what your error message indicates. Anyone else have similar problems?
I've tried manually creating a token through twitter dev, but thought the /serverevents register was supposed to sort all that out?
I've tried every combination of access token & secret per the tokens I've created via twitter dev. I've given it full read & write but still nothing.
Then I tried revoking access rights per the console line, but that still didn't work.
It does say the system clock may not be in sync but I'm not sure what the implication of that is...
Just not sure what I'm doing wrong?