1v1 Matches

Discussion in 'Plugin Development' started by minesheep51, Sep 16, 2014.

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

    minesheep51

    How would you create a plugin where someone does some command like /pvp then if another person also does it, it teleports both of them to a premade arena to battle then after one of them die, they go back to spawn? (With multiple premade arenas that they can teleport to)

    Also, how would you create an infinite chest type plugin? If someone takes stuff from a chest, it just keeps refilling like badlion or Kohi. It seems pretty simple but i can't figure it out -_- Thanks!!
     
  2. Offline

    Epicballzy

    For the pvp thing, you would have to save the location(s) into a config. You can make a method for that, and loop through them all to grab the one you want hen tping them. So when a player types /pvp, it will tp them to that location.

    To save a players location for tping them back to their last location, save it in a hashmap. Then when someone dies, tp them to the location in the hashmap. OR, if you want to tp them to a custom loc, create another set of strings in your config for that.

    As for the chest idea, I wouldn't know. I haven't fooled around with chests.
     
  3. Offline

    d3v1n302418

    minesheep51 Just run a PlayerIntetactEvent and check if the clicked block is a chest, then put items into the chest's inventory.
     
Thread Status:
Not open for further replies.

Share This Page