How to move around rows in inventory

Discussion in 'Plugin Development' started by keto23, Dec 6, 2012.

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

    keto23

    Hi again,

    Can someone point me in the right direction on moving the items in a players inventory by rows.

    For example, If I ran a function called moveInventory(player.getInventory(), 1);
    It would:

    Move top row to second row.
    Move second row to third row.
    Move third row to hotbar.
    Move hotbar to top row.

    Any suggestions?
     
  2. Offline

    md_5

    You would have to work on the fact that inventories are what? 9 rows across?
    And then move slot 0 -> slot 9, slot 1 -> slot 10, etc etc etc.
     
  3. Offline

    keto23

    Well, Let's say you moved slot

    slot 0 -> slot 9

    Slot 9 now has slot 0's old value. We now need to do:

    slot 9 -> slot 18, that would move the original value in slot 0 to slot 18..

    Is there any way around it?
     
Thread Status:
Not open for further replies.

Share This Page