Skip to content

Commit

Permalink
Merge pull request #2452 from MCCTeam/improve-follow
Browse files Browse the repository at this point in the history
FollowPlayer: Improve player detection
  • Loading branch information
milutinke committed Mar 25, 2023
2 parents 8b27386 + 29be211 commit b3d7942
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions MinecraftClient/ChatBots/FollowPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ public override void Update()

public override void OnEntityMove(Entity entity)
{

if (_updateCounter < Settings.DoubleToTick(Config.Update_Limit))
return;

_updateCounter = 0;

if (entity.Type != EntityType.Player)
return;

Expand All @@ -166,6 +160,11 @@ public override void OnEntityMove(Entity entity)
if (_playerToFollow != entity.Name.ToLower())
return;

if (_updateCounter < Settings.DoubleToTick(Config.Update_Limit))
return;

_updateCounter = 0;

if (!CanMoveThere(entity.Location))
return;

Expand Down

0 comments on commit b3d7942

Please sign in to comment.