How do i get a LivingEntity to follow the player?

Started by Shasankp16 on

Topic category: Help with modding (Java Edition)

Last seen on 16:40, 30. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i get a LivingEntity to follow the player?

Hi there ! i am creating a mod which adds Herobrine, steve, alex , friendly mobs etc.......well i was working with the procedure "when right clicked on entity" . Now i want to set the function as such that when its right clicked, the entity will follow me , aka the player. Can anyone suggest me how to do that?

Would be nice if someone gave a working early reply

 

-Regards

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe 2020.4 will have…
Wed, 07/29/2020 - 04:29

I believe 2020.4 will have tameable entity support if this is what you are going for. If you don't want them to act quite like that, you can make them hostile mobs that attack you but do no damage. The problem with the second option is that they keep pushing against you (having them move slowish could kinda help with this).

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(If you want to try the…
Wed, 07/29/2020 - 04:33

(If you want to try the second one, make the hostile mob separate from the normal one, and have them replace each other when right clicked. I believe there is a way to give the new mob the same head pitch and rotation, but I don't remember how exactly at the moment, it's probably just one or two of the procedure blocks.)

Last seen on 16:40, 30. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok then, i guess i will keep…
Wed, 07/29/2020 - 04:43

ok then, i guess i will keep the ai simple for now!

Last seen on 16:40, 30. Jul 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
well i found this option in…
Wed, 07/29/2020 - 04:48

well i found this option in ai page under other taks:

Follow [minecraft component] with speed [define] scared of movement [checkbox]

what could this be?

 

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use that one, though…
Wed, 07/29/2020 - 08:28

You can use that one, though it only applies when you are holding the item (the one you set) in your hand (like chickens following you if you are holding seeds, or pigs if you are holding carrots). The "scared of movement" is like how cats run away when you move, even if you are holding out fish.

You would probably be able to put a whole bunch of that ai block in the entity and set a different item for each one, although I haven't tested it.

(By the way, it may not work at all, but there's a chance setting the item to AIR may make them follow you if your hand is empty. Just speculation though.)

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just remembered. The…
Wed, 07/29/2020 - 18:17

I just remembered. The biggest problem with making a hostile version of the entity, is that it disappears on Peaceful. Kind of a big one really.

Last seen on 15:08, 18. Dec 2022
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
are how to make to mob not…
Mon, 11/21/2022 - 16:37

are how to make to mob not move but i with wheat in hands step and he follow me?