CarryOnAnimals [1.16+, API, Towny/WorldGuard support] icon

CarryOnAnimals [1.16+, API, Towny/WorldGuard support] -----

Adds the ability to move entities on the head.



Adds the ability to move animals (or another entities if you enabled it) on the head.

Please do not report bugs/errors in reviews. Report in https://github.com/KalbinVV/CarryOnAnimals.

Screenshot:
https://imgur.com/a/NUJsSdJ

How it works?
  1. To pick up an animal, you must crouch and right-click.
  2. To remove an animal from its head, you must crouch and stand.
Considers the protection of the following plugins:
  1. Towny (0.98.4.0 or new)
  2. 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:
  1. carryonanimals.default - default permissions allow animals to be moved.
  2. carryonanimals.bypass - ignore all protections (Towny, WorldGuard)
  3. carryonanimals.admin - to use protections and reload command.

Command
This plugin have command /carryonanimals (or just /coa):
  1. help - show help message.
  2. protections - show list of enabled protections.
  3. 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:
  1. EntityPickUpEvent
    This event is called when player try to pickup entity.
    Methods:
    getPlayer() -> Player
    getEntity() -> Entity
    setCancelled() -> void
    isCancelled() -> boolean
  2. 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:
  1. 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.
  2. getMessage() -> String
    Message that was returned if check method return false.
  3. 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:
  1. Add more complexity protection system for towny. (In progress)
  2. Make logging system.
If you have more idea - please let me know. [​IMG]
Resource Information
Author:
----------
Total Downloads: 921
First Release: Jan 3, 2023
Last Update: Jul 15, 2023
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings