Package org.bukkit.entity

Examples of org.bukkit.entity.Player.teleport()


    public boolean teleport(final String playerName, final String worldName, final double x, final double y,
            final double z) {
        final Player player = Bukkit.getPlayer(playerName);
        final World world = Bukkit.getWorld(worldName);
        if (player != null && world != null) {
            player.teleport(new Location(world, x, y, z));
            return true;
        }
        return false;
    }
View Full Code Here


    for (AutoRefPlayer apl : getPlayers())
    {
      Player player = apl.getPlayer();
      if (player != null && !getMatch().inStartRegion(player.getLocation()))
        player.teleport(getMatch().getPlayerSpawn(player));

      apl.heal();
      apl.updateCarrying();
    }
View Full Code Here

    {
      Location loc = player.getLocation();
      event.setCancelled(true);

      if (loc.getY() < -64 && event.getCause() == DamageCause.VOID)
        player.teleport(match.getPlayerSpawn(player));
      player.setFallDistance(0);
    }
  }

  @EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled=true)
View Full Code Here

    if (apl == null)
    {
      // if the player is not on a team and has left the start area, teleport back
      if (!match.isSpectator(player) && !match.inStartRegion(event.getTo()) && onGround)
      {
        player.teleport(match.getWorldSpawn());
        player.setFallDistance(0.0f);
      }
      return;
    }
View Full Code Here

    Player player = (Player) event.getEntity();
    Location loc = player.getLocation();

    if (loc.getY() < -64 && event.getCause() == EntityDamageEvent.DamageCause.VOID)
      player.teleport(plugin.getLobbyWorld().getSpawnLocation());
    player.setFallDistance(0);
  }

  private static Map<Class<? extends Entity>, String> entityRenames = Maps.newHashMap();
  static
View Full Code Here

    if (cleardrops) this.clearInventory();

    // "die" when the match isn't in progress just means a teleport
    if (!getMatch().getCurrentState().inProgress())
    {
      player.teleport(getMatch().getPlayerSpawn(player));
      player.setFallDistance(0.0f);
    }

    else
    {
View Full Code Here

    // if this player is "in limbo" (logged into an unloaded world)
    if (player.hasPlayedBefore() && playerLimboLogin.remove(player.getName()))
    {
      World newWorld = plugin.getLobbyWorld();
      if (newWorld == null) newWorld = Bukkit.getWorlds().get(0);
      player.teleport(newWorld.getSpawnLocation());
    }

    if (player.getWorld() == plugin.getLobbyWorld())
    {
      if (!player.hasPlayedBefore())
View Full Code Here

    }

    if (player.getWorld() == plugin.getLobbyWorld())
    {
      if (!player.hasPlayedBefore())
        player.teleport(player.getWorld().getSpawnLocation());
      PlayerUtil.setGameMode(player, GameMode.ADVENTURE, true);
      PlayerUtil.reset(player);
    }
  }
View Full Code Here

      if (match.isReferee(player))
        match.updateReferee(player);

      if (!player.hasPlayedBefore())
        player.teleport(match.getPlayerSpawn(player));
    }
  }

  @EventHandler
  public void playerQuit(PlayerQuitEvent event)
View Full Code Here

        // player teleport target (optional)
        String target = options.getOptionValue('t');
        if (target != null && !target.isEmpty())
        {
          AutoRefPlayer apl = match.getPlayer(target);
          if (apl != null) player.teleport(apl.getLocation());
        }
        // if no player is specified, show teleport menu
        else showPlayerTeleportMenu(player);
      }
      // if no options are given, show practice menu
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.