Posted October 27, 20186 yr hi, i want to build a block, that hostile mobs dont want to cross… is there a possibility to change the pathNodeType in relation to the Entity what is collided with this block? getAiPathNodeType() in relation to onEntityCollidedWithBlock() does not work
October 27, 20186 yr I do not think this is possible because you don't have a reference to the entity which initiates the pathing check whatsoever. I suppose you might be able to replace the basic EntityMoveHelper with your wrapper that does the check for your specific block but this might cause incompatibilities with mods that attempt to do the same.
October 27, 20186 yr You need to update the pathfinding code if you want the AI smart enough to avoid that block. You can create custom PathNodeType objects (even though its an enum) using a Forge class called EnumHelper. Example: LADDER = EnumHelper.addEnum(PathNodeType.class, MODID + "LADDER", parameterTypes, 0.0F); //0.0 means its as good as OPEN or WALKABLE
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.