Material id to Material

Discussion in 'Plugin Development' started by fokolo, Sep 16, 2013.

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

    fokolo

    Material id to Material

    material.getid() is out of date now
    but i wonder is there a way to use id to get material?
     
  2. Offline

    InflamedSebi

    simply:
    Code:java
    1.  
    2. Material mat = Material.getMaterial(id);
    3. Material mat = Material.getMaterial(name);
     
  3. Offline

    fokolo

  4. Offline

    InflamedSebi

    sure it is ... because bukkit wants you to use the Material enums instead ...
    "getMaterial(id);"

    will still be available but if minecraft changes the id system it might break your plugin but if you use the enums instead your plugin should work just fine :)
     
Thread Status:
Not open for further replies.

Share This Page