Trying to get my mob to follow the player anywhere, if they have a global value higher then 1

Started by BobEsBeans on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to get my mob to follow the player anywhere, if they have a global value higher then 1
Mon, 11/10/2025 - 06:47 (edited)

Okay so I haven't been able to find anything like this, if there is a forum that explains this please link me to it.

So basically,

  • I want my mob to spawn at the nearest water source if a player kills a villager. (Not important as of now but would still be helpful)
  • Every time the player kills a villager it adds to a global variable. (This is done)
  • I want my mob to be able to load chunks near it and path find to the player no matter how far they are away.
  • Eventually I want them to path find to whatever player has the highest amount of villager kills.

Now what I've tried to do is make an attack condition in the AI and goals section to do this but what ends up happening is my mob just wanders around like he's not aggroed on the player, if I take the condition off he aggros but then he cant find me after I get so far away. I have the follow and tracking ranges at their max.

Any help on any of these would be extremely helpful!

AI and goals: 

https://imgur.com/detfZ8r

Attack Condition:

https://imgur.com/FiVXsad

Behavior:

https://imgur.com/8ljRssX

Attack Condition: 

https://imgur.com/IuVEPUO

Kill Counter: 

https://imgur.com/KQeTIx4

Spawn: 

https://imgur.com/iY9iMGh

Can Spawn: 

https://imgur.com/DmoufCg

Edited by BobEsBeans on Mon, 11/10/2025 - 06:47
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I recommend using imgur for…
Sun, 11/09/2025 - 23:16

I recommend using imgur for images since they will stay up. 
 

  • have their follow and tracking range high but not too much, about 128 or double that.
  • then in the ai and goals section, enable the checkbox chase after lost sight.
  • as for it's spawning you will need to use a custom spawning condition, if that global variable is higher than 0 or not equal to 0, allow it to spawn if the block it is in/above is water,
  • as for that aggro if you should be able to use same method for spawning, use a return login, if variable is not 0 then true else false, for both conditions.
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I redid the images, how come…
Mon, 11/10/2025 - 00:43

I redid the images, how come have their range high but not much? Does it bug out if too high?

Also for the aggro, would it just automatically go for whoever has the highest number? This is primarily supposed to be used on servers, so if one player spawns him, my goal is that he would travel across the map to reach whatever player has the highest number. That's why I wanted to chunk around him to be loaded, so he doesn't de-aggro, but if that's not possible do you know how I could teleport him a certain distance away from the player with the highest number? That way he doesn't teleport on them but he also is always a threat as long as he's alive/spawned?

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You want to move that do…
Mon, 11/10/2025 - 03:08

You want to move that do melee condition to attack entities of type condition, yes I've had instances where having too high a follow range doesn't make a difference. 

As for aggro it will just go after the closest player that meets the more than 0 kills condition, if you want to make them target the highest count, you'd need another variable called highest count, when a kill is added, if that count is higher than the highest count variable, change the highest count variable to that. 
Or you can make players update it on tick if their kill count is higher, so if that player dies and they lose their kill count, someone who had less will become the new highest (make sure to check if the highest is already the same before updating to not constantly updating it without needing to)

if you want it to target that player with the highest kill, check if that players kill variable is equal to the highest count, then path/target them.

Also the condition wont work because you are stating if the target entity is both your entity (Dexter Morgan) and the player, in this case it only accepts a target entity, and this will only run for your entity, so you will not need to check if the entity running this procedure to be anything else. This also means that the target is your mob only.

Also you should put that force load command in its on entity update tick in its triggers, and deselect can despawn if you have not.

So this should be what your attack entity of type condition should look like:
just change the first and second frenzyK to amount_souls and the third one to the highest_amount_souls
https://imgur.com/a/axdZpBz 

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also I think this could be…
Mon, 11/10/2025 - 03:15

Also I think this could be your mobs Update tick procedure instead, so you'd have your force load on top of that.
Make sure your mob behavior is mob/monster so it attacks.

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alright, so now he aggros on…
Mon, 11/10/2025 - 06:45

Alright, so now he aggros on and kills the player when the player's kill count is above 0. But now he still kills the player no matter what even when the player's kill count is at 0. Any additional help or ideas would be greatly appreciated.

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It wouldn't let me put the…
Mon, 11/10/2025 - 06:48

It wouldn't let me put the links in a reply so I edited my original post to contain the other procedures I made in case I did something accidentally that'd be messing with what I'm trying to do.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Odd about links, you should…
Mon, 11/10/2025 - 15:30

Odd about links, you should be able to paste it in and hit space to let it automatically add. As for your issue with attacking the player regardless is because you have it attacking entity type of player, but we can disable that since (if you have the attack condition in on entity tick) it will automatically target players only IF those conditions are met (also you can remove the false now since it wont be much use in entity tick.) Hope this helped.

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by disable the attacking…
Tue, 11/11/2025 - 01:01

by disable the attacking entity type, you mean in the AI and goals section right? I tried that and removed the return false but no he just wanders around. When you say have the condition on entity tick do you mean as an additional trigger or in the mobs trigger sections? Or should that not matter? Sorry for the long questions, I'm still relatively new to MC Creator.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
by disable the attacking…
Wed, 11/12/2025 - 00:40

by disable the attacking entity type, you mean in the AI and goals section right?

Yes since you will be manually targeting for the mob this won't be needed as it's only for automatically targetting.
 

When you say have the condition on entity tick do you mean as an additional trigger or in the mobs trigger sections?

In your mob's custom triggers section, so you wont have to filter for every mob on every entity tick.

 

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've tried that and it still…
Wed, 11/12/2025 - 03:09

I've tried that and it still did not work, do you have any ideas as to why this is still happening?

 

https://imgur.com/a/0roLy0G

 

 

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you list out the…
Thu, 11/13/2025 - 01:51

Could you list out the features that work and don't? I assume you mean it still aggros on players when they have 0 souls still, if that's the case maybe when it kills other entity [set its attack target entity = no entity]? (should be in advanced procedure tab)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay so i did what you asked…
Fri, 11/14/2025 - 00:04

Okay so i did what you asked but I thought it'd be good to show you as well so i made this quick video before i go to work, https://youtu.be/bweQNRxLSPg 

the list is at the beginning of the video

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First, you can probably add…
Fri, 11/14/2025 - 00:40

First, you can probably add the force load command back in if it works
Second, This makes more sense now, you have the behavioral characteristics set to Creature and not Mob, so it will be peaceful (top drop down option in behavior tab)
This should fix those 2 not working conditions, as for testing that unsure one, you'd have to export the mod and try with someone else.
Hope this helps

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh but add that command…
Fri, 11/14/2025 - 00:41

Oh but add that command outside of the for each player, so it only runs once per tick and not the number of players per tick.