Check out example codes for "free minecraft server hosting". It will help you in understanding the concepts better.

Code Example 1

creeper.wtf

Code Example 2

minehut.com

Code Example 3

STOP UR REASEARCH AND USE MINEHUT.COM

Learn ReactJs, React Native from akashmittal.com