@segv-segv I agree with everything that you said, but I have something to add:
if (mc.thePlayer.getDistanceToEntity(entity) > fovValue.get()) checks for the distance between the entity, it doesn't check the FOV (Proof is just above the said line, in @AIGeneratedStuff's post).