WerseMobCounter
A lightweight Minecraft plugin that counts mobs inside
WorldGuard regions and exposes the numbers via
PlaceholderAPI. It also includes a tiny “Actions” engine that can run console commands when a numeric condition (based on placeholders) is met.
Features
Count mobs inside a specific WorldGuard region
Vanilla mobs
MythicMobs (all)
MythicMobs by type (e.g. skeletal_knight)
Clean placeholder format that supports region names with _ or - (no brittle string splits)
Built-in Actions scheduler:
Evaluate a placeholder expression on a fixed tick interval
Run console commands when the condition is true
- Per-action ENABLED toggle
Requirements
Paper/Spigot (1.20–1.21 recommended)
WorldGuard
PlaceholderAPI
MythicMobs (only required for Mythic counts)
Tip: If these are hard requirements for your environment, list them under depend: in plugin.yml. If you want to allow running without some of them, use softdepend: and handle missing features gracefully.
Installation
Drop WerseMobCounter.jar into plugins/.
Restart the server (full restart; avoid /reload).
- Edit config.yml if needed, then restart again.
Placeholders
All placeholders follow:
Code (Text):
%wersemobscounter_<WORLDGUARD_REGION_ID>mobs<variant>%
Variants
%wersemobscounter_<WG_ID>_mobs_total% — total mobs in the region (vanilla + Mythic)
%wersemobscounter_<WG_ID>[I]mobs_vanilla% — vanilla mobs only (non-Mythic)
- %wersemobscounter[/I]<WG_ID>[I]mobs_mythick_total% — all MythicMobs in the region
- %wersemobscounter[/I]<WG_ID>[I]mobs_mythick[/I]<MYTHIC_TYPE_ID>% — MythicMobs of a specific type
Note: The parser treats everything between wersemobscounter_ and [I]mobs[/I] as the region name, so IDs like arena-pvp or town_center work out of the box.
Examples
Code (Text):
%wersemobscounter_spawn_mobs_vanilla%
%wersemobscounter_arena-pvp_mobs_mythick_total%
%wersemobscounter_town_center_mobs_mythick_skeletal_knight%
Quick test
Code (Text):
/papi parse me %wersemobscounter_spawn_mobs_vanilla%
You should see a number (e.g. 0, 2, 7, …).
Actions (conditional console commands)
Define actions in
config.yml. Each action:
has an ENABLED flag,
checks CONDITION every TRY_EVERY ticks,
- runs all COMMANDS_IF_TRUE as console when the condition evaluates to true.
Supported operators
Numeric comparisons:
>,
<,
>=,
<=,
=,
==
Conditions are parsed as:
Code (Text):
<left_numeric_expression> <operator> <number_literal>
where the
left expression can be a PlaceholderAPI string that resolves to a number, e.g.:
Code (Text):
%wersemobscounter_<WG_ID>_mobs_mythick_total% > 0
Example config.yml
Code (Text):
ACTIONS:
"1":
ENABLED: true
CONDITION: "%wersemobscounter_test123_mobs_mythick_total% > 0"
TRY_EVERY: 20 # ticks (20 = ~1 second)
COMMANDS_IF_TRUE:
- "say There is at least 1 Mythic mob in region test123!"
- "say (Triggered by WerseMobCounter)"
"2":
ENABLED: false
CONDITION: "%wersemobscounter_arena_mobs_vanilla% >= 5"
TRY_EVERY: 40
COMMANDS_IF_TRUE:
- "say Region 'arena' has at least 5 vanilla mobs!"
Debugging
Code (Text):
DEBUG_ACTIONS: true
With debugging on, the console will show each evaluation tick:
Code (Text):
[Actions][debug] 1 => TRUE
Troubleshooting
Placeholder always returns 0
Verify the exact WorldGuard region ID (/rg list).
Make sure the region exists in the world you expect.
For Mythic types, confirm the internal type ID in MythicMobs.
Actions do not fire
Ensure ENABLED: true, the condition is numeric and resolves correctly, and TRY_EVERY > 0.
Turn on DEBUG_ACTIONS to see evaluations.
Missing plugin warnings
- Check your startup log. If you used depend:, the server won’t enable WerseMobCounter without the listed dependencies.
Notes
Placeholders are implemented to work without a player context by using onRequest(OfflinePlayer, ...) and requiresPlayer() == false.
Region parsing is robust: the engine looks for the pivot substring [I]mobs[/I] and treats everything before it as the region name.
Enjoy and feel free to tweak the config to your needs!