[unsovled]How Do Zombies Target Doors in a village? {code}

I think zombies arbitrarily look for doors to break if they can’t find a player, but i may be wrong on that…

I think they only break doors if they’re in the way.

…yes but how? lol that’s what i['m asking for can anyone show the coding that does this in minecraft?

I’m pretty sure zombies just go after doors if there might be something behind them.

I have seen zombies attack random village doors and then stop when they’re open because there isn’t anything inside.

ok but how do they attack doors? :slight_smile:

The best thing you could do is to search through the code yourself. That’s what I do when I want to know how something in vanilla works.
Obviously a good start would be to look at EntityZombie
You can see various AI configuration in the constructor e.g. ((PathNavigateGround)this.getNavigator()).setBreakDoors(true);

Entity AI is built on a lot of things so there’s not just one piece of code responsible, it’s built on a fair amount of abstraction. So yeah best thing to do is to dive in and see what you find.

@gravityfox Maybe the wander-around-pathfinder does ignore doors too? And when a Zombie wants to wander in a house, he knocks on the door! This might look random ^^

@simon816 ok … i think lol so pathnavigateground…is that what allows the monsters to walk around?

and where would i find this code? at that uses entity ai?

oooh and can someone explain the entity keys a bit more? Obviously some of them are explanatory but how bout target or anger etc?

ok…so i placecd oak doors down in a whiteserver with controlled variables…then i had this code running…

    public void onBreak(ChangeBlockEvent.Break event){
        getLogger().info(event.getCause().toString());
    }

However the console doesn’t see anything being broken…doors or sand blocks when i break them…help? trying to log and see what they break…but still not working

You can set up a forge project, or just set up the spongeforge project in your workspace, then you can browse the minecraft code in the dependency.

I’m not going to tell you every entity key, but I will say that TARGET relates to TargetLivingData and it’s basically if an entity is ‘targeting’ another entity in AI. e.g. a zombie targeting a villager (I think).
ANGER relates to AngerableData and is an integer representing how ‘angry’ the entity currently is.

It may be useful for you to explore the org.spongepowered.api.data.manipulator.mutable.entity package for more entity related data.

I’m guessing this is the same problem as this thread:

so apparently there is still no zombie’s breaking down my doors lol any help?

Oh so you have an issue with them not breaking doors? Make sure the difficulty level is set to HARD (difficulty=3)

BTW you can see in EntityAIBreakDoor where this happens,

        if (this.breakingTime == 240 && this.theEntity.worldObj.getDifficulty() == EnumDifficulty.HARD)
        {
            this.theEntity.worldObj.setBlockToAir(this.doorPosition);
1 Like

…k so i changed it to hard and they still won’t break down the wooden door to get to me :frowning:

Do you have any plugins/mods? Did you leave the zombie long enough?

yes i’ve got some mods and plugins…but none of them effect the mobs. :confused: what do you mean leave the zombie long enough? yea i sat at my door and when he couldn’t get to me he left

Is the door placed with the right side in the house? If not the zombies won’t/aren’t able to break the door. This is a very very good trick for playing survival minecraft and living in a village.

I can once again check this but I find it hard to believe that zombies aren’t breaking my doors…here’s what I’m trying to do. I’m trying to get a zombie to break blocks in order to get to a player…or have them place blocks to get to those players…in order for them to ‘hunt’ the player I need to figure out the code to make them agro the player. then I will need to figure a way have that entity break a block(in a specific amount of time); to get to the player. The purpose of this is to eventually add it to a plugin I’m working on that already controls monster spawning so that i’ll have something like the old Monster Apocolypse fromb bukkit and Spigot

So…does anyone know if there has been a pathfinder API yet done?