Skip to content

Commit

Permalink
FollowPlayer: Improve player detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinforceZwei committed Mar 25, 2023
1 parent 8b27386 commit 29be211
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 29be211

Please sign in to comment.