Jump to content

[Solved] Anybody workaround the confirmed bug where mobs don't go through doors?


MrChoke

Recommended Posts

My next thing to learn/do is to see if I can alter mobs ability to break doors.  immediately I find a horrible Mojang bug that I can't believe stayed out there for 3 releases:

https://bugs.mojang.com/browse/MC-102896

 

Sure enough between 1.9 and right now, 1.12.x, mobs will not go through doors to pursue the player.  And that also means they won't break them either.  In 1.13 it is fixed.  Not that that helps me now.

One thing I am struggling with is understanding why it's not working.  I have determined this:

 

1) EntityAIBreakDoors:shouldExecute always returns false (I was able to add this task to all zombies not just the 5%).  It returns false each time because of a check in its parent:

EntityAIDoorInteract.shouldExecute():

if (!this.entity.collidedHorizontally)
{
    return false;
}

This very important variable, collidedHorizontally, used all over the place is FALSE every time this executes.  And what I find even more interesting is how another child AI of EntityAIDoorInteract, EntityAIOpenDoor works!!  That is used by the villages to open and close doors.  That same super.shouldExecute() check comes back TRUE for them and the AI works.

Also, blowing my mind even more is if I spawn a villager in a building and spawn zombies outside, they have no trouble at all pathfinding through the door and killing the villager!  NOTE, they still won't break closed doors though (for that AI collideHorizontal is still false)

Lastly, when I am in creative mode and I let zombies walk around, they do seem to move through doors occasionally.

 

So I don't get it.  I started diving into move code, collisonBox code, path finding code.  My head hurts.  I know Forge has some event handlers that I'd like to use if I could.  Most encouraging is GetCollisonBoxesEvent.  But how can I use them if I don't understand what Mojang did wrong that broke this in the first place?

 

Edited by MrChoke
Link to comment
Share on other sites

UPDATE:  If anybody cares, I found root cause and fixed this Mojang bug.  Yes, I know its fixed in 1.13 but I wanted to see if I can fix it anyway.  It turns out its not a bug in ray tracing (the logic for what a mob can see), or path find, or the AI.  It was a bug in the door blocks themselves.  The blockstate's "open" property for the upper blocks of the doors was never being updated.  It stayed "false" even when the lower block was "true".  Most of the code that uses doors only look at the lower block but the path finding logic does not.  When a mob is 2 blocks high both blocks have to be clear.  The upper block was coming back as "DOOR_CLOSED" and the AI never went through.  My fix is to set the block state of the upper block whenever the lower block was changed.  It seems to only be needed in two places.

 

 

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi I have an issue with a server it solved deleting the ice and fire but my friends and me really want to use it does any of these mods are causing the issue due to incompatibility  Security craft Aquaculture Architectury Artifacts Astikorcarts Baubles BetterCaves yungs BetterStrongholds yungs BetterMineshafts yungs Bountiful Byg  Callablehorses Carry on Chococraft Citadel Clumps Collective Comforts Corailrecycler Craftable horse armor Comes alive Curios forge Decocraft Dungeonsarise  Open blocks elevator Expandability Farlanders Goblin traders Hwyla  Ice and fire Infernal expansion Jei Jump over fences Mantle  Macaws bridges Macaws doors Macaws fences Macaws furniture  Macaws fencesbyg Morpheus Mouse tweaks Mowzies mobs Obfuscate Paraglider Patchouli  Pick up notifier Random village names Spartan shields Small ships Sophisticated backpacks Spartan weaponry Storage drawers straw golem Structure gel Twilight forest  Tinkers construct Two players one horse  Valhesia core  Valhesia structures  Way stones  Vehicle mod  Wall jump Wings Wolves with armor Xptome  Xaeros minimap  Yungsapi  
    • { "type": "magic_overhaul:rune_inscribing", "base": { "item": "//base item" }, "template": { "item": "//template item" }, "output": { "count": 1, "item": "//output item" } } ^ Ok, where is your recipe JSON placed in your file structure? What's it called? And paste the actual JSON you're testing with, because it needs to be valid.
    • I'm trying to run Forge 1.12.2 on Minecraft  so I can use certain mods, but this error popped up. I've seen multiple errors but I just can't figure this one out. Unable to locate the Java runtime. Error details: 0x00000000 - system: The operation completed successfully. Filename on disk:  Path: . Exists: Directory
    • https://mclo.gs/b422RFc
    • Плагин и Приват
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.