Crafting a Book

Portable Hole adds a crafting recipe to allow tunnelling books to be crafted, rather than written directly. There are two main reasons why you might want to do this:

  1. Convenience: you may wish to allow your players a quicker & easy way to create their tunnelling books than getting a book & quill and having to remember the right title to use when signing it.
  2. Making the item more expensive: you can require higher cost items than the default (which is 3 paper, 1 leather, 1 squid ink and 1 feather - pretty cheap).

Configuring

The recipe for crafting books is configurable. The default (from the Configuration) is:

crafting:
  enabled: true
  shaped: true
  recipe:
  - ' E '
  - RBR
  - ' E '
  ingredients:
    E: ENDER_PEARL
    B: BOOK
    R: REDSTONE
  author: ''

This gives a shaped recipe which looks like this:

Crafted Book

  • enabled controls whether or not a recipe is added at all. Default is true to add the recipe.
  • author can be used to define the author of all crafted books. If left blank, it will be the player who crafts the book.
  • shaped is either true for a shaped recipe, or false for a shapeless recipe
  • For shaped recipes, recipe is a list of 1-3 strings, each of which is 1-3 characters. The entries in the ingredients section map the characters which appear in the recipe to a material name.
  • For shapeless recipes, recipe is simply a list of material names. The ingredients section is simply ignored.
  • Valid material names can be taken from http://jd.bukkit.org/apidocs/org/bukkit/Material.html (not case sensitive)

Enforcing Expensive Recipes

While it's easy to make an expensive recipe, it's also easy for players to bypass it by simply writing their own book with the right title ("Portable Hole" by default). So how do you prevent that?

This is where the crafting.author config setting comes in useful, along with Author Validation. Set the author_validation.players and/or author_validation.groups settings to limit whose books can be used to tunnel, then set crafting.author to a player who's allowed to tunnel. Now books which are written by regular players won't be able to tunnel, but books which are crafted will have the right author and will be usable!

(CraftBukkit does not yet have the ability to allow plugins to prevent certain written books being created, but this feature is likely to be added in a future release. Once CraftBukkit supports it, PortableHole will be able to directly enforce crafting of books if so desired)

Example

crafting:
  enabled: true
  shaped: false
  recipe:
  - book
  - ender_pearl
  ingredients:
    E: ENDER_PEARL
    B: BOOK
    R: REDSTONE
  author: 'Notch'

author_validation:
  players: [ ]
  groups: [ Admins ]

The above config sets up a shapeless recipe which requires a book and an Ender pearl anywhere in the crafting grid. All crafted books will be shown as authored by Notch. As long as Notch is in the "Admins" permission group, these books will be usable.


Comments

Posts Quoted:
Reply
Clear All Quotes