Skip to content

Instantly share code, notes, and snippets.

@andune
Created February 20, 2013 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andune/4992336 to your computer and use it in GitHub Desktop.
Save andune/4992336 to your computer and use it in GitHub Desktop.
Log player sleeping in bed
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public class BedLogger extends JavaPlugin implements Listener {
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onBed(PlayerBedEnterEvent event) {
getLogger().info("Player "+event.getPlayer().getName()+" slept in bed at location "+event.getBed().getLocation());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment