Post: [VB.Net] Minecraft Launcher
09-05-2013, 12:31 AM #1
Sloth
Banned
(adsbygoogle = window.adsbygoogle || []).push({}); I've recently released the source to Mine Grief so I thought I get some important parts of code into their own threads for you guys to use.


So my first release is a Minecraft Launcher, this will allow your VB program to launch Minecraft on any Windows computer with it installed.


So this is a public sub you can place in a module. The code is below or download the module here: You must login or register to view this content.

Call with "LaunchMinecraft()"


    
Module Minecraft_Launcher
Public Sub LaunchMinecraft
Dim CaseNum as Integer
Dim AppData As String = GetFolderPath(SpecialFolder.ApplicationData)
Dim mcroot as string = (AppData & "\.minecraft\")

'Finds Java Sets Case Number
If IO.File.Exists("C:\Program Files\Java\jre7\bin\java.exe") Then CaseNum = 1
If IO.File.Exists("C:\Program Files\Java\jre6\bin\java.exe") Then CaseNum = 2
If IO.File.Exists("C:\Program Files (x86)\Java\jre7\bin\java.exe") Then CaseNum = 3
If IO.File.Exists("C:\Program Files (x86)\Java\jre6\bin\java.exe") Then CaseNum = 4

'Finds Case & Executes
Select Case CaseNum
Case 1
Dim JRE7_64BIT = New ProcessStartInfo("C:\Program Files\Java\jre7\bin\java.exe", " -cp " & mcroot & "bin\minecraft.jar;" & mcroot

& "bin\lwjgl.jar;" & mcroot & "bin\lwjgl_util.jar;" & mcroot & "bin\jinput.jar; -Djava.library.path=" & mcroot & "bin\natives -Xmx" & xmx & " -Xms" &

xms & " net.minecraft.client.Minecraft " & Sloth & " " & 1337)
JRE7_64BIT.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(JRE7_64BIT)
Case 2
Dim JRE6_64BIT = New ProcessStartInfo("C:\Program Files\Java\jre6\bin\java.exe", " -cp " & mcroot & "bin\minecraft.jar;" & mcroot

& "bin\lwjgl.jar;" & mcroot & "bin\lwjgl_util.jar;" & mcroot & "bin\jinput.jar; -Djava.library.path=" & mcroot & "bin\natives -Xmx" & xmx & " -Xms" &

xms & " net.minecraft.client.Minecraft " & Sloth & " " & 1337)
JRE6_64BIT.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(JRE6_64BIT)
Case 3
Dim JRE7_32BIT = New ProcessStartInfo("C:\Program Files (x86)\Java\jre7\bin\java.exe", " -cp " & mcroot & "bin\minecraft.jar;" &

mcroot & "bin\lwjgl.jar;" & mcroot & "bin\lwjgl_util.jar;" & mcroot & "bin\jinput.jar; -Djava.library.path=" & mcroot & "bin\natives -Xmx" & xmx & "

-Xms" & xms & " net.minecraft.client.Minecraft " & Sloth & " " & 1337)
JRE7_32BIT.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(JRE7_32BIT)
Case 4
Dim JRE6_32BIT = New ProcessStartInfo("C:\Program Files (x86)\Java\jre6\bin\java.exe", " -cp " & "bin\minecraft.jar;" & mcroot &

"bin\lwjgl.jar;" & mcroot & "bin\lwjgl_util.jar;" & mcroot & "bin\jinput.jar; -Djava.library.path=" & mcroot & "bin\natives -Xmx" & xmx & " -Xms" &

xms & " net.minecraft.client.Minecraft " & Sloth & " " & 1337)
JRE6_32BIT.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(JRE6_32BIT)
Case Else
MsgBox("Please install JRE 7 to play Mine Craft")
End Select
End Sub
End Module
Last edited by Sloth ; 09-05-2013 at 12:34 AM.

The following 2 users say thank you to Sloth for this useful post:

Harry, Callumeleyy
12-22-2016, 11:36 PM #2
Sloth
Banned
Originally posted by foxushun View Post
Does not work modul download!! Sal


I mean this post is from 2013 minecraft launch options etc have changed since then I doubt this would work.
12-22-2016, 11:36 PM #3
Originally posted by foxushun View Post
Does not work modul download!! Sal


user does not read post dates... You must login or register to view this content.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo