Involved in the biosynthesis of FK506, which is a macrolide antibiotic with immunosuppressant activity. Catalyzes the transfer of a methyl group from S-adenosyl-L-methionine to the 31-O-position of 31-O-demethyl-FK506. Also catalyzes the methylation of 31-O-demethylimmunomycin, the C31 transmethylation reaction of 13,31-O-bis-demethyl-, 15,31-O-bisdemethyl-, 13,15,31-O-trisdemethyl- and 31-O-19,22-cyclic-hemiketalimmunomycins, which are all structural analogs of FK506. Inhibited by S-adenosylhomocysteine and sinefungin. Optimum pH is 8.5. Optimum temperature is 34 degrees Celsius. Monomer. Belongs to the FkbM methyltransferase family.