To pick up an animal, you must crouch and right-click.
To remove an animal from its head, you must crouch and stand.
Considers the protection of the following plugins:
Towny (0.98.4.0 or new)
WorldGuard (7.0.0 or new) (Experimental)
I don't know how regions work in WorldGuard to the end and therefore I couldn't fully check the functionality of the protection, if you find an error - let me know.
How does Towny protection work? Only players who are in the city where these animals are located can move animals. Other options may appear in the future.
How does WorldGuard protection work? You can only move animals in a region where the "carry-on-animals" flag is set.
Permissions: The plugin has three permissions:
carryonanimals.default - default permissions allow animals to be moved.
carryonanimals.bypass - ignore all protections (Towny, WorldGuard)
carryonanimals.admin - to use protections and reload command.
Command This plugin have command /carryonanimals (or just /coa):
help - show help message.
protections - show list of enabled protections.
reload - reload plugin.
Particles and sounds Plugin has particles and sounds support, you can configure this in config.yml file.
Code (YAML):
# Version of plugin, dont change them, it need to updates. version: 2.0
messages: # Enable message that thrown when player try avoid protection or dont have permission. enabled: true
prefix: §6
[CarryOnAnimals
] # Message if player dont have carryonanimals.default permission permission: §cYou cant do this!
# Message if player try to pickup entity that is not in allowed entities list. Empty string - dont send any message invalidEntity: ''
reload: §aPlugin was reloaded!
protections: '§eEnabled protections
: §a'
notEnabledWorld: §cThis world is not enabled!
help: |-
§aHelp: §e/carryonanimals help - §fShow help
§e/carryonanimals reload - §fReload plugin
§e/carryonanimals protections - §fShow enabled protections
# Protections list protections: # Enable or disable all protections enabled: true
# Towny plugin towny:
enabled: true
# Message when player trying to avoid protection message: §cYou cant do this!
# Allow allies to carry on animals allowAlliance: false
# Allow players where in one nation with you to carry on animals allowNation: false
# Only king can carry on animals (Work only if allowNation is enabled) onlyKing: false
# WorldGuard plugin [Experimental] worldguard:
enabled: false
# Message when player trying to avoid protection message: §cYou cant do this!
allowedEntities: - Sheep
- Chicken
- Cow
- Pig
- Wolf
sounds:
onPickUp:
enabled: true
name: BLOCK_ANVIL_BREAK
volume: 4
pitch: 0.5
onPlace:
enabled: true
name: BLOCK_ANVIL_FALL
volume: 4
pitch: 0.5
particles:
enabled: true
type: Cloud
count: 10
# Worlds names where plugin will work worlds: - world
API usage: The API currently has two events that can be tracked:
EntityPickUpEvent This event is called when player try to pickup entity. Methods: getPlayer() -> Player getEntity() -> Entity setCancelled() -> void isCancelled() -> boolean
EntityDropEvent This event is called when player try to drop entity. Methods: getPlayer() -> Player setCancelled() -> void isCancelled() -> boolean
API manager: Methods: registerProtection(Protection protection) -> void
Allow to register your own protection, every protection should be implemented by Protection interface and override methods:
check(Player player, Entity entity) -> bool This methods is called when event check all protections before allow player to pickup entity, if you return true - event was cancelled.
getMessage() -> String Message that was returned if check method return false.
getName() -> String Name of protections, it will show up in the list when admin use command "coa protections".
This documentations will updated in future along with the API.
About icon: I used a simple free icon from the web, if you are an artist and you like the plugin and want to help develop it - you can draw a new icon, if I like it I will change the current one and add you to the plugin page.
Sorry: English is not my native language and I could make some mistakes as I was assisted by an interpreter. If you found mistake - please say me.
Todo:
Add more complexity protection system for towny. (In progress)