A boilerplate for using Forge's existing tools to decompile Minecraft! Alternatively you can use MCP Reborn by Hexeption.
This is an outdated less-compatible method of Minecraft modding but it's useful for making quick changes! If you want to create something serious, using a Fabric or Quilt (still in beta) mod with mixins is a better idea.
Run the gradle tasks setup extractMapped. Warning: this will override everything!
MCP Reborn didn't want to change their license :(. I still like modifying Minecraft's source code directly to do very stuipd things to it!
You can do what you like, basically! Link to full text. This doesn't apply to the Minecraft source code and mappings.