Solved Getting an item's natural name

Discussion in 'Plugin Development' started by Blue_Blaze72, May 15, 2014.

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

    Blue_Blaze72

    Hello bukkiteers!

    I'm currently working on a plugin where I need to turn an ItemStack into a player friendly string. The main issue comes for items with damage values. With a bit of formatting it's fine and easy to turn the Material Enum of most items into a good string, but items with damage values are much harder. I was hoping there might be a way to grab the natural name of an item. For example, I want the cocoa beans to be called cocoa beans instead of Ink_Sack:3 and I'd prefer mob spawn eggs be named after their mob name rather than a damage value.

    The only way I can think to do this would involve an immense and inefficient amount of hard coding, so I would appreciate if someone could point me to a method that might accomplish what I seek.
     
  2. Offline

    metalhedd

    NathanWolf and Blue_Blaze72 like this.
  3. Offline

    Blue_Blaze72

    thanks a bunch! I'll give it a try =)
     
  4. Offline

    metalhedd

    If you use the translatableFrom* methods, and some raw Chat packets, you can let the client translate the strings into their own language too :)
     
  5. Offline

    AstramG

    metalhedd Thank's man, that's pretty useful.
     
Thread Status:
Not open for further replies.

Share This Page