MineInAbyss / Mobzy

Config-driven custom mobs for Spigot using ECS
https://mineinabyss.com/Mobzy/
MIT License
41 stars 7 forks source link

Have mob shoot projectiles depending on pathfinding #52

Open Boy0000 opened 3 years ago

Boy0000 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.