玩家床活动

玩家进入床位时发生的事件: 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();
}