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!
@Brettflan Brettflan. I apologize for leaving this hanging, I was taking a break from MC.
The 'Unknown' happens about 50% of the time from enderman deaths. I can surely live with this. Thank you very much for looking into it previously.
@DoctorBoyd
That might be possible. Quick question: is is consistent between all deaths by enderman, or does it only happen sometimes when an enderman kill someone?
I tested it below by simply using /spawnmob (from Essentials) to add a bunch of endermen and then getting them to kill me.
@Brettflan
Thanks for checking. If you're not seeing how it would give an unknown then would it be right to think it's another plugin we're using? We use one right now that increases mob hit damage. Would it be possible that it's affecting the server events output?
@DoctorBoyd
I've tested it myself and it handled death by enderman properly for me:
I checked through the relevant code and I don't see any way it could end up as "unknown" with it having the indicated death cause and damager. Very strange.
Can you post your full server startup log so I can see if anything pops out at me there?
EDIT: also maybe a copy of the contents of your server_events.xml file. It shouldn't be able to cause that, but it's worth looking at. You can send this info via PM if you don't want to post it publicly.
@DoctorBoyd
Thanks for the report, I'll see about fixing that when I have time.
@Brettflan
A player killed by an enderman today gave an unknown death cause.
http://pastebin.com/DTSPs4mK
Using Recommend CB 1.4.7 and ServerEvents 1.5.2
Version 1.5.2 is released.
This is just to fix that one ClassNotFoundException error for CraftSkeleton in newer CraftBukkit releases.
@DoctorBoyd
Thanks for the report. I'll look into updating it soonish when I have time.
Are there any dev builds available that would support the 1.4.7 beta?
This comes up when a player is killed by a skeletons arrow. http://pastebin.com/cez1hSMt
tested SE v1.5.1 using CB 1.4.7 #2602
@grid21
I never really touched the existing default messages since I took over maintaining the plugin. I've only added on death messages as new ways to die have been added to the game; basically from "starvation" near the bottom of the list down to the end (currently "lightning").
Back when I ran my own server I used a very trimmed down, streamlined, and modified list of just 2-3 of each type of death message, and none of the other various message types.
So... yeah, feel free. If you want to clean the messages up, I'll update the default config with them.
You have so many spelling errors I had to have Microsoft word correct them. Can I send you the corrected XML file and you can recode it back into the plugin?
@DoctorBoyd
It's certainly very possible. If you can find anything in particular which triggers an "unknown cause" death, please let me know.
Could ServerEvents accidentally display a mob kill as 'unknown' instead of the creature's name?
I'm hoping yes because a player thinks he's being killed by an invisible hacker after dying and reading the twitter announcements.
I see he's died by all kinds of mobs and two unknowns. Others have died by unknown but he's the only one reporting the unknown deaths as being unfair.
Does anyone have any insight into unknown deaths?
I'm using CB 1.4.5 R0.2beta #2488 and server events 1.5.1
Thanks.
@flyinggoatman
Try opening the file in a competent viewer, not Windows Notepad.
Notepad++
is an excellent text editor, for example.Edit: to clarify, it doesn't properly handle line endings from Linux/Unix or MacOS.
there is one problem i seem to have, the config is very hard to navigate and change, add or remove messages. can i know what your plans are towards this slight but quite major problem when it comes to usability and customization?
Vote:
8/10
Reason for loss of vote:
difficulties to customization and navigation
Picture of config (click for fullsize)
Version 1.5.1 is released.
Existing users might want to copy over the new default messages from the file changelog.
@Brettflan
Awesome! Great plugin.
I'll be looking to update this to support the new mobs and such hopefully some time in the next couple of weeks as time permits.
I would love to have more of these hilarious messages!!! Preferably ones that include more that just the player's name... Their in-hand-item, IP and other stuff seem to be mostly unused.
If anyone could direct me to more messages to plonk into the .xml file i'd be grateful!
Plugin still works great. Thank you.