Description
This plugin allows players to pick up and put down entities if they are using a custom item. Captured entities are persistent through server restarts and retain all of their data, for example, a wolf's owner, or a villager's trades.
Simply spawn in the custom item with the /getcage command, or craft it with the recipe. Right click an entity to pick it up, and right click a block to place the animal back down.
Each cage can have one entity stored within it, however players may have as many cages as they like, so as to store multiple entities.
Cages can be stored in chests and other inventories, but if you lose the cage, you lose the entity.
Admins can choose whether to allow players to capture other players' tamed animals like wolves or cats. By default this is disallowed, but can be changed in the config. Players can always pick up their own tamed animals.
Entities can be excluded by admins based on their name or entity type, meaning they cannot be captured with cages.
Note that if you delete the world where the entity was captured you willl lose the entity.
Commands
true and false arguments should be lower case in all these commands
/getCage - Gives the sender a cage with which to capture an animal.
/excludeName<Name> <true/false> - Exclude an entity from being caught based on its name. True will exclude entities with the name from being caught, false will remove it from the excluded list. Type the command with no arguments to view a list of excluded entity names.
/excludeEntity <EntityType> <true/false> - Exclude an entity from being caught based on its type. True will exclude entities of the type from being caught, false will remove it from the excluded list. Type the command with no arguments to view a list of excluded entity types. See below a list of entity types in the correct formatting
EntityTypes
AXOLOTL,BAT,BEE,BLAZE,CAT,CAVE_SPIDER,CHICKEN,COD,COW,CREEPER,DOLPHIN,DONKEY,DROWNED,ELDER_GUARDIAN,ENDER_DRAGON,ENDERMAN,ENDERMITE,EVOKER,FOX,GHAST,GIANT,GLOW_SQUID,GOAT,GUARDIAN,HOGLIN,HORSE,HUSK,ILLUSIONER,IRON_GOLEM,LLAMA,MAGMA_CUBE,MULE,MUSHROOM_COW,OCELOT,PANDA,PARROT,PHANTOM,PIG,PIGLIN,PIG,LIN_BRUTE,PILLAGER,POLAR_BEAR,PUFFERFISH,RABBIT,RAVAGER,SALMON,SHEEP,SHULKER,SILVERFISH,SKELETON,SKELETON_HORSE,SLIME,SNOWMAN,SPIDER,SQUID,STRAY,STRIDER,TRADER_LLAMA,TROPICAL_FISH,TURTLE,VEX,VILLAGER,VINDICATOR,WANDERING_TRADER,WITCH,WITHER,WITHER_SKELETON,WOLF,ZOGLIN,ZOMBIE,ZOMBIE_HORSE,ZOMBIE_VILLAGER,ZOMBIFIED_PIGLIN
Permissions
entitycages.getcage- Permission for using the /getCage command, give players this permission to allow them to use the command. Please look at allowAllGetCageCommand under the config section for more information about permissions for this command.
entitycages.exclude - Permission for using the /excludeName and /excludeEntity commands.
entitycages.use - Permission for using cages, give players this permission to allow them to capture and place animals with cages. Please look at allowAllUseCage under the config section for more information about permissions for this command.
Crafting Recipes
8 Iron Bars placed in a square in the crafting table will craft a cage. This can be enabled and disabled in the config.
Config
allowCaptureTamedAnimals: <true/false> - This defines whether players are allowed to capture other players' tamed animals. This will be false by default, meaning players cannot do this. Changing this to true will allow players to capture other players' tamed animals.
allowCageCrafting<true/false> - This defines whether or not cages can be crafted. This is true by default, meaning cages can be crafted.
allowAllGetCageCommand - This overrides the permission for /getCage, if set to true anyone can use the command regardless of their permissions. This is false by default.
allowAllUseCage - This overrides the permission for using cages, if set to true anyone can use cages regardless of their permissions. This is true by default.
prefix - The prefix for all chat messages sent by the plugin, this includes the colour of the prefix
chatColor - The colour of all chat messages sent by the plugin
loreColor - The colour of the entity information in the lore of the cage holding the animal
emptyCageLore - The description of empty cage items
capturedCageLore - The description of cage items with captured entities
cageTitle - The display name of the cage item.
excludedEntities - Avoid editing this and use the provided command.
excludedNames - Avoid editing this and use the provided command.
Editing the config should be done while the server is offline. Please do not use the /restart command as it can cause issues.
Images
If you have any feedback on the plugin or any suggestions please let me know, criticism is always welcome.