Check out example codes for "spigot spawn entity". It will help you in understanding the concepts better.

Code Example 1

World myWorld = Bukkit.getWorld("world");
	Location spawnLocation = new Location(myWorld, 0, 10, 0);
	Entity spawnedPig = myWorld.spawnEntity(spawnLocation, EntityType.PIG);

Learn ReactJs, React Native from akashmittal.com