How to fire event when opening book?

Discussion in 'Plugin Development' started by Desle, Jul 13, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Desle

    How do i fire an event when a player opens a signed book? (WRITTEN_BOOK).
     
  2. Offline

    ceoepts

    Interact event with book

    Code:
        @EventHandler
        public void BookEvent(PlayerInteractEvent e){
            if(e.getPlayer().getItemInHand().getType() == Material.BOOK){
                //DO SOMTHING
            }
        }
    Dont just copy paste learn.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  3. Offline

    Fluxty

    md_5
    What is fire event? Why you would want to set fire when he opens book???
     
  4. Offline

    Woobie

    What in the world are you talking about? Why did you tag md_5?
     
    ceoepts likes this.
  5. Offline

    Fluxty

    He says how to fire event? Where is the fire event?
     
  6. Offline

    Woobie

    I'm not sure if you are trying to be funny, but with "fire an event", he means triggering it.. calling an event.
    And before you say anything; no, not calling event, calling an event.
     
  7. Offline

    ceoepts

    Ignore him hes a troll
     
  8. Offline

    Woobie

    I know. I don't mind trolls, they usually just make themselves look stupid. ;)
     
Thread Status:
Not open for further replies.

Share This Page