HomeJavaModsWerseMobCounter
WerseMobCounter
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

Requirements

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

  1. Drop WerseMobCounter.jar into plugins/.
    Restart the server (full restart; avoid /reload).
  2. Edit config.yml if needed, then restart again.


Placeholders

All placeholders follow:
Code (Text):

%wersemobscounter_<WORLDGUARD_REGION_ID>mobs<variant>%
 
Variants

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:

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

Notes

Enjoy and feel free to tweak the config to your needs!

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

WerseMobCounter is a free Minecraft Java mod. Compatible with Minecraft 1.20.6, 1.21. Downloaded 9 times (via Spigot). Download it and open it directly in the game.

Explore more