Get Minecraft version

Discussion in 'Plugin Development' started by Welite, Oct 28, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Welite

    Hi, I need to get a version runnung on the server, I tried getServer().getVersion(); and getServer().getBukkitVersion(); but it display more then just version I need to get only the version like it display in the brackets "(MC: 1.6.2)", but I dont know how to separe this, can someone help me ?
    I need only String version = "(MC: 1.6.4)" .
     
  2. Offline

    M4GNV5

    you can split the string:
    Code:java
    1. String tempVersion = getServer().getVersion();
    2. version = tempVersion.split('(MC: ', ')');

    then the array "version" has:
    version[0] = ""
    version[1] = "1.6.2"
    version[2] = ""

    well thats the way you do it in C# and C# is similar to java and according to http://www.java-examples.com/java-string-split-example its possible in java :D :)
     
Thread Status:
Not open for further replies.

Share This Page