Skip to content

Custom plugin to control villager breeding, feeding and lifespan

AddstarMC/VillagerControl

Repository files navigation

VillagerControl

A Minecraft server plugin for advanced villager management, including breeding control, trading restrictions, retirement mechanics, and custom villager food items.

Purpose

VillagerControl provides fine-grained control over villager behavior to balance gameplay and add realism to your Minecraft server. The plugin introduces:

  • Time-based breeding windows - Limit when villagers can breed to specific time windows
  • Villager retirement system - Villagers retire after a configurable lifespan and stop trading/breeding
  • Custom breeding food - Special "Villager Food" items required for breeding
  • Global toggles - Enable/disable breeding and trading server-wide
  • RealisticSeasons integration - Optionally use RealisticSeasons time instead of vanilla time

Features

Retirement System

Villagers retire after living for a randomized number of days (configurable range: 40-80 days by default). When a villager retires:

  • They receive a fun, randomly-selected name in red (e.g., "Gramps", "Arthritis Archie", "Get Off My Lawn Greg")
  • Their name tag becomes visible above their head
  • They can no longer trade with players
  • They refuse all breeding food (showing angry particles)
  • They die instantly if they gain the weakness effect (prevents zombie conversion exploits)

Retired villager names include:

  • Classic: Gramps, Granny, Grandpa, Grandma, Nana, Papa
  • Funny: Arthritis Archie, Sleepy Joe, Creaky Carl, Denture Dan
  • Grumpy: Yells At Clouds Yvonne, Get Off My Lawn Greg, Back In My Day Bob
  • And many more humorous old-person themed names!

Breeding Control

  • Time Windows: Breeding can be restricted to specific time ranges (default: 13:00-16:00)
  • Custom Food: Villagers require special "Villager Food" items to breed (enchanted bread with custom lore)
  • Global Toggle: Breeding can be enabled/disabled server-wide
  • RealisticSeasons Support: Optionally uses RealisticSeasons time for more realistic day/night cycles

Trading Control

  • Global Toggle: Trading can be enabled/disabled server-wide
  • Retirement Enforcement: Retired villagers cannot be traded with, regardless of global settings

Custom Food System

The plugin introduces "Villager Food" - a special bread item with:

  • Red colored name: "Villager Food"
  • Custom lore: "Feed to Villagers to breed them"
  • Enchantment glint (hidden enchantment for visual effect)
  • Can only be fed to adult villagers
  • Converts to regular bread in villager inventories

Commands

All commands use the base command /villagercontrol or the alias /vc.

Command Description Permission
/vc debug [on|off] Toggle debug mode on/off villagercontrol.debug
/vc givefood <player> [amount] Give Villager Food to a player villagercontrol.givefood
/vc breeding [on|off] Toggle breeding globally or check status villagercontrol.breeding
/vc trading [on|off] Toggle trading globally or check status villagercontrol.trading
/vc villagers [page] List all villagers with age/retirement info villagercontrol.villagers
/vc reload Reload the plugin configuration villagercontrol.reload
/vc info View current configuration settings villagercontrol.info

Command Examples

/vc info                    # View current settings and world times
/vc breeding off            # Disable breeding server-wide
/vc breeding                # Check breeding status
/vc givefood PlayerName 64  # Give 64 Villager Food to a player
/vc villagers               # List all villagers (page 1)
/vc villagers 2             # List villagers (page 2)
/vc reload                  # Reload config after changes

Permissions

Permission Description Default
villagercontrol.debug Toggle debug mode op
villagercontrol.givefood Give Villager Food to players op
villagercontrol.breeding Toggle breeding globally op
villagercontrol.trading Toggle trading globally op
villagercontrol.villagers List villager information op
villagercontrol.reload Reload configuration op
villagercontrol.info View configuration settings op

Configuration

The plugin uses config.yml for settings:

# Enable/disable debug logging
debug: false

# Breeding time window (24-hour format)
breedStartTime: "13:00"
breedEndTime: "16:00"

# Global feature toggles
breedingEnabled: true
tradingEnabled: true

# Retirement age range (in days)
villagerRetirementMin: 40
villagerRetirementMax: 80

# RealisticSeasons world name (if using RS integration)
rsWorldName: "hardcore3"

Configuration Options

  • debug: Enable detailed logging for debugging purposes
  • breedStartTime / breedEndTime: Define the time window when breeding is allowed (24-hour format)
  • breedingEnabled: Global breeding on/off switch
  • tradingEnabled: Global trading on/off switch
  • villagerRetirementMin / villagerRetirementMax: Random range for villager retirement age in days
  • rsWorldName: World name for RealisticSeasons time integration (if RS plugin is installed)

RealisticSeasons Integration

If the RealisticSeasons plugin is installed, VillagerControl will automatically detect it and use RealisticSeasons time for the configured world. This provides:

  • More realistic day/night cycles
  • Consistent time tracking across server restarts
  • Synchronized breeding windows with seasonal time

The integration is automatic - no additional configuration needed beyond installing RealisticSeasons.

Villager Behavior Changes

What Villagers CAN'T Do When Retired

  • Trade with players (shows message: "This villager has retired and no longer trades")
  • Pick up breeding food (bread, carrots, potatoes, beetroot, or Villager Food)
  • Breed with other villagers
  • Be converted to zombie villagers (they die instead)

What Villagers CAN Do When Retired

  • Walk around normally
  • Socialize with other villagers
  • Sleep in beds
  • Show off their funny retirement name!

Breeding Restrictions (Non-retired Villagers)

  • Breeding only works during configured time windows
  • Requires custom "Villager Food" items
  • Baby villagers cannot pick up Villager Food
  • Standard breeding food (bread, carrots, etc.) is blocked when breeding is disabled

Trading Restrictions

  • Can be disabled globally via command
  • Automatically disabled for retired villagers
  • Shows appropriate messages to players when blocked

Crafting Villager Food

Villager Food can be crafted using a special recipe in a crafting table:

Recipe Pattern:

[Flower] [Flower] [Flower]
[Flower] [Bread]  [Flower]
[Flower] [Flower] [Flower]

Requirements:

  • 1 Bread in the center slot
  • 8 different flowers surrounding the bread (one in each surrounding slot)
  • All 8 flowers must be unique - no duplicate flower types allowed
  • Any flowers from the Minecraft flowers tag can be used (e.g., Poppy, Dandelion, Blue Orchid, Allium, etc.)

Output: 1 Villager Food item

Bulk Crafting: The recipe supports shift-clicking to craft multiple items at once, consuming materials in stacks.

Alternative: Admins can also give Villager Food directly to players using /vc givefood <player> [amount].

Debug Mode

When debug mode is enabled (/vc debug on), the plugin logs detailed information about:

  • Villager breeding attempts (successful and blocked)
  • Villager spawns and initialization
  • Item pickup events
  • Trading interactions
  • Retirement events
  • RealisticSeasons time calculations
  • World time and breeding window checks
  • Villager Food crafting events

Debug messages appear in the server console with the [DEBUG] prefix.

Tips for Server Admins

  1. Adjust retirement age based on your server's playstyle - longer for slower servers, shorter for faster-paced gameplay
  2. Use breeding windows to control when players can expand villages (e.g., during daytime only)
  3. Monitor retired villagers - they add flavor but don't contribute to the economy
  4. Control flower availability to regulate Villager Food production, or give it as quest rewards
  5. Enable debug mode temporarily when troubleshooting villager issues
  6. Use /vc villagers to audit your server's villager population and retirement status

About

Custom plugin to control villager breeding, feeding and lifespan

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages