Any time you take a screenshot in the game, the image data is copied to the clipboard. You can then paste this anywhere (e.g. Discord, Imgur, Reddit) to upload the image and share it with others.
Works on vanilla servers, and modded servers without the mod installed!
Also available for versions 1.10.2 to 1.12.2 (the 1.12.2 file works for all these versions) and for 1.14/1.15 Forge here.