Preventing people from falling into the void?

Discussion in 'Bukkit Help' started by Misteroe, Jun 9, 2014.

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

    Misteroe

    Hello. I have a server with a spawn that floats in the void. I would like to find a way to either teleport them back to spawn when the fall off, or some other alternative.

    Thanks. :D
     
  2. Offline

    Vintage_Gamer

    Code:
      @EventHandler
      public void onDeath(PlayerDeathEvent event)
      {
        Player player = event.getEntity();
        if (player.getWorld().getName().contains("[U][I][B]WORLD NAME[/B][/I][/U]"))
        {
          player.setHealth(20.0D);
          player.setSaturation(20.0F);
          player.teleport(new Location(player.getWorld(), xD, yD, zD));
        }
      }
    }
    
    The code above works for me, you will need to change some of it tho.

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

    Azubuso

    Vintage_Gamer Not really the right section for that, and I doubt that's what he's looking for...

    Misteroe There's a bunch of plugins out there that'll do this for you, here's one.
     
  4. Offline

    iCreeper902

  5. Offline

    Vintage_Gamer

    Eclipse.
     
  6. Offline

    iCreeper902

Thread Status:
Not open for further replies.

Share This Page