# LayoutOpenEvent > Fired before a layout page opens for a player. `gg.lode.lecternapi.api.event.LayoutOpenEvent` --- ## Signature ```java public class LayoutOpenEvent extends Event implements Cancellable ``` --- ## Notes Cancelling stops the page opening, the packet is never sent and the page's `OPEN` actions do not run. This is the hook for gating a page that opens itself: a page set to open on join can be held back for a player who has not finished a tutorial, without the page needing to know that such a thing exists. --- ## Methods ### getPlayer ```java public Player getPlayer() ``` --- ### getPage ```java public LayoutPage getPage() ``` --- ### isCancelled ```java public boolean isCancelled() ``` --- ### setCancelled ```java public void setCancelled(boolean cancelled) ``` | Parameter | Type | |---|---| | `cancelled` | `boolean` | --- ## Example Hold a page back until a player has finished the tutorial. The page opens itself on join, and knows nothing about tutorials: ```java @EventHandler public void onLayoutOpen(LayoutOpenEvent event) { Player player = event.getPlayer(); if (!event.getPage().getId().equals("welcome")) return; if (tutorial.isFinished(player)) { event.setCancelled(true); } } ``` Cancel and the packet is never sent, so the page's `OPEN` actions do not run either. --- ## Related Pages - [[LayoutCloseEvent]]. The other end - [[ILayoutManager]]. Opening pages yourself