after studying the combat component of one of the open source cheat clients, I came across such a bot filter:
import net.minecraft.client.network.PlayerListEntry;
import java.util.UUID;
try {
PlayerListEntry p = GetLocalplayerfunc.networkHandler.getPlayerListEntry(player.getUuid()); //here the function collects information about the local players, and matches them with a list
if (p.getGameMode().isSurvivalLike() || p.getGameMode().isCreative()) { // And here compare them with the information received from the PlayerListEntry on gamemodes
return 'no bot'; //if the process goes smoothly, then the entity is marked as not a bot
}
} catch (Exception e){ //if it comes out with errors,
return 'isbot'; //then the entity is marked as a bot
}
if (player.getMinecraft().player == null) //if there are no local players,
return 'is bot'; // it automatically marks entities as bots.
And I thought: and why not add it to this client, because I have already tested it on one of the servers and it filters bots flawlessly