Giving Books Upon Every Login

Discussion in 'Archived: Plugin Requests' started by ebear, Sep 2, 2013.

  1. Offline

    ebear

    Hey! I was wondering if there was a plugin that can give players books every time they login. I have a custom plugin that clears players inventories multiple times, and I feel it would be good to give players the book every time they login, in case they forget how to play, or the rules, etc. If someone could please let me know if there is a plugin like this, it'd be real cool. What I'm looking for is the plugin used on Minecade's The Walls servers upon player login. It gives them a book with the rules and How to Play. Please let me know what a plugin that does this is!

    I am NOT looking for something that gives players the book upon FIRST login, I'm looking for one that gives books upon EVERY login. Thanks!
     
  2. Offline

    Netox055

    Copy this code:
    Code:java
    1. private ItemStack INFOBOOK() {
    2. ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
    3. BookMeta im = (BookMeta) book.getItemMeta();
    4.  
    5. im.setPages(Arrays.asList("Page 1", "Page 2", "..."));
    6. im.setTitle("TITLE");
    7. im.setAuthor("AUTHOR");
    8. book.setItemMeta(im);
    9. return book;
    10. }
    11. }
    12. @EventHandler
    13. public void onPlayerJoin(PlayerJoinEvent e) {
    14. Player p = e.getPlayer();
    15. PlayerInventory pi = p.getInventory();
    16. pi.clear();
    17. pi.addItem(INFOBOOK);
    18. }

    Sorry for my bad english :)
     
  3. Offline

    ebear

    Urm... Is there a PLUGIN to do this? :}
     
  4. I'll just make it custom for you quick. What do you want each page to say?
     
  5. Online

    timtower Administrator Administrator Moderator

    Config file?
     
  6. Ah, good idea.

    I'll see about doing it over the weekend. If anybody can do it sooner, feel free.
     
  7. Offline

    ebear


    Yeah. That'd be a good idea... Also, you should be able to use a command with a book in hand to set it to the book. Like /lbook save. It would save the contents of the book the player is holding to the book given upon login. There'd be no permissions, an OP thing by default.

    I'm sure this would be useful to TONS of servers!
     
  8. Ok, but I'll make a permission just in case. It'll just take like 5 seconds longer to make, and would be worth it for others xD
     
  9. Offline

    ebear

    When will this be done? I kind of need the plugin :p
     
  10. Offline

    MayoDwarf

    Instead you should make a config for this. Get the ints of Title: and Author: from the config and set those as setAuthor and setTitle.
     

Share This Page