Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Would love to be able to get a Growl notification when a user logs in to my (locally hosted) Minecraft server.

I took a peek in the Console but it doesn't seem to record the logins, although my server GUI shows activity on the server including logins.

It runs within Java, so maybe that's the issue with it not showing up in the Console, although some of my actions do seem to get recorded, but those seem related to the main Minecraft app and not the server.

Even if I could find the logs, I am at a loss as to how one sets up a Growl notification, although I assume it has to do with growlNotify: http://growl.info/extras.php#growlnotify

share|improve this question
    
I think this is more of a minecraft question than an OS X question. You are correct in using growlnotify but you need to be able to get information out of minecraft to use this. –  Digitalchild Aug 4 '11 at 0:15
    
Does the minecraft server produce a log file on disk any place? Is there a setting to override where/how that logging is done? –  Ian C. Aug 4 '11 at 1:01
    
Lyken - I see this as more of a Mac/Growl question than specifically a Minecraft question, since it's more about using Growl for Mac events. It just happens to be related to Minecraft as well. –  George C Aug 5 '11 at 4:37
    
Ian C - as patrix mentioned below, there is a log file located here: /Users/George/Documents/MinecraftServerSettings/server/server.log –  George C Aug 5 '11 at 4:38
add comment

1 Answer 1

up vote 4 down vote accepted

The minecraft server writes a log file into the directory minecraft_server.jar is installed in. From there you can use something like

tail -f server.log | 
  while read m_date m_time m_type m_user m_ip m_action m_rest; do
    if [[ $m_action == logged ]]; then
      growlnotify -n Minecraft -m "$m_user logged in at $m_date $m_time" Minecraft;
    fi
  done

Starting this automatically together with your Minecraft server is possible but depends on the way you do start it.

To install this (without going too deep into Unix territory, ask an expert if it fails):

  • open Terminal.app
  • change to the directory where minecraft_server.jar is installed by typing cd followed by drag&dropping the folder with the server into the terminal window followed by return
  • nano mc2growl
  • write #!/bin/bash and press return (twice)
  • paste the code from above
  • press ^X and say Y at the prompt
  • chmod +x mc2growl
  • ./mc2growl &
share|improve this answer
    
Patrix — thanks! How do I go about using the code you provided? I'm a bit of a dabbler when it comes to this stuff, but it's over my head a bit. Trying to learn. –  George C Aug 5 '11 at 4:17
    
Oh, and I am using OSX SMP SERVER GUI to launch the server: minecraftforum.net/topic/… –  George C Aug 5 '11 at 4:25
    
George, I've extended the answer to cover your questions (hopefully). In your case, you have to change to directory /Users/George/Documents/MinecraftServerSettings/server in step 2. –  patrix Aug 5 '11 at 10:48
    
Patrix — sorry I am not receiving email notifications for replies. However, I followed your instructions and it worked perfectly! Thanks so much. I have to say however that this is entirely beyond my experience. Again — thank you! –  George C Aug 9 '11 at 2:11
1  
just repeat the second step (change of directory) and the last one after reboot –  patrix Aug 14 '11 at 13:03
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.