Solved Getting a material from name?

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

  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. Offline

    timtower Moderator Moderator

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

    Klo1029

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

    timtower Moderator Moderator

  5. Offline

    Klo1029

    timtower likes this.

Share This Page