Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Map Resets, Delays and Inventories!

Comments in 'Plugin Development' started by Samueljh1, Jan 20, 2015.

  1. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Hi guys, i thought it might be more convenient if i put this all into one thread! :)

    Basically, i want to:

    Reset My Map,
    Have some Delays (Please don't link me to the recent countdown thread, because that is not a very good way from experience),
    AND... get the players FULL inventory and store it in some way... so then i can set the player's inventory back to that variable if that makes sense ! :)

    thanks!
  2. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Ok, I've worked out the inventory part! :)

    Just for everyone else's sake:

    to get the inventory of a player as an array use: $var = $playerinstance->getInventory()->getContents();

    to set it: $playerinstance->getInventory()->setContents($var);

    This is very useful for multiworld inventories! :)

    Tell me if this helped you :D
    luca28pet likes this.
  3. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Lol any help with map resets? xD
  4. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    O yea and if u want to convert the inventory data array to a string, use:

    implode(",", $array);

Share This Page

Advertisement