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!
Copy this code: Code:java private ItemStack INFOBOOK() { ItemStack book = new ItemStack(Material.WRITTEN_BOOK); BookMeta im = (BookMeta) book.getItemMeta(); im.setPages(Arrays.asList("Page 1", "Page 2", "...")); im.setTitle("TITLE"); im.setAuthor("AUTHOR"); book.setItemMeta(im); return book; }}@EventHandler public void onPlayerJoin(PlayerJoinEvent e) { Player p = e.getPlayer(); PlayerInventory pi = p.getInventory(); pi.clear(); pi.addItem(INFOBOOK);} Sorry for my bad english
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!
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
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.