How to make a mob walk to a specific position

Started by scorpion981 on Wed, 09/09/2020 - 00:37

Topic category: Advanced modding

Last seen on 18:05, 31. Oct 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make a mob walk to a specific position
Wed, 09/09/2020 - 00:37

How to make a mob walk to a already choosed position? The position is stocked inside the enity and the block he need to reach with NBT tags. I was thinking of some solution and i just want some help with them:

  1. Spawn a entity that the mob want to attack at the right position. The mob need to have a infinite/really large view range cause he is going to be far of the position
  2. Search in the villagers code to know how do they get to bed. I don't know if its possible and if so i will like to know precisely how.
  3. Make a procedure that spawn an entity (that the mob want to attack) in is range and in the right direction, everytime he reach the entity the entity spawn again in the right direction. Currently i don't know how to do this
  4. Do the same thing of point 3 but he just go in straight line to the right X position and after to the right Z position. Its ugly and i think of some issues that will probally happen (for the 3 too)
  5. If you have another solution, tell me pls!

Sorry if i am not clear