FarmGuard
Surgical anti-grinder protection for your survival server
[HR][/HR]
The problem
XP farms wreck the economy of survival servers. Players build enderman towers, zombie/villager grinders, and spawner
farms that hand out infinite XP and loot, killing the value of mining, exploration and combat. Most "anti-farm"
plugins solve this with a sledgehammer — flat mob caps that also break legitimate gameplay.
How FarmGuard works
FarmGuard combines
three independent, configurable mechanisms that target what farms actually need to function.
Any of them alone breaks the majority of grinders; together they make XP farms effectively impossible without
affecting normal play.
- Per-chunk hostile mob cap — global cap and per-type caps (zombies, skeletons, endermen, creepers, blazes,
witches, ravagers, shulkers and more). Only the spawn reasons you choose count toward the cap (NATURAL, SPAWNER,
RAID…).
- Non-player-kill XP suppression — the silver bullet. If the mob dies from fall damage, suffocation, lava,
drowning or any non-player source, its XP drop is multiplied by your configured factor (default 0.0). This
single feature breaks almost every classic XP farm without touching sword combat.
- Spawner XP cancellation — mobs spawned from mob spawners or trial spawners drop zero XP regardless of how
they die. Dungeon spawner farms become useless.
A fourth safety net — a
death-rate limiter per chunk — kicks in if too many mobs die in the same chunk in a
short window, suppressing XP even if the first three layers are bypassed.
What it blocks vs. what it allows
| Blocks |
Allows |
| Enderman End-platform farms |
Killing endermen at your portal with a sword |
| Zombie/skeleton drop-shaft grinders |
Fighting mobs in caves and mob-heavy biomes |
| Iron-golem-bait farms (XP side) |
Iron golem farming (drops untouched by default) |
| Spawner XP farms |
Animal/passive farms (cows, chickens, pigs) |
| Creeper grinders |
Villager trading and XP from smelting/mining |
| Anything where the player isn't the killer |
Bypass permission for trusted players |
Features
- Configurable per-type chunk caps (every hostile mob covered)
- Per-spawn-reason filtering (cap only NATURAL or include RAID, PATROL, SPAWNER, TRIAL_SPAWNER…)
- Non-player-kill XP multiplier (0.0 to 1.0)
- Spawner XP cancellation (toggle)
- Optional drop suppression (off by default, only XP affected)
- Death-rate limiter per chunk with configurable window
- Per-world disable list
- Dry-run mode — log what would be cancelled without enforcing, perfect for tuning limits before going live
- Verbose console logging with exact coordinates and chunk position
- Per-chunk metrics visible with /fg stats — see exactly which chunks players are abusing
- farmguard.bypass permission for staff/VIPs
- Live config reload, no server restart needed
Console output example
Code (Text):
[FarmGuard] BLOCKED ZOMBIE spawn (NATURAL) in world at (123,64,-456) chunk(7,-29) — type cap ZOMBIE 4/4
[FarmGuard] ADJUSTED XP for SKELETON in world at (200,12,-30) chunk(12,-2) — 5 → 0 (x0.00) [no-player-killer x0.0]
killer=<none>
[FarmGuard] [dry-run] WOULD CANCEL ENDERMAN spawn (NATURAL) in world_the_end at (-15,68,210) chunk(-1,13) — type cap
ENDERMAN 3/3
/fg stats output
Code (Text):
=== FarmGuard stats (top 10 of 47 tracked chunks) ===
world @ chunk(7,-29) ~(112,?,-464) | blocked: 38 | xp suppressed: 12 | deaths: 19
world @ chunk(12,-2) ~(192,?,-32) | blocked: 0 | xp suppressed: 47 | deaths: 50
world_the_end @ chunk(-1,13) ~(-16,?,208) | blocked: 24 | xp suppressed: 0 | deaths: 0
At a glance you can see
exactly where players are trying to build farms.
Commands
- /farmguard reload — reload config
- /farmguard stats — top 10 most-blocked chunks
- /farmguard stats reset — clear metrics
- /farmguard dryrun [on|off] — toggle dry-run live
- Alias: /fg
Permissions
- farmguard.admin — access to commands (default: op)
- farmguard.bypass — ignore XP/drop restrictions on player kills (default: op)
Configuration preview
Code (Text):
chunk-limit:
enabled: true
max-hostile-per-chunk: 8
per-type:
ZOMBIE: 4
ENDERMAN: 3
CREEPER: 4
# ...all hostile mobs covered
count-spawn-reasons: [NATURAL, SPAWNER, RAID, PATROL, TRIAL_SPAWNER, ...]
xp-control:
enabled: true
non-player-kill-multiplier: 0.0 # 0 = no XP, 1 = full XP
cancel-spawner-xp: true
affect-item-drops: false
death-rate-limit:
enabled: true
max-kills-per-window: 20
window-seconds: 30
logging:
verbose: true
dry-run: false
metrics:
enabled: true
max-tracked-chunks: 200
Compatibility
- Spigot / Paper / Purpur
- Minecraft 1.20.x – 1.21.x
- Java 17+
- No external dependencies
- Zero-overhead when listeners aren't triggered (event-driven, no scheduled tasks)
Installation
- Drop FarmGuard.jar into your plugins/ folder
- Start the server (config is auto-generated)
- Edit plugins/FarmGuard/config.yml to your taste
- Recommended: enable dry-run for the first 24h, run /fg stats, adjust limits,
then disable dry-run
FAQ
Q: Will this break iron farms?
A: No, iron golems aren't hostile mobs. Item drops are also untouched by default — only XP is affected.
Q: Will this break my mob arena / PvE plugin?
A: Add the arena's world to
disabled-worlds, or give participants the
farmguard.bypass
permission.
Q: My natural exploration feels too quiet now.
A: Raise
max-hostile-per-chunk (default 8) or remove
NATURAL from
count-spawn-reasons — the XP-side defenses still work.
Q: Can players still farm XP from a sword grinder?
A: Yes — that's the point. Real combat XP is preserved. FarmGuard only kills the AFK / fall-damage-style farms.
Q: Performance impact?
A: Negligible. Two event listeners, no repeating tasks, O(chunk-entities) on spawn checks.
Found a bug or have a feature request? Open an issue or leave a review.