Update lore in current open inventory

Discussion in 'Plugin Development' started by elementalgodz11, Feb 13, 2014.

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

    elementalgodz11

    For a lore to update the player has to reopen their inventory,

    I have tried looping through all players inventories, checking if its top view is equal to a name, then closing and reopening it, which didn't seem to work.

    Any help is appreciated, thanks
     
  2. Offline

    xTigerRebornx

    elementalgodz11 When you say "their inventory", are you referring to their PlayerInventory? If so, then try using Player#updateInventory();
     
  3. Offline

    Monkey_Swag

    Are you adding a lore to a player's item? The item in hand to be more specific? If you show me some of your code I may be able to help. I just recently did a custom enchantments plugin that needed lore updating and such.
     
  4. Offline

    DogeDev

    One way I used for a scrolling hub plugin(Stable and Working): 1) Grab the players inv when they open and store it. 2) Change the item's lore and whatever, then replace the slot with that item once its updated, no reopening involved, just setting the slot to a new value (Dont worry, this prevents stealing too, because if they take the item, its updated on close) 3) On close, update the inventory to the saved one from the first step, that way they cant steal anything from the gui, and you can change whatever items inside the inventory that you want. If this isn't what you're shooting for, then post some example code and I might be able to provide some better assistance.
     
  5. Offline

    Monkey_Swag

    does it have to be an item? I'm not even sure if it's possible (I may be wrong). Anyways, doing this with a scoreboard (in my opinion) would be much easier, and you wouldn't have to look at your item to see how many people are online for your (I believe) gamemode.
     
  6. Offline

    elementalgodz11

    DogeDev
    Thanks

    How would I be able to grab the top inventory as it's currently defaulting to the bottom.
     
  7. Offline

    DogeDev

    elementalgodz11 The inventory you created? Not sure what you're asking.
     
Thread Status:
Not open for further replies.

Share This Page