✰ Giving someone a [PREWRITTEN] book on command

Discussion in 'Plugin Development' started by MrWiz, Jan 25, 2013.

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

    MrWiz

    How would I go about making a plugin that gives someone a prewritten book on a defined command; say "/help"
    - Any help is appreciated!
     
  2. Offline

    RainoBoy97

    ItemStack book = new ItemStack(387 ,1);
    BookMeta bm = (BookMeta) book.getItemMeta();
    bm.setTitle("yo");
    bm.setAuthor("MrWiz");
    book.setItemMeta(bm);
    player.getInventory().addItem(book);

    player is your sender/player variable
     
  3. Offline

    MrWiz

    Sorry, I'm kindof a nub at this. Is this how I would give a player a premade book? Like, I want to give a player a book I made in Minecraft when they type /help
     
  4. Offline

    RainoBoy97

    You will need to get the content, save to a file, then make the book onCommand.
    If you want to give a book with your content, only that you didnt make it ingame, this is right, yes
     
  5. Offline

    skore87

    RainoBoy97

    Out of curiosity, have you seen an event for a book being opened/closed and a way to force it to open?
     
  6. Offline

    RainoBoy97

    I dont think you can force-open books, i know you can with inventorys.
     
Thread Status:
Not open for further replies.

Share This Page