Posts by nobotious

A new update is now available, introducing a lot of new content!
Latest hotfix: 0.7.5.1 (2024-09-02)

    it is tempting Miwarre, once i get the rest of the plugin hashed out, i'll let you know. i still have to work on a few things, and then i'll go on to how i plan to improve the gui.
    this may also extend into the territory of player made shops, but that is still a ways away yet. if I went that route i would likely tie into your currency back-end too haha.

    Figured i'd make a placeholder thread for a project I've been working on. :D


    i've been working on a Gui Based item storage system, with a dual-pane GUI.
    left-side will list all the items in your quickbar, and when clicked will deposit them into your bank/bag.
    right-side will list all items in your bank/bag (in pages) with quantity, and when clicked will put one of said item into your inventory, and when shift-clicked will move a stack.



    Its still incredibly early, and not quite near finish, but I will post it as soon as it is!


    (I know it looks incredibly ugly right now, just working on the back-end primarily and will polish the gui when its ready to release)

    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.

    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.

    i apologize if this seems dumb as i'm pretty new to all of this lol, but perhaps for now we could simply to try work with player attributes for a few things?


    example: a players "currency" value being something along the line of:


    player.setAttribute("modthathandlescurrency_currency", whatever_value)


    or say a player enters a zone, have the area protection mod run something along:


    player.setAttribute("modthathandlesareas_current_area", "name of current area")



    i'm obviously over-simplifying this, and would love to see better inter-plugin communication, but just temporarily maybe come up with some sort of attribute naming convention lol, and provide a list of attributes that your plugin creates/uses.

    not sure its an error on my end now, but it seems to still be returning max stack size. (done after the 11/2/2016 bugfix)


    method i made up to get a total count of an item in a players inventory:



    Upon looking at Gui stuff in the api more, I'm guessing that:


    GuiPanel = "background object"


    GuiLabel = "text object"


    GuiImage = "image object"


    and all are considered elements?


    still kinda new at this stuff. I'm sure i'll get it straight when the api fully drops lol.

    Damn, as i had first envisioned the GuiPanel, I was expecting something alongside how a player or chest inventory was drawn. this is a functionality that I would love to see.

    Hoping to do the following: (unsure if i can quite do with the API in its current state, will have to experiment)


    "bags" mod. the mod will allow you to press a key to open a "bag". the bag will either be:


    A. a gui based off of items whose data is stored in an SQL database, that is accessible by pressing the "bag" key
    (Not Possible at this moment with the API, at least how i envisioned it)


    OR


    B. an existing chest in the world, which can be accessed anywhere by pressing the "bag" key
    (not 100% sure its possible yet, but would have to more or less have the bag key "cause" a player interaction event tied to an existing chest)
    have started making some basic classes for it, but mostly waiting for api to release. :)

    understood. its been somewhat of a learning experience here working with hashmaps. a good learning experience though!


    I'm very excited for the api to release. I'm working on making a "bag" that you can open via a command, it will be tied to an existing world chest (not sure on some specifics of this yet), or it will be stored via an sql database. whichever ends up being the laziest way haha. so a player types said command, and an inventory pops up as if you've opened a chest. (even if i can't quite do it with the api as-is, its a good learning platform).

    still not 100% sure if my usage is correct, but i did realise i wasn't using " " around the variable. once i did the errors went away. so maybe fixed haha.


    also thank you Miwarre!, that helps.

    So to start off, i'll let you know for starters that i'm very new to java, as well as a few programming concepts.


    so I'm working on a project, and trying to use player.setAttribute, and player.getAttribute. from what i can tell these can save a value to a hashmap, and pull said value from said hashmap.


    i'm having trouble with .getAttribute.


    sample code for what i'm doing


    so and so odd thing is done, and saves something to a players Attribute.


    if(blah == 1){ player.setAttribute(testattribute, 1);
    }


    this part seems to "work"


    however i'm having problems pulling the Attribute with getAttribute


    Object test = player.getAttribute(testattribute);


    i get the error "testattribute cannot be resolved to a variable"


    i'm 95% sure i'm doing something wrong haha. if anyone could help point me in the right direction i'd love it! :):):)