API item naming questions.

  • Having some curiosities about the way we are able to reference Items.

    so i know how to get all of the different properties of an item object, like item.getName() , etc.
    but is there a good way to get a name like we would find in our inventory menu? as in "stone" instead of "ore" with Variation of 3?
    I know i could make some method to create this name, but would hate to do it for each and every item.

  • Unfortunately the API has no way to access the localized names of an item (basically the API always runs serverside, and the server doesn't have any localization). We can, however, add a clientside command to get the according item name from a localized name (so you can at least find out the correct item name), but there would be no way to trigger this command programmatically :/
    Alternatively we could offer a callback method for that (so the server asks the client for the name), but the result would depend on the game language of the client (and it would be very awkward solution)

  • ahh ok, i didn't think about the language localization side of things. was curious why it didn't exist in the Item object, but now that makes sense lol.

    perhaps i'll just go through and make a method that will use itemid and variation in order to give localized names. i've been working on an item banking / bag menu plugin.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!