Started by
chuiod steve
on
Topic category: User side tutorials
The title says it all, how can I make a creature follow me long distances? If you know please tell me, I would really appreciate it.
Topic category: User side tutorials
The title says it all, how can I make a creature follow me long distances? If you know please tell me, I would really appreciate it.
You could get it to follow you if you're holding something, the way pigs follow carrots or sheep/cows follow wheat, in the AI section.
First make sure that mob can see long distances(AI tasks), then make it attack when it sees you, that simple :)
Here's a solution you can do in the code for your mob. It is really simple, and easy to do.
Go down to the section of the code that looks something like this:
In the code, you'll want to add:
if (this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE) != null)
this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(50); <--- (this number can be whatever you want)
It should now look something like this:
Also, I apologize for the janky code snippet. I never use code snippets as you might imagine.
Hey, how can i do this in 2021.2?