Integer/typeID to material/type

Discussion in 'Plugin Development' started by Randy Schouten, Jun 16, 2011.

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

    Randy Schouten

    Any idea how to do this?

    I want to get a Int, and then print out the material name of that integer.

    For instance, the int = 1, then I want it to print "stone".
     
  2. Offline

    Jako

    You would do something like this:

    Code:
    int itemID = 1;
    Material myMaterial = Material.getMaterial(itemID);
    player.sendMessage(myMaterial.name().toLowerCase());
    Hope that helps
    -Jako
     
  3. Offline

    Randy Schouten

    Ah, thank you quite alot!

    I should more often look at these "Material." and "Chatcolor." things...
     
Thread Status:
Not open for further replies.

Share This Page