GOOD Ways to make entitys follow other entitys

Started by CodeLovingBison on Sun, 04/18/2021 - 18:08

Topic category: Help with modding (Java Edition)

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
GOOD Ways to make entitys follow other entitys
Fri, 08/20/2021 - 07:37 (edited)

=================================

Introduction:

Making a raptor mob, wich follows the second alpha raptor mob.

=================================

My Attempts (Please read. they are very helpful. They just don't work well for me ):

-------------------------------------------------

 

1. Attempt: Make the raptors leashed to the alpha raptor.

Command: data modify entity @e[name="LEASHED_MOB",limit=1] Leash set from entity @e[name="THE_PULLER_MOB",limit=1] {}

1.1 Issue: Raptors can float when leashed. (Example: A cow floating in the air when leashed to a fence)

1.2 Issue: The Raptors can break off lashes. (Not a problem. If you do on entity tick procedures and modify entity data with execute command in the name of entity...)

1.3 Issue: You can see the leash...

---------------------------------------------------

2. Attempt: Make raptors be aggressive to the alpha raptor and do 0 damage.

2.1 Issue: The raptors leap at entities they attack, so it looks weird...

2.2 Issue: Alpha raptors turn red when attacked, even tho raptors do no damage.

---------------------------------------------------

3. Attempt: Do the same thing as the second one, but when the raptors get close to the alpha raptor, they join a team (When entitys are in one team, they don't get aggressive at each other.)

3. Issue: My mod uses a lot of teams (If a mob is in two teams at the same time, they won't work and. The mob will be aggressive...)

---------------------------------------------------

4. Attempt: Teleport raptors to the alpha raptor, when to far.

4.1 Issue: Easy to make. But Visualy it doesn't look natural...

---------------------------------------------------

5. Attempt: (I don know how to recreate this or is this possible. If someone knows, please tell!!In the AI Goals list, there is a task, wich makes entitys follow their owner. Maybe you can give the "owner" tag to the alpha raptor, so that the raptors would follow him.

5.1 Issue: I don't know if this will work!

---------------------------------------------------

=================================

Extra:

I'll be very happy and thankful if you will give me some hints on how to make entitys follow others. Since its really important (especially for my mod... ). If you can, please send me some visual examples how to do it!

=================================

:)

Edited by CodeLovingBison on Fri, 08/20/2021 - 07:37
One option is to set motion…
Mon, 04/19/2021 - 08:28

One option is to set motion vector on tick update depending on the distance from another entity and based on the distance, determine some velocity and calculate the right direction.

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I know about the motion…
Mon, 04/19/2021 - 08:57

I know about the motion vector, but it can be challenging for mobs to get around hilly terrain, they will just bump in to walls and its not very effective...  

Thank you for you're answer!

Last seen on 10:25, 17. Aug 2021
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I really don’t know, but let…
Mon, 04/19/2021 - 14:53

I really don’t know, but let me try it (I am not good at procedures and stuff like that!):

(I think with both my ideas you have to go into code!)


1. Use the follow Person of authority (sorry, I don’t know the actual name of it) and than go into the code and write down with code how is the Person of authority. Like I said, I don’t know if it works!


2. Make the raptor a Baby. I don’t know if this is possible with MCr, cause I learn code at the time, but if you can make a Baby, then do it, because a baby pig for example follows here mom everywhere in Minecraft so it would be a solution!


Hope one of these, and the best if it is the first, will work!

 

Best wishes Heizer

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sorry I couldn't answer…
Mon, 04/19/2021 - 17:22

Sorry I couldn't answer earlier, I was doing my homework..

---------------------------------------------------

1. I get you're idea, but don't know how to implement it. If you can, please show me some visual examples. Im sure it will help!

---------------------------------------------------

2. I did the baby thing way back earlyer, but the thing is that baby automatically have smaller hitbox, lower pich sounds and faster animations. Plus they can't see the parent from to far... I tried changing the FOLLOW_RANGE attribute, but still nothing. So it doesn't work well for me

---------------------------------------------------

Thank you for you're answer!

Last seen on 20:44, 20. Oct 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Did you ever get this to…
Fri, 08/20/2021 - 04:11

Did you ever get this to work??

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I tested all. But neither of…
Sat, 08/21/2021 - 14:38

I tested all. But neither of them worked properly. So.. After multiple tests, I found the best way to do it!

Follow this tutorial to make the Raptor follow Alpha_Raptor:


Step1: Make the Raptor aggressive at Alpha Raptor.

----------

Step2: Create a condition, where the Raptor can attack him, ONLY if the Alpha Raptor doesn't exist within 5 block radius(depends on the hitbox scale)

----------

Step3: Change the "Follow_Range" attribute in the Raptors code to prevent him from getting lost.


Done! Hope it helps!

Last seen on 04:12, 21. Oct 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hi, sorry to distract you,…
Sun, 08/29/2021 - 07:54

Hi, sorry to distract you, can you show the procedure that is responsible for the possibility of an attack? I would be very happy.

Last seen on 04:12, 21. Oct 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks
Sun, 08/29/2021 - 09:38

thanks

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oh wait.. The code I gave…
Sun, 08/29/2021 - 12:57

Oh wait.. The code I gave you.. It won't work.

To fix it, try flipping the true and false values.

--------------

If entity exists in area 5 block, return false.

Return true

Last seen on 04:12, 21. Oct 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can also add a not block…
Sun, 08/29/2021 - 20:40

You can also add a not block . Thanks

Last seen on 23:30, 12. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hello, sry... How do you do…
Tue, 10/12/2021 - 23:01

Hello, sry...

How do you do so that the raptor does not focus only on following Alpha Raptor? I put it in the lowest priority and still only follows Alpha Raptor instead of attacking the other entities, since he should defend her or help her, not just stare like they kill the Alpha Raptor.

Last seen on 20:08, 19. Oct 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Well.. Had the same problem,…
Wed, 10/13/2021 - 19:04

Well.. Had the same problem, while testing. But luckily, I found a way to prevent this!

---------------

At the same condition, add this: https://ibb.co/ZMgdp3y