Ever wanted to make Creepers attack your Farm Animals? Or make Zombies and Skeletons attack each other? Now you can!
This mod simply allows pack developers to let hostile mobs attack entities other then player or those hard-coded into the mod.
Any hostile entity can now be easily configured to attack any entity from any mod, with minimal performance impact!
To effectively utilize this mod, relationships must be defined in .json files in the "CustomMobTargets" config folder.
Important: Any files starting with a double underscore will be ignored, such as the example file. This mod does nothing without user added .json files.
Configuring a .json file for CMT is easy. Simply define an "entity" string key (mod:entity), and a "targets" JSON array. The "targets" array contains a list of JSON objects, for each entity target.
There is no limit on how many targets you can add, and there is no limit to how many .json files can be put in the "CustomMobTargets" folder.
"priority" responds to how important the AI task for attacking is.
"check_sight" handles sight checking. In other words, should the entity target another entity if there is no direct sight, through walls for example.
Here is an example template json file that makes creepers agressive towards sheep:
{
"entity": "minecraft:creeper",
"targets": [
{
"priority": 2,
"check_sight": true,
"entity": "minecraft:sheep"
}
]
}
One extra note is the "/cmt" command.
You can quickly reload configs while the game is running by executing "/cmt reload"
Here is a demo video of how the mod works:
Permissions:
- You can use this mod in your modpack.
- You are not allowed to repost this mod to other sites without providing a CurseForge download link and my permission (
Zeitheron on Discord)
- You are not allowed to include this (or any other mods of DragonForge team) in your own mod. Building addons, however, is allowed, but a friendly PM would be good.
Note:
- The only supported version of minecraft is the latest one that this mod exists for. DO NOT ASK TO DOWNGRADE!
Want to discuss anything? Need help with APIs?
Join the discord server and follow Zeitheron on Twitter!
If you would like to support my work, you can become a patron via Patreon.
Before this mod I was forced to use the shitty mob targeting configs in rough mobs revamped, finding this is such a goddamn life saver that I honestly can't thank you enough. I do wonder though, would it be possible for you to configure mobs to have a fearful relationship? E.G making zombies run away from golems the same way creepers and skeletons run away from ocelots and wolves respectively? Also I know mod devs hate being asked this, but do you have any plans on porting this mod to newer version such as 1.16.5 or 1.18.2? It would definitely benefit those versions most because as far as I'm aware, no mods on future versions allow you to define mob to mob relationships like this one. Very useful mod btw <3
cn i gt sum assistance please???
---- Minecraft Crash Report ----
WARNING: coremods are present:
XaeroMinimapPlugin (Xaeros_Minimap_22.6.0_Forge_1.12.jar)
SoManyEnchantments ASM (SoManyEnchantments-0.5.5.jar)
Contact their authors BEFORE contacting forge
// There are four lights!
Time: 4/26/22 4:58 PM
Description: There was a severe problem during mod loading that has caused the game to fail
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Demon RPG 0.0.4 (demonrpg004)
Caused by: java.lang.IllegalArgumentException: Failed to register dimension for id 3, One is already registered
at net.minecraftforge.common.DimensionManager.registerDimension(DimensionManager.java:134)
at mod.mcreator.mcreator_demonsioncave.preInit(mcreator_demonsioncave.java:122)
at mod.mcreator.demonrpg004.preInit(demonrpg004.java:1428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.12.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 415137976 bytes (395 MB) / 771751936 bytes (736 MB) up to 2147483648 bytes (2048 MB)
JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.42 Powered by Forge 14.23.5.2859 Optifine OptiFine_1.12.2_HD_U_G5 31 mods loaded, 31 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
| State | ID | Version | Source | Signature |
|:----- |:------------------- |:------------------- |:---------------------------------------------- |:---------------------------------------- |
| LCH | minecraft | 1.12.2 | minecraft.jar | None |
| LCH | mcp | 9.42 | minecraft.jar | None |
| LCH | FML | 8.0.99.99 | forge-1.12.2-14.23.5.2859.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCH | forge | 14.23.5.2859 | forge-1.12.2-14.23.5.2859.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCH | xaerominimap_core | 1.12.2-1.0 | minecraft.jar | None |
| LCH | damageindicatorsmod | 1.0 | [1.12.2]DamageIndicatorsMod-3.5.1.jar | None |
| LCH | angelanddevilmod | 1.0.0 | Angel+and+Devil+-+1.12.2+[0.0.1].jar | None |
| LCH | betternether | 0.1.8.6 | betternether-0.1.8.6.jar | None |
| LCH | codechickenlib | 3.2.3.358 | CodeChickenLib-1.12.2-3.2.3.358-universal.jar | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
| LCH | creepypastacraft | 2 | CreepyPastaCraft_Reborn_V2c-1.12.2-hotfix1.jar | None |
| LCE | demonrpg004 | 0.0.4 | Demon+RPG+0.0.4.jar | None |
| LC | motnt | 1.0.1 | EvenMoreTNT-1.0.1.jar | None |
| LC | fastleafdecay | v14 | FastLeafDecay-v14.jar | None |
| LC | thanos_guantlet | 1.0.0 | Gaunlets_1.0.0.jar | None |
| LC | inventorypets | 2.0.15 | inventorypets-1.12-2.0.15.jar | None |
| LC | jei | 4.16.1.302 | jei_1.12.2-4.16.1.302.jar | None |
| LC | libraryex | 1.2.2 | LibraryEx-1.12.2-1.2.2.jar | None |
| LC | lycanitesmobs | 2.0.8.5 - MC 1.12.2 | lycanitesmobs-1.12.2-2.0.8.5.jar | None |
| LC | mob-blacklister | 1.2.0 | mobblacklister-1.2.0-mc1.12.jar | None |
| LC | moreexplosives | 1.0.2 | More+Explosives+V1.0.2.jar | None |
| LC | moreplayermodels | 1.12.2 | MorePlayerModels_1.12.2-(05Dec19).jar | None |
| LC | mutantbeasts | 1.12.2-1.0.2 | MutantBeasts-1.12.2-1.0.2.jar | None |
| LC | netherex | 2.2.5 | NetherEx-1.12.2-2.2.5.jar | None |
| LC | nei | 2.4.3 | NotEnoughItems-1.12.2-2.4.3.245-universal.jar | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
| LC | primal | 0.6.105 | PrimalCore-1.12.2-0.6.105.jar | 67a0e286dc0d4b502f3c92ac20b953517b52d0a9 |
| LC | somanyenchantments | 0.5.5 | SoManyEnchantments-0.5.5.jar | None |
| LC | tails | 1.12-1.10.0 | Tails-1.12-1.10.0.jar | None |
| LC | uniquebase | 1.0.1 | Unique+Enchantments+Base-1.12.2-1.1.2.jar | None |
| LC | uniqueebattle | 1.0.1 | Unique+Enchantments+Battle-1.12.2-1.1.4.jar | None |
| LC | uniquee | 2.0.1 | Unique+Enchantments-1.12.2-2.1.4.jar | None |
| LC | xaerominimap | 22.6.0 | Xaeros_Minimap_22.6.0_Forge_1.12.jar | None |
Loaded coremods (and transformers):
XaeroMinimapPlugin (Xaeros_Minimap_22.6.0_Forge_1.12.jar)
xaero.common.core.transformer.ChunkTransformer
xaero.common.core.transformer.NetHandlerPlayClientTransformer
xaero.common.core.transformer.EntityPlayerTransformer
xaero.common.core.transformer.AbstractClientPlayerTransformer
xaero.common.core.transformer.WorldClientTransformer
xaero.common.core.transformer.EntityPlayerSPTransformer
xaero.common.core.transformer.PlayerListTransformer
xaero.common.core.transformer.SaveFormatTransformer
xaero.common.core.transformer.GuiIngameForgeTransformer
xaero.common.core.transformer.GuiBossOverlayTransformer
xaero.common.core.transformer.ModelRendererTransformer
SoManyEnchantments ASM (SoManyEnchantments-0.5.5.jar)
com.Shultrea.Rin.Transformer.SMEASM
GL info: ' Vendor: 'Intel' Version: '4.6.0 - Build 30.0.101.1371' Renderer: 'Intel(R) UHD Graphics 630'
OptiFine Version: OptiFine_1.12.2_HD_U_G5
OptiFine Build: 20210124-142939
Render Distance Chunks: 8
Mipmaps: 4
Anisotropic Filtering: 1
Antialiasing: 0
Multitexture: false
Shaders: null
OpenGlVersion: 4.6.0 - Build 30.0.101.1371
OpenGlRenderer: Intel(R) UHD Graphics 630
OpenGlVendor: Intel
CpuCount: 12
In reply to darth_proteus:
"Caught exception from Demon RPG 0.0.4 (demonrpg004)
Caused by: java.lang.IllegalArgumentException: Failed to register dimension for id 3, One is already registered"
Looks like you have two mods trying to register dimensions with an ID of 3, as opposed to the crash being caused by this mod!
i created 1 for blazes file renamed blaze.json but crashed my game instantly this wat i typed in the file
{
"entity": "minecraft:blaze",
"targets": [
{
"priority": 2,
"check_sight": true,
"entity": "minecraft:sheep"
}
{
"priority": 2,
"check_sight": true,
"entity": "minecraft:cow"
}
]
}
did i type sumthin rong??
How do I make the targetted mob (like the sheep in the example) to run away from the creeper vs just standing there?
If I have a mod that makes passive mobs into neutral ones, can I then select those mobs as the attacker with this one? And what does priority mean? Like what's the default priority for a mob to attack a player for example?
Hey out of curiosity how would I get mobs to attack the player? More specifically I want endermen to be always aggressive to the player when in range.
In reply to phillthecatswithbread:
Try using "minecraft:player" as a target entity, it might or might not work. Hopefully it will tho!
Doesn't seem to work on every mobs, for example zombies.
In reply to DrBLOOD95:
Happy to take a look, can you share your json file?
In reply to MuckyMonkey:
Sure thing
In reply to DrBLOOD95:
That looks right to me.
Did you edit the "__creeper.json" example file in the config folder? If so, you'll need to remove the __ double underscore from the filename. It only works with JSON files that do not start with a double underscore, that way the example isn't active in case people don't want creepers attacking sheep. I'll edit the description later so that is more clear.
If that wasn't the issue, let me know and I'll keep looking to see why it isn't working!
In reply to MuckyMonkey:
I renamed the file as zombie.json
In reply to DrBLOOD95:
So the file is named without the double underscore? Very strange.
I'm using this mod in a modpack I'm working on with lots of different entities targeting each other and I've not had any issues, but just in case I tested it by copy pasting the the json from your earlier comment and my zombies are attacking pigs just fine... Are you running any mods that might be changing the IDs of either entity?
In reply to MuckyMonkey:
No, not at all, I will download the wad again and tell you what happens