Solved Inspect Inventories

Discussion in 'Plugin Development' started by ElmoStreet, Jul 3, 2016.

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

    ElmoStreet

    So basically, i have no code atm, but i wan't to have a book to inspect a players inventory, but i want to make it so i when i right click the player i can see like a bread for there hunger, there health, maybe if he is in gamemode, but i know how to code it, but i just need to figure out how to add items to what the staff member sees not the players inventory..
     
  2. Offline

    Zombie_Striker

    @ElmoStreet
    If you mean that the you want to click a writable-book and see stats about another, then it should be quite simple to code.
    1. onPlayerInteractEvent
    2. Get the player you are looking at.
    3. After that, create a new itemstack. The itemstack will be a written book.
    4. Using BookMeta, write all the stats in a book.
    5. After that, set the item the player clicked equal to that new book. Do this by using Player#setItem(slot, book);
     
  3. Offline

    ElmoStreet

    fixed and no
     
  4. Offline

    mc_myster

    @ElmoStreet i think that what @Zombie_Striker was actually an effective way of doing what you wanted, and if the post is solved, please mark it as solved.
     
Thread Status:
Not open for further replies.

Share This Page