Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Have mob shoot projectiles depending on pathfinding #52

Open
Boy0000 opened this issue Feb 27, 2021 · 2 comments
Open

Have mob shoot projectiles depending on pathfinding #52

Boy0000 opened this issue Feb 27, 2021 · 2 comments

Comments

@Boy0000
Copy link
Contributor

Boy0000 commented Feb 27, 2021

Say if you are swimming beneath/building above an orbpiercer, and it cant pathfind to you. It would then start shooting projectiles if you are within y-blocks of it.
Same would go for X,Z blocks. It would check if it can pathfind to player, and if player is less than X blocks away, it would not fire projectiles. Above xBlocks and it would

@Norazan
Copy link
Member

Norazan commented Feb 27, 2021

This essentially boils down to a check for if the target is reachable or not. Maybe there is some way to do this already? Else we'd have to program it ourselves. After that, we can just add a boolean parameter to ThrowItemsGoal if the mob should shoot projectiles if the target is unreachable.

@0ffz
Copy link
Member

0ffz commented Mar 1, 2021

Vanilla pathfinders are really hard to integrate with out existing system, so I don't think we can easily make events of our own.

However if you want a quick fix, the move_to_target or whatever goal might fail if it can't pathfind to the target, so just setting this goal under that one might make it only shoot when it's not pathfinding towards you. If this isn't the case, we could probably make our own pathfinding goal that fails if it thinks target can't be reached.

We also might want to just switch over to our own pathfinding system because vanilla's is so trash, then this stuff would be easier to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants