Im getting extremely frustrated. I have decompiled PureEntities countless times already and I simply dont understand all that code. How do i write Mob AI?
even tho genisys's implementation sucks very much you could use it as a refrence just DONT copy it as a lot of people says it's inefficient
how does genesys do it does it have a pre defined method like on PC or another way Would you be kind enough to post a link?
I don't know what you mean by pre-defined method. All I can tell you is that the time paradox of causal loop does not exist here -- there always has to be someone who writes the code the first time. I have absolutely no experience in pathfinding, but I believe that the whole mechanism is in viewing object intersections as points and has something to do with topology. I believe that you can find some algorithms for pathfinding online, though, but it would take a lot of experience to write it into code well. If you can't find the code out from pureentities, which isn't really a big plugin, I doubt you're ready to do it, as @Primus has said. You indeed can do it, but you'll probably end up rewriting several times and keep asking yourself "why didn't I do this" "how could I have written something like that" after attempting many times; on the other hand, if you plan to copy much code, good luck.
Bukkit has a Predefined Method and does it by extending a superclass from the EntityClass of the mob you want to give Custom AI then clearing the pathfinder goals of the mob and then adding your own pathfinder i cant remember how it does that exactly but its something like this: public class CustomWither extends EntityWither{ bla bla bla this.PathfinderGoals.clear() this.newPathfinderGoals(ZOMBIE) } Would make a Wither attack a Zombie for example (Obv not the correct way) https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/
Yes, and the predefined method in Bukkit was written by a human too. You don't put a beta radiation source next to a computer to implement pathfinding.