Get the default name of an item

Discussion in 'Plugin Development' started by JUSTCAMH, Jun 16, 2015.

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

    JUSTCAMH

    Is there any way to get the default name of an item? So I want to print the item into chat, but I don't want it to be the id or just the material name. So basically I want it to print the actual default name, so for example spruce log. Would this be possible or would I require a lengthy enum that lists all the items?
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    JUSTCAMH

    @timtower Ok so I looked at the code, and it looks like this works off the material name. This isn't quite what I was hoping for. I wanted to get the actual name of the item when you receive it normally ingame. The problem with what he made is it will not factor in the data of an item, so for example, if I were to have a spruce log, it would just be called Log. Also if it's an item like for example, an iron pressure plate, some people might not know what it is when it is displayed as Iron plate. Is there a way to get the 1.8 item ids, so like the item names so minecraft:dirt?
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    JUSTCAMH

    @timtower Ok I'll check later, just from looking over it it looked like it used Material.name() which would return the actual name of the Material. Haven't actually tried it yet, will do in the morning
     
  6. Offline

    NathanWolf

    I don't think the server has a list of "friendly" names for blocks or items, since the server doesn't generally care about that sort of thing.

    I could be wrong, though.

    You can use Vault's item db to get some nice names, though.
     
Thread Status:
Not open for further replies.

Share This Page