• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Mod Request Zombies not attacking blocks

Is this a modification request?

MaxTunnerX

Refugee
I have tried making my own mod that would stop zombies from attacking blocks, but every time I remove "destroyblocks" from their AI (and only this line, no others), they completely freeze up and dont even walk anymore. How do I make them act normally except for blocks?
 
So I havent found anything of that nature. Also, if making zombies not attacking blocks is too hard, can someone mod them to do 0 block damage? Ive only ever seen mods with 1 damage but never 0.
 
So I havent found anything of that nature. Also, if making zombies not attacking blocks is too hard, can someone mod them to do 0 block damage? Ive only ever seen mods with 1 damage but never 0.

Searching the Nexus for "block damage" immediately returned several mods that do this. The most recent I found were:

https://www.nexusmods.com/7daystodie/mods/143
https://www.nexusmods.com/7daystodie/mods/6005

They're both from last year, so they might work with the current game version or they might not. Even if they don't work, as long as the mods are xml-based then you should be able to adapt them to work with the current game version simply by studying the xml files.
 
If you have zombies that won't attack blocks, or don't do damage, then you'll have a lot of zombies stuck in cupboards.
Yeah I know. First of all I never asked for that feature so I dont care, secondly I dont care about it even in general :D. But yeah it will be funny and they will be at my mercy whether or not I will let them free. Thats some real powerplay right there. Maybe payback even, for all those years. Or I might imagine they are cats and then it will make sense that they could get in but not out :D. In any case, someone please help me with this mod, whether for science or for the trolls.
 
Last edited:
Yeah I know. First of all I never asked for that feature so I dont care, secondly I dont care about it even in general :D. But yeah it will be funny and they will be at my mercy whether or not I will let them free. Thats some real powerplay right there. Maybe payback even, for all those years. Or I might imagine they are cats and then it will make sense that they could get in but not out :D. In any case, someone please help me with this mod, whether for science or for the trolls.

I posted two different mods that negate block damage yesterday. What more help do you need?
 
I posted two different mods that negate block damage yesterday. What more help do you need?
You didnt actually. If you read the mods descriptions, both of them are 1 damage mods, not 0 damage mods. But thanks for trying anyway. BTW I legit didnt notice your previous post, so good job reminding me.
 
Last edited:
There's no DestroyBlocks behavior, just DestroyArea, so I assume you meant BreakBlock. I suspect your problem is with the xpath statement. I couldn't figure out how the game handles the '|' character in the behavior list, so I just replaced the whole thing. This works in your entityclasses.xml. The zombies will go into DestroyArea mode if they get frustrated. And this doesn't do anything about animals.

Code:
 <remove xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='AITask']" />

<insertafter xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='AIPathCostScale']">
    <property name="AITask" value="
    DestroyArea|
    Territorial|
    ApproachDistraction|
    ApproachAndAttackTarget class=EntityPlayer,0,EntityBandit,0,EntityEnemyAnimal,0,EntityAnimal|
    ApproachSpot|
    Look|
    Wander|
    "/>
</insertafter>
 
There's no DestroyBlocks behavior, just DestroyArea, so I assume you meant BreakBlock. I suspect your problem is with the xpath statement. I couldn't figure out how the game handles the '|' character in the behavior list, so I just replaced the whole thing. This works in your entityclasses.xml. The zombies will go into DestroyArea mode if they get frustrated. And this doesn't do anything about animals.

Code:
 <remove xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='AITask']" />

<insertafter xpath="/entity_classes/entity_class[@name='zombieTemplateMale']/property[@name='AIPathCostScale']">
    <property name="AITask" value="
    DestroyArea|
    Territorial|
    ApproachDistraction|
    ApproachAndAttackTarget class=EntityPlayer,0,EntityBandit,0,EntityEnemyAnimal,0,EntityAnimal|
    ApproachSpot|
    Look|
    Wander|
    "/>
</insertafter>
Thanks, although I must admit Im not really sure what this thingy does. So instead of destroying blocks, they destroy the area theyre in? Something like this happened a while ago when I was testing the trader blocks. The zombies inside a cage of the trader blocks absolutely wrecked everything within that cage, including trees. As amusing as seeing a lumberjack zombie obliterate a tree with his bare hands is, it was all ground zero afterwards.
 
Well, I'll admit I'm certainly no expert on the AI, but yeah, they go into a destroy things mode if they can't find a path to you. They'll start breaking random blocks, trying to dig, beating on cars. I tested the code above with some Arlenes. Most of the time they just tried to walk through the barrier, occasionally one would hit it a couple times, or try to dig. Maybe removing the DestroyArea| line would stop all that too. Didn't try that.
 

Attachments

  • 20250728075950_1.jpg
    20250728075950_1.jpg
    808 KB · Views: 1
Well, I'll admit I'm certainly no expert on the AI, but yeah, they go into a destroy things mode if they can't find a path to you. They'll start breaking random blocks, trying to dig, beating on cars. I tested the code above with some Arlenes. Most of the time they just tried to walk through the barrier, occasionally one would hit it a couple times, or try to dig. Maybe removing the DestroyArea| line would stop all that too. Didn't try that.
Thanks for fighting this fight with me! Also I thought of something interesting. Can we replace the destroyArea with another type of behavior so when they get frustrated they just walk around or walk away or something?
 
You didnt actually. If you read the mods descriptions, both of them are 1 damage mods, not 0 damage mods. But thanks for trying anyway. BTW I legit didnt notice your previous post, so good job reminding me.

The 1-damage bit is for edge cases. The "Traditional Zombies No Damage" mod prevents them from attacking blocks in the first place. Yes, if they do manage to somehow damage a block it will do 1 damage.

But if they don't attack the blocks at all, then they are in a constant state of doing 0 damage. Because they simply don't target blocks anymore.
 
The 1-damage bit is for edge cases. The "Traditional Zombies No Damage" mod prevents them from attacking blocks in the first place. Yes, if they do manage to somehow damage a block it will do 1 damage.

But if they don't attack the blocks at all, then they are in a constant state of doing 0 damage. Because they simply don't target blocks anymore.
Yes, I know. Its much better than just having them do 1 damage while still targeting blocks, but you have to understand its still not what Im looking for.
 
Thanks for fighting this fight with me! Also I thought of something interesting. Can we replace the destroyArea with another type of behavior so when they get frustrated they just walk around or walk away or something?

Anything is possible if you know how to do it, people have added their own AITasks, with code I assume, but that's not something I know. If I recall, the AITasks are a priority list, first items have higher priority. You could try different things and see what you come up with.
 
Yes, I know. Its much better than just having them do 1 damage while still targeting blocks, but you have to understand its still not what Im looking for.

If you want it to be perfect instead of "good enough," then what you want probably isn't a mod, it's a vanilla game option. And only TFP can do that.
 
Back
Top