This plugin records the ownership of every animal you breed and prevents other players from killing them. You can also name your animals (as from v1.3) by right-clicking with a written book. By interfacing optionally to your permissions plugin (see permissions nodes) players can also control which other players can breed from their animals. When you breed an animal this plugin will register your ownership of the animal in its database. Optionally (see config.yml) you will also become the owner of the parent animals (providing nobody else owns them already). By right-clicking an animal you can see who (if anyone) owns it. Critter prevents you from killing or breeding from animals you don't own. As from v1.2 you can also own an unowned animal by branding it (right-clicking with an iron spade). The number of each type of animal you can own is limited by the administrator as is the total number of animals you own.
If you own an animal (or have permission from its owner) you can name it by right-clicking it with a written book. The book's title becomes the animal's name. The written book is replaced automatically by a book and quill so you don't need to craft a new book every time you name an animal.
Without a permissions plugin only the owner of an animal (or an operator) will be able to kill it, breed from it, name it, transfer or remove ownership. If nobody owns an animal any player can kill it or breed from it (this is also the case even if you do have a permissions plugin).
If you want to transfer ownership of your animal to another player you just need to right-click it with a stick (or other item as specified in config.yml). The next player to right-click the animal with a stick gains ownership.
Place the downloaded critter.jar in your plugins folder. Critter has a soft dependency on BukkitPermissions (i.e. will start after BukkitPermissions if registered). After first load of critter you will find Critter_Owners.bin, Critter_Counts.bin, Critter_Names.bin and config.yml in the critter folder.
Because v1.2 introduces maximum ownership numbers for animals it is possible that players using v1.1 have already gained ownership of more animals than they are now allowed in v1.2. The crittercounts command will show the current and maximum allowed number for each animal type e.g. Player rancher1 owns a total of 30 (of max. 20) COWS. All this will mean is that rancher1 won't be allowed to gain ownership of any more cows until he's killed or given away 11 cows.
The intention was to give players the ability to administer the permissions controlling access to their own animals (i.e. the ones above ending in "ownername"). Ideally permissions plugins would have the facility to assign (or delegate) ownership of certain permissions nodes to individual players.
As I couldn’t find any such facility I implemented a solution where the player enters a standard command (critterperm) to specify which other player is to be granted (or denied) permission to perform an action (breed, kill etc). The parameters from this command are then extracted and used to build a permissions-plugin-specific command.
e.g. permissions player setperm playername critter.kill.ownername true - this command would be executed internally if a player ownername issued the command critterperm playername kill true in order to grant player playername permission to kill ownername's animals.
Starting from version 1.1 TNT cannot be detonated if any owned animals are found within a defined radius (the TNT block will blink as normal and then just disappear). A warning is issued when a player places TNT that it might not be allowed to detonate for this reason. Note that TNT detonation will be suppressed even if the only owned animals nearby belong to the player detonating the TNT.
As of v1.2 critter sets metadata with key "critterowner" and a string value of the animal's owning player name for animal entities that have an owner. On server restart it has not been possible to restore the metadata for all owned animals (there doesn't seem to be a way to take the Uniqueid used in critter's hashmap and obtain the matching entity and using the "loop entities" technique to check entities one-by-one seems limited to loaded chunks). As a work-around metadata is updated every time a player interacts with or hits an animal entity. So that critter gets control of any PlayerInteractEntityEvent or EntityDamageByEntityEvent before other plugins that might rely on the critterowner metadata critter now uses priority LOWEST for these types of event handling.