spigot custom mob

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

Also in Java: