Minecraft wiki entry for Creating_Forge_mods, associated text: Don't do anything that violates Mojang Studios' terms of use for Minecraft.
Don't release Minecraft versions or modifications that allow you to play without having bought Minecraft from Mojang Studios.
Don't release the de-compiled source code of Minecraft in any way.
Don't modify existing mods without permission from that mod's author(s). Check their License, usually available in the author's GitHub repository. If you can't find the license, then you do not have permission to share a modified version with anybody. You may tinker with the files for personal use only.