Guide-API

Guide-API

76M Downloads

Suggestion: OnBookOpened event

MineBartekSA opened this issue ยท 1 comments

commented

Like in title i'm suggesting a onBookOpened event to be implemented.

commented

https://streamable.com/wnfza

Accomplished like so:

@SubscribeEvent
public static void onBookOpen(BookEvent.Open event) {
    if (event.getBook() == myBook && event.getPlayer().isSneaking()) {
        event.setCanceledText(new TextComponentString("No snek allowed"));
        event.setCanceled(true);
    }
}