Filled teleport after join/login to spawn

Discussion in 'Archived: Plugin Requests' started by dazzlepoint, Aug 17, 2013.

  1. Offline

    dazzlepoint

    is there a plugin that you teleport to the spawn when you join or login ? can you make it for me ? THANX
     
  2. Offline

    MayoDwarf

    Essentials lol?
     
  3. Offline

    dazzlepoint

    Ok THANX i check it tommorow
     
  4. Offline

    MayoDwarf

    np
     
  5. Offline

    dazzlepoint

    I mean it's for players that already have joined the server and not for new players or newbies
     
  6. Offline

    Venican

    Coding this now. :)
     
  7. Offline

    MayoDwarf

     
  8. Offline

    Venican

  9. Offline

    dazzlepoint

    it works but I use a plugin (world portal) that you teleport to other worlds, is it possible that the plugin teleports you to the global spawn ?

    srry it's oké THANX

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

    Venican

    Sorry but i am not a very good coder. I hope someone else could help you with that. Anyway here is the code:
    Code:java
    1. package me.Venican.JoinSpawn;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.entity.Player;
    5. import org.bukkit.event.EventHandler;
    6. import org.bukkit.event.EventPriority;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.player.PlayerJoinEvent;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class JoinSpawn extends JavaPlugin implements Listener {
    12. public void onEnable() {
    13. Bukkit.getServer().getPluginManager().registerEvents(this, this);
    14. }
    15. public void onDisable() {
    16.  
    17. }
    18. @EventHandler(priority = EventPriority.HIGHEST)
    19. public void onPlayerJoin(PlayerJoinEvent event) {
    20. Player player = event.getPlayer();
    21. player.performCommand("spawn");
    22. }
    23. }
    24.  
     
  11. Offline

    timtower Administrator Administrator Moderator

    Venican Use this.getServer().getWorld(<worldname here>).getSpawnLocation()
    Then teleport the player to that spot
     
  12. Offline

    Venican

    Look, i made so the player performs the command /spawn.
     
  13. Offline

    timtower Administrator Administrator Moderator

    I noticed, my thing is an enhancement ( take it or leave it, your plugin not mine ;) )
     
  14. Offline

    Venican

    Thank you anyway. :)
     
    timtower likes this.
  15. Offline

    jsprouts

    You can use this plugin: http://dev.bukkit.org/bukkit-plugins/tplogin/
    It will tp every player to the designated spawn no matter which world they are in or if they are new or old.
    I use it on my server and I can guarantee that it works.
     

Share This Page