玩家床活動

玩家進入床位時發生的事件: PlayerBedEnterEvent

PlayerBedEnterEvent(玩家,阻攔床)

@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent e) {
    Player entered = e.getPlayer();

   Block bedEntered = e.getBed();
}

玩家離開床時發生的事件: PlayerBedLeaveEvent

PlayerBedLeaveEvent(玩家,阻攔床)

@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent e) {
    Player entered = e.getPlayer();

   Block bedEntered = e.getBed();
}