Critter

Introduction

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.

Naming animals

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.

What if I don't have a permissions plugin?

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).

Transferring ownership

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.

Installation

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.

Upgrading v1.1 to v1.2

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.

config.yml parameters

  • Security.Allow.Cmd1 – template permissions command issued internally when a player enters the critterperm command to give permission. This template should contain the parameter %player which is replaced by the player value entered in the critterperm command and %node which is always replaced internally with a permissions node of the format critter.breed|change|kill|reset.owner where owner is the playername of the player issuing the command. Default permissions player setperm %player %node true (intended to work with BukkitPermissions).
  • Security.Allow.Cmd2 – optional second command (as required by some permissions plugins) to give permission to another player. Default null.
  • Security.Deny.Cmd1 – template permissions command issued internally when a player enters the critterperm command to deny permission. Default permissions player setperm %player %node false
  • Security.Deny.Cmd2 – optional second command (as required by some permissions plugins) to deny permission to another player. Default null.
  • Search.Owner.Radius – When breeding an animal the nearest online player within this radius is assumed to be the owner. Default 16 blocks.
  • Set.Parents.Ownership - Optionally give ownership of previously unowned parent animals to the player when an animal is bred. Default true.
  • Item.Change.Owner – the item used to right-click an animal to begin transfer of ownership. The next player to right-click the animal with this item will gain ownership. Default STICK.
  • Item.Reset.Owner – the item used to right-click an animal in order to reset its ownership information. Default BREAD.
  • TNT.Cancel.Nearanimals - Cancel detonation of TNT when there are owned animals nearby (true|false). Default true.
  • TNT.Cancel.Radius - Nearby animals are those within this radius (in blocks) of the TNT. Default 6.
  • Default.Max.COW - The maximum number of cows a player may own. Default 20.
  • Default.Max.CHICKEN - The maximum number of chickens a player may own. Default 20.
  • Default.Max.MOOSHROOM - The maximum number of mooshrooms a player may own. Default 20.
  • Default.Max.OCELOT - The maximum number of ocelots a player may own. Default 20.
  • Default.Max.PIG - The maximum number of pigs a player may own. Default 20.
  • Default.Max.SHEEP - The maximum number of sheep a player may own. Default 20.
  • Default.Max.WOLF - The maximum number of wolves a player may own. Default 20.
  • Default.Max.OTHER - The maximum number of other animals not in the above list a player may own. Default 20.
  • Default.Max.TOTAL - The maximum number of animals a player may own in total. Default 60.

Commands

  1. critterpurge <playername> - remove all ownership information for a given player. Limted to operators or those with permission to critter.purge.
  2. critterperm <player> <breed|change|kill|name|reset> [true|false] – designed for players to grant (or deny) permission to other players to breed from, change ownership of, kill, name or reset ownership of their animals. E.g. if a player called farmerfred issued the command critterperm cousincarl breed true then the player cousincarl would be able to breed from animals owned by farmerfred. See also More about permissions.
  3. critterreload - operator-only command to reload the critter configuration parameters.
  4. crittercounts <COW|CHICKEN|MOOSHROOM|OCELOT|PIG|SHEEP|WOLF|ALL> [playername] - report the number of each type (or all) animals owned by a player. Only operators can report on other players.

Permissions nodes

  • critter.purge – permission to issue the critterpurge command
  • critter.breed.ownername – permission to breed from an animal owned by the player ownername
  • critter.change.ownername – permission to change ownership (using a STICK) of an animal owned by the player ownername
  • critter.counts - permission to run the crittercounts command
  • critter.kill.ownername – permission to kill an animal owned by the player ownername
  • critter.name.ownername – permission to name an animal owned by the player ownername
  • critter.reset.ownername – permission to reset ownership of an animal owned by the player ownername
  • critter.reload - permission to run the critterreload command

More about permissions

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.

Protection from TNT

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.

Metadata

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.

Download

File Name Status Version Downloads Date
critter v1.3 R CB 1.5.1-R0.1 776 11/05/2013
Critter 1.20.2 Updating 1.20.2 Updating Updating
Critter 1.20.1 Updating 1.20.1 Updating Updating
Critter 1.20 Updating 1.20 Updating Updating
Critter 1.19.2 Updating 1.19.2 Updating Updating
Critter 1.19.1 Updating 1.19.1 Updating Updating
Critter 1.19 Updating 1.19 Updating Updating
Critter 1.18 Updating 1.18 Updating Updating
Critter 1.17.1 Updating 1.17.1 Updating Updating
Critter Forge Updating Forge Updating Updating
Critter Fabric Updating Fabric Updating Updating
Critter
Critter

Dear youtuber!
Have you a channel youtube and want to bring your Video to quality visitors?
Do you want your video to appear on our website?
Do you want to become partner with us?
Just 3 steps to become our partner:
Step 1: Make video review for mods, addons, plugins, ... which you like
Step 2: Upload this video to youtube and our link to your video description
Step 3: Send the youtube video link via message to http://fb.com/9lifehack or leave a comment in the post. We will add your video in the our post, it will help you have more view.
JOIN to get more youtube view with us!!!!

Related Posts

Smarty Productivity Happiness

9LifeHack.com - make things smart