Spawn In The World You Died In. NEED this. Easy? Help?

Discussion in 'Archived: Plugin Requests' started by PhoKing, Aug 29, 2013.

  1. Offline

    PhoKing

    So my server has many worlds. A Factions world, a Survival world, Creative, Minigames (parkour, survival games, mob arenas ect.). The main spawn is the default 'world', which is basically a hub that has portals to all of the different worlds.

    When people die in factions or survival, they spawn back to the main spawn which is not what we want. So, do you think anybody could be helpful and create this plugin for me? I'm sure MANY multi-world servers would use this plugin too! Very useful!

    The only problems I can think of, is when people die in Mob Arenas, or Survival Games worlds. So to solve that problem I was thinking in the config file, make it possible to list worlds that this is enabled in, then the rest of the worlds not listed it is disabled?


    If you, or anybody you know can bang this out for me, it would be MUCH appreciated!

    HUGE thanks in advance ! :D

    l8SuTGj.jpg
     
  2. Its not as easy as you may think. Any possible developer; not ruling myself out, would need to create functionality to save the spawn points for each world. Which although isn't excessively difficult, isn't without its trials.
     
  3. Offline

    NoChanceSD

    PhoKing Probably already exists some plugin with that feature but i can try to make this. Will start tomorrow since it's already late today.
     
  4. Offline

    PhoKing



    Thank you so much NoChance20! So this is the first time I've requested a plugin, totally surprised somebody decided to help me! So are you going to message me with the progress of the plugin on this thread? Or private message? Or Skype?

    And thanks again man. You rock!
     
    NoChance20 likes this.
  5. Offline

    NoChanceSD

    PhoKing I will post it here when it's done.
     
  6. Offline

    Wolfram1

    Create a new world for each minigame, it will be easier to understand.
    The whole code is very simple.

    Code:java
    1. @EventHandler
    2. public void death(PlayerRespawnEvent event){
    3. Player p = (Player) event.getPlayer();
    4. Location loc = p.getWorld().getSpawnLocation();
    5. event.setRespawnLocation(loc);


    Basically, when the player attempts to respawn, he gets teleported to the spawn of a specific world. To set the spawn just use my plugin which I will develop in 5 minutes
    Example:
    If the player dies in the FACTIONS world, he gets teleported to the spawn of the Factions world :)
    Plugin - http://dev.bukkit.org/bukkit-plugins/world-based-respawn/
    (it still needs to be approved)
     
  7. Offline

    NoChanceSD

    Well, i didn't know that in this section, kids would go ahead and ignore other posts to make a plugin.
    Good thing i didn't start yet.
     
  8. Offline

    Henzz

    Wolfram1
    There's more to that. The user will be required to set the spawn-points coordinates for each world onto the file, then save it. And using the PlayerDeathEvent, you'll check the player's current world, and see if it matches any of the worlds in the file and if it does, teleport to its saved coordinates. That's how I would approach it.
     
  9. Offline

    Wolfram1

    It's interesting how you describe "kids"

    There were literally 10 lines of simple code, is that why you're going to be depressed? Don't joke mate.

    It seems to work without the config files and the listener to PlayerDeathEvent.
    I will add those if required :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  10. Offline

    NoChanceSD

    Wolfram1 Doesn't matter if it's a lot of code or not, it's a question of respect, i wouldn't touch a plugin request where someone already said they will do it, but i guess that's just me.
     
    xxMOxMOxx, timtower and Henzz like this.
  11. Offline

    Wolfram1

    If so, you can call it not noticing.
     
  12. Offline

    CasparW

    Ill do it so when the player die's there'll get teleported to the death location
     
  13. Offline

    PhoKing


    I think one of these guys up there has got it. Thankyou anyways!
     
  14. Offline

    xxMOxMOxx

    I think you can just do this through the config file for MultiVerse
     
  15. Offline

    mathiasrocker

    Yea MultiVerse has a config where that says in every world:
    respawnworld: ''
    I have never tryed it but i think i know what it does. Try it i think it works.
     
  16. Offline

    PhoKing

    BUMP. really need this before I can open my server up -___-
     
  17. Offline

    AndyMcB1

    It's so easy, I have NO idea how to do it.

    Get some command blocks and make it yourself.
     

Share This Page