Event fired when player enters a bed: PlayerBedEnterEvent
PlayerBedEnterEvent(Player who, Block bed)
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent e) {
Player entered = e.getPlayer();
Block bedEntered = e.getBed();
}
Event fired when player leaves a bed: PlayerBedLeaveEvent
PlayerBedLeaveEvent(Player who, Block bed)
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent e) {
Player entered = e.getPlayer();
Block bedEntered = e.getBed();
}