Skip to content
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

BlockState$getBlockPathType does not get pathfinding mob passed in #791

Open
TelepathicGrunt opened this issue Apr 10, 2024 · 0 comments
Open
Labels
enhancement New (or improvement to existing) feature or request

Comments

@TelepathicGrunt
Copy link
Sponsor Contributor

Revival of MinecraftForge/MinecraftForge#9283

———

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)

———

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. The static stuff stopped me 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.

@TelepathicGrunt TelepathicGrunt added the enhancement New (or improvement to existing) feature or request label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

No branches or pull requests

1 participant