New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.19.3] BlockState$getBlockPathType does not get pathfinding mob passed in #9283
Comments
Wasted a bit of dev time trying to use this feature only to realize it doesn't even work. Very frustrating. Maybe it could be fixed in 1.19.4? |
So taking a look into this, just for the first two levels of calls it would require us making16 new methods that take in the mob. A lot of the pathfinding was moved to static helpers so we can't really get this information. As it sits, I think this hook has to die due to its complexity not being with the hook. Have you looked into other methods to accomplish what you want besides this low level BlockPathType? |
Me using this method was just an attempt to bypass the lack of an API for adding custom block path types. I need all entities to understand whether or not my modded blocks are dangerous to them whenever they are pathing. |
We can keep the custom path type hook, just kill off the mob parameter because it's not possible to propagate it down. |
My use case was a curtain non-solid block that would prevent certain tagged mobs (not all) from walking or flying through it while allowing players and none-tagged mobs to pass through/pathfind through. Of course just blocking movement by EntityInside Block method, the mob will still try to pathfind through the block. So I was trying to find a way to make the walkNodeEvaluator not try to pathfind through my block if it is the specific tagged mob I don't want passing through. Like you said, the static stuff stopped me as well and the Forge hook wasn't working. Though my main case was stopping bees and other flying insects which I am able to handle and got working. Blocking walk pathfinding would have be a nice thing to have if users tagged walking mobs to not pass through my block. But blocking off walking mobs is not a core feature of my block so if this hook cannot be fixed, that's ok. The walking mobs will just walk into the block and get stuck by pathfinding but can't pass through which isn't end of the world for me. |
Forge adds IForgeBlockgetBlockPathType method to allow mods to have their block change their pathfinding type based on conditions when a mob attempts to pathfind through it. One extremely useful use case is a block that lets certain entities pathfind through but not others.
The issue is in the static WalkNodeEvaluator$getBlockPathTypeRaw method where Forge patched in the Forge method, null is passed in for the mob. Rendering the mob parameter completely useless.
To fix this will require a breaking change that could be potentially affects quite a number of mods calling getBlockPathTypeRaw. It is a tricky spot. But as of right now, there's no way for a mod to be able to block the pathfinding of certain mobs through their block and allow other mobs which seems to be one of the main points of this Forge method and probably should be restored before the Recommended Build is created. Or overload methods could be made instead and deprecate vanilla methods (suggested by someone)
The text was updated successfully, but these errors were encountered: