Created
February 20, 2013 02:42
-
-
Save andune/4992336 to your computer and use it in GitHub Desktop.
Log player sleeping in bed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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