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!
@Blockey13
This should be the relevant info from your stack trace, particularly the last line:
I can't seem to get this to work with twitter. I'm running the latest version and have added the updated twitter4j-core. When I run /serverevents register console spits out:
@Brettflan
Thx much.
Version 1.5.4 is now uploaded to fix Twitter integration. Note that it will also provide a download link for an updated twitter4j lib which you will also need.
It will be downloadable as soon as the BukkitDev team have time to review and approve the file.
EDIT:
@Chadwiko
Somebody else (or it might have been you) was asking about IRC integration earlier. I don't have the time or desire to look into it, but the source for this plugin is available on GitHub. Another dev is welcome to implement it and submit it as a pull request.
Confirm Twitter no longer working for us as well.
Also, we'd really really like it if the Server Events player-death messages were picked up by our IRC bot, but we don't know how to make this so.
Brettflan, your assistance with that would be very very appreciated. :)
@Brettflan
Hi, my apologies, yes i was ott in my last comment. I have been looking around and ... http://twitter4j.org/en/versions.html - they have an api 1.1v compatible version but says projects need rebuilt to be migrated to twitter4j 3.0.x. - which is beyond my capabilities I'm afraid. I'm still learning with Eclipse software.
@whbski2
Awfully accusatory there, but thanks for the useful heads up. I'm the sole maintainer of the plugin but not the original author, and the Twitter functionality is something I only check on based on problem reports or simple requests. Thus I have never even looked at Twitter's dev info newsfeed, and you're the first to bring this API change up.
I'll see about updating it this weekend when I'm back home. I'm out of town and on my tablet so I can't update it now.
Hi so not too happy about this whoevers fault it is for not keeping up with twitter dev, I've been using this plugin for months, been great. Apart from the fact the twitter api v1 was retired today and so the plugin won't tweet any longer. The worst part of this is - Twitter have been planning this and doing tests and NOT hiding the fact for the last 6 months, they have been warning everyone to update their stuff in time for June 11th 2013. SO why has this plugin and/or twitter4j not been prepared for use with twitter api v1.1... https://dev.twitter.com/blog/api-v1-is-retired
@therage500
Post the errors with full stack traces.
Hmm I can't seem to get this to work at all, lots of errors? Can someone help thank you. ( Using bukkit mc version 1.5.2 )
@Chadwiko
As per the name, the random messages are randomized. You have to have enabled="true" for that section to be enabled at all; if it isn't enabled you won't see any of the messages under it.
The only way for it to not really be random would be to have only a single message listed in there.
Thanks for the update BrettFlan! Works a treat.
Weird bug i've been having, even before the update;
My 'messages to be displayed randomly' aren't working.
Here's the setup;
<!
Messages to be displayed randomly. Default delay is 30 minutes (30min*60sec*1000mili)> <random enabled="false" file="false" chat="true" twitter="false" database="true" delay="700000">So basically I want the messages that i've configured after this to display semi-regularly in the server. It's just stuff like "thanks for playing, check the website" and "if you like the server, tell your friends". etc.
I didn't want it to cycle randomly through them. Rather I was hoping they'd go through sequentially then loop.
Not the case?
@kamcio96
Interesting. Since you know how, can you point me in the right direction, then? Does CraftBukkit have it bundled in or something?
I haven't done a whole lot with the MySQL code beyond the work done by the original author.
Why you use mysql connector? You can use MySQL without it. ;)
@Chadwiko
1. Are those standard renamed items where the name is stored in the item's metadata where Bukkit can see it? Probably so, in which case it should definitely be possible. In fact, I'll make a quick release shortly which should hopefully handle that.
2. While I'm sure it's possible via the use of an IRC java lib similar to the one this plugin uses for Twitter, I don't have the time or interest to implement it. The plugin's source is on GitHub though and another dev is more than welcome to work on adding IRC support.
Hey there mate,
Love this plugin - it's added a great element to my new HCSMP deathban server, with deaths being reposted to my twitter.com/aushcsmp account.
Couple of questions/suggestions for you;
1) Is it somehow possible to make the %killer_item to read renamed items from an Anvil? IE if someone has a diamond sword that they have renamed to "The Destroyer" or something, it would be great if the serverevents death messages reflected that name. 2) Is it possible to add some kind of IRC integration, so the server-event messages get broadcast to an IRC channel? I am currently using SimpleIRC for our server and it's working great, but all we get in the IRC channel is the 'player has left the game' message after they are deathbanned for 3 hours. Would be great if we could figure out a way to get those death messages showing up in IRC automatically.
Thanks brett!
@Chadwiko
I'm betting you just got the first part of the link. It's long enough to wrap over to 2 lines on the Minecraft client, so if you just crtl+click on the link there in the client you'll only get part of the link and it won't work. Hopefully the Minecraft devs will fix that eventually.
Your best bet is to copy the full link from the server log or the text file which it outputs to.
Trying to do /serverevents register and Twitter gives me this message:
The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.
Help :)
@GodsDead
Wow, I need to update the installation notes. I thought I'd already done that. Anyway, see here:
http://dev.bukkit.org/server-mods/serverevents/pages/changelog/#w-http-dev-bukkit-org-server-mods-serverevents-files-3
/serverevents register is what you're after.
I can't run commands on my shared minecraft server plan, so I can't complete No 4 "To enable Twitter, run java -jar ServerEvents.jar from the command line."
Is there a command in-game to run? Or a command from the server console? Or even a config file?!