It checks to see if there is a player within 1000m I think it is could even be less - every 45 minutes, if there isn't then it despawns, at least that's what it looks like from the files :)
First off I'd like to say its a brilliant piece of work although I can understand why you'd grow tired. I couldn't help but notice there was a 3.1.0 Patch which was listed on one of your websites which happened to list that the lovely Random appearances of Hats was fixed. Is there any chance you'd be able to share with us what the cause or even the fix is for this. I've got a few theories but I thought I'd try my luck and see if you'd be able to help :) It is a shame you've stopped but nevertheless thanks for all your hard work!