Issues with Door Mob AI

Started by Odahviing on Tue, 08/07/2018 - 14:55
Last seen on 10:15, 9. Aug 2018
Joined Jan 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Issues with Door Mob AI
Tue, 08/07/2018 - 14:55

I discovered today that the Open/Close/Break door AI events do not work in MCreator. The mobs simply act as if the doors are any other block.

Luckily I managed to fix this issue. Go into the Code Tab and open the mob class. Anywhere at the top of your page with the import lines add:
 

import net.minecraft.pathfinding.PathNavigateGround

 

Then go down until you find the area containing your AI tasks. Above the AI tasks add the following line/s:

For breaking doors:

((PathNavigateGround)this.getNavigator()).setBreakDoors(true);

For opening doors:

((PathNavigateGround)this.getNavigator()).setEnterDoors(true);

 

This will work! :D
 

Dear MCreator devs - In the next version please fix this issue by causing the respective AI tasks to add these lines of code.

Techy side:

Mobs in Minecraft have a path navigator separate from their AI. MCreator only tells the mob's AI to break doors. The navigator doesn't know about this, so it just ignores the doors. However doing this tells the navigator to treat doors as not being there.

 

Hope this helped!