Solved Getting a material from name?

Discussion in 'Plugin Development' started by Klo1029, Oct 2, 2019.

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

    Klo1029

    I have been googling forever and am not able to find the solution for what I want.

    What I need is that in a configuration file, the plugin user and enter any material ID (for example OAK_BUTTON), and for it to return the corresponding material. Now, my issue is that I must take an itemstack from the players inventory, and check if it matches the item material from the config. But when I use Material.toString() or Material.name(), an oak button will return WOOD_BUTTON, instead of Material.OAK_BUTTON (same goes for logs). How can I fix this?
     
  2. Online

    timtower Administrator Administrator Moderator

    @Klo1029 Did you put api-version in your plugin.yml?
     
  3. Offline

    Klo1029

    I dont know what that is... could you explain?
     
  4. Online

    timtower Administrator Administrator Moderator

  5. Offline

    Klo1029

    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page