Skip to content
GUIpsp edited this page Oct 21, 2012 · 14 revisions

Introduction

This small bukkit plug-ins aims at giving some life to our beloved villagers. The player is now able to specify jobs. Currently available jobs are farmer, butcher, blacksmith and librarian.

Disclaimer : I've chose to only use the bukkit API, not override the server implementation. The actual result is a "passive behavior", or some sort of villager mind parasite. Their movement procedures aren't affected, nor their basic reactions.

Jobs

Farmer

(Note : More complete description/usage at the farmer page).

This kind of villager harvests earth productions, cut trees and put the result in encountered chests.

Blacksmith

(Note : More complete description/usage at the blacksmith page).

This kind of villager smelts everything that can be smelt. It will only use coal/charcoal for this purpose.

Librarian

(note : More complete description/usage at the librarian page).

This kind of villager gets sugar cane from chests and produce books if there's a workbench near. Some kind of mechanism should provide a slow experience aura to nearby players.

Butcher

(note : More complete description/usage at the butcher page).

This kind of villager uses shear to collect wool from sheep. Future implementation will include breeding.

Priest

(note : More complete description/usage at the priest page).

This kind of villager heals nearby villagers and players and set nearby monsters on fire. (Brewing jobs are also planned).

Iron Golem

Just give torches to an Iron golem, and every N seconds, it will evaluate if its current position needs to be enlighten and places the torch.

Configuration

The plugin can be tuned using a config.yml file placed in the plugin dedicated directory. The configuration consists in the following keys:

  • misc : Miscellaneous configuration items.
    • displaynotmanaged : If set to true, the plugin displays a message when one try to interact with a villager that is not managed.
  • scanning : Concerning villager block scanning range.
    • horizontalrange : Number of blocks scanned around the villager.
    • verticalbelow : Number of blocks scanned below the villager.
    • verticalabove : Number of blocks scanned above villager's ground position.
  • librarian : Librarian specific configuration.
    • bookproduction : Time (in miliseconds) to make a book from sugar canes.
  • butcher : Butcher specific configuration.
    • radius : Living entity checking radius in block number.
    • shear : Time in ms between two usage of its shears.
  • timing : Timing related configuration. Important for performances issues.
    • autosave : Number of seconds between two autosave (if world autosave is enabled).
    • listupdate : Number of ticks between two entity list update.
    • entity : Entity related timing.
      • period : Number of server ticks between two entity management attempt.
      • payload : Time (in nanoseconds) allowed to entity management per attempt.
  • blacksmith : Blacksmith specific configuration
    • horizontalrange : Number of blocks scanned around the blacksmith.
    • verticalbelow : Number of blocks scanned below the blacksmith.
    • verticalabove : Number of blocks scanned above blacksmith's ground position.
    • miningcooldown : Time in milliseconds between two usage of blacksmith's mining ability.
    • miningdepth : Number of block a blacksmith can mine below an iron block.
  • priest : Priest specified configuration
    • horizontalrange : Number of blocks scanned around the priest.
    • verticalbelow : Number of blocks scanned below the priest.
    • verticalabove : Number of blocks scanned above priest's ground position.
    • healingcooldown : Number of milliseconds between two healing spell.
    • `burningcooldowǹ : Number of milliseconds between two burning spell.
    • healperdust : Number of heal spell available when the player gives one glowstone dust.
    • ̀ burnperrod̀ : Number of burn spell available when the player gives on blaze rod.
    • radius : Diameter (yeah, not a radius) of the entity checking sphere.
    • check : Number of milliseconds between two entity check.
    • burnpower : Number of ticks a monster will burn when the spell is cast.

Every villagers will be managed, but not necessarily in the same server tick. The job can be sliced to several server ticks.

Permissions

  • usefulvillagers.jobassign.* : Give access to villager job selection.
    • usefulvillagers.jobassign.priest : Give access to priest job selection.
    • usefulvillagers.jobassign.farmer : Give access to farmer job selection.
    • usefulvillagers.jobassign.librarian : Give access to librarian job selection.
    • usefulvillagers.jobassign.butcher : Give access to butcher job selection.
    • usefulvillagers.jobassign.blacksmith : Give access to blacksmith job selection.
    • usefulvillagers.jobassign.miner : Give access to miner (blacksmith sub-task) job selection.
    • usefulvillagers.jobassign.seeder : Give access to seeder (farmer sub-task) job selection.
    • usefulvillagers.jobassign.lumberjack : Give access to lumberjack (farmer sub-task) job selection.
  • usefulvillagers.give : Give access to player donation to villagers.

Dependencies

The plugin needs Gson 2.2.2 to operate. The plugin currently includes it, but if you are having issues, you can try doing it manually.

Installation

A typical craftbukkit installation have a plugins directory. The UsefulVillagers exported jar must be copied in this directory.

Manual GSON Installation

This library can be retrieved here. A good thing is to have a lib sub directory where all the third party libraries jars are stored. Then, the craftbukkit server should be launched using the -Djava.ext.dirs=${ext.dirs}:${craftbukkit_home}/lib argument.

Clone this wiki locally