This is a port of the original 1.12.2 CMT mod by ZeithComms (and me).
A lightweight, server-side mod that lets modpack makers and server owners configure any mob to target and attack any other living entity; including players, passive mobs, and modded entities.
Passive mobs can be given melee and ranged attacks to become able to attack.
Everything is controlled through simple JSON config files. No coding, no datapacks, no dependencies.
Features:
#minecraft:raiders to target entire groups of mobs at once~minecraft:.*zombie.* to match mob IDs by pattern["minecraft:zombie", "#minecraft:skeletons"] to combine multiple matchers"modid:entity_name")/cmt reload command to apply config changes without restarting the serverOn first launch, the mod creates a config/CustomMobTargets/ folder containing:
Open targets.json and add your entries. Use /cmt reload in-game to apply changes instantly.
The "entity" field supports 4 formats. These work for both the source mob and target mob fields, and can be freely combined.
Target one specific mob:
"entity": "minecraft:zombie"
Target all mobs in a tag. Prefix with #:
"entity": "#minecraft:raiders"
This matches every mob in the minecraft:raiders tag (pillager, vindicator, evoker, ravager, witch, illusioner). See the tag list below for all available tags.
Match mob IDs by pattern. Prefix with ~:
"entity": "~minecraft:.*zombie.*"
This matches any entity whose ID contains "zombie" — zombie, zombie_villager, etc. The pattern is matched against the full registry ID.
Match any of the above. Mix and match:
"entity": ["minecraft:zombie", "#minecraft:skeletons", "~modid:.*golem.*"]
Matches if the entity matches ANY element in the array. Each element can be an exact ID, tag, or regex.
#minecraft:raiders — pillager, vindicator, evoker, ravager, witch, illusioner#minecraft:skeletons — skeleton, stray, wither_skeleton#minecraft:beehive_inhabitors — bee#minecraft:axolotl_always_hostiles — drowned, guardian, elder_guardian#minecraft:axolotl_hunt_targets — tropical_fish, pufferfish, salmon, cod, squid, glow_squid#minecraft:frog_food — slime, magma_cube#minecraft:freeze_hurts_extra_types — strider, blaze, magma_cube#minecraft:freeze_immune_entity_types — stray, polar_bear, snow_golem, wither#minecraft:powder_snow_walkable_mobs — rabbit, endermite, fox, etc.#minecraft:fall_damage_immune — iron_golem, shulker, etc.#minecraft:dismounts_underwater — all standard mounts#minecraft:arrows — arrow, spectral_arrow#minecraft:impact_projectiles — arrow, fireball, etc.#forge:bosses — ender_dragon, witherMods can add their own entity type tags. You can also create custom tags via datapacks.
All raiders attack iron golems (tag example):
[
{
"entity": "#minecraft:raiders",
"targets": [
{ "entity": "minecraft:iron_golem", "priority": 2, "check_sight": true }
]
}
]
Any zombie variant attacks villagers (regex example):
[
{
"entity": "~minecraft:.*zombie.*",
"targets": [
{ "entity": "minecraft:villager", "priority": 2, "check_sight": true }
]
}
]
Zombies and skeletons both attack creepers (array example):
[
{
"entity": ["minecraft:zombie", "minecraft:skeleton"],
"targets": [
{ "entity": "minecraft:creeper", "priority": 2, "check_sight": true }
]
}
]
Sheep shoots arrows at cows (ranged attack example):
[
{
"entity": "minecraft:sheep",
"ranged": { "enabled": true, "damage": 2.0, "projectile": "arrow" },
"targets": [
{ "entity": "minecraft:cow", "priority": 2, "check_sight": true }
]
}
]
arrow — Standard arrow (default, damage configurable)spectral_arrow — Arrow that applies Glowing effect (damage configurable)small_fireball — Blaze-style fireball (sets target on fire)large_fireball — Ghast-style fireball (creates explosion, damage = explosion power)snowball — Snowball (knockback only, 3 damage to Blazes)egg — Thrown egg (knockback, may spawn chicken)wither_skull — Wither skull (applies Wither effect)dragon_fireball — Dragon fireball (creates area effect cloud)shulker_bullet — Homing shulker bullet (applies Levitation effect)llama_spit — Llama spit projectileDoes this work with modded mobs?
Yes. Use the mod's registry ID, e.g. "alexsmobs:grizzly_bear" or "twilightforest:naga". Tags and regex also work with modded entity IDs.
Can I make mobs target players?
Yes. Use "minecraft:player" as the target entity.
Can I use multiple config files?
Yes. Any .json file in the CustomMobTargets folder is loaded (except files starting with __). Each file can contain a single entry or an array of entries.
Can I target a whole group of mobs without listing them all?
Yes. Use entity type tags (#minecraft:raiders) or regex patterns (~minecraft:.*zombie.*). You can also create custom tags with datapacks.
Server-side only? Yes. Only needs to be installed on the server. Clients don't need it. You can also use it for singleplayer just fine.
Link to original