Solved Getting Materials..

Discussion in 'Plugin Development' started by Pizza371, Oct 21, 2013.

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

    Pizza371

    Hey guys!
    Is there any way to get all the materials in bukkit with like an array or something (ik this probably isnt possiblre).
    Or any easy way to get all Materials? I really need it lol
     
  2. Offline

    NathanWolf

    The Material class is an enum, you can look at the Bukkit source or javadocs to see all the possible values, or you can iterate over it in your own code like this:

    Code:java
    1. for (Material material : Material.values() {
    2. // Do something with material
    3. }
     
    Pizza371 likes this.
  3. Offline

    Pizza371

    NathanWolf I know, didn't know there was a .values() method, thank you!
     
Thread Status:
Not open for further replies.

Share This Page