Social-Respawn 1.2

Brings You Back To the World You Died In

    Tested Minecraft Versions:
    • 1.9
    • 1.10
    Please Remember To Rate This Plugin
    Please Be Honest, Please do not post bugs as reviews post them in the discussion tab above.

    --------------------{Command and Permissions}--------------------​

    TESTED ON 1.9.4


    description: Sets the spawn point for that world
    permission: social.swset (OPS)

    --------------------{Planned To Add}--------------------​

    • Not Sure At The Moment

    --------------------{Known Bugs}--------------------​

    • If you have essentials spawn and multiverse together this plugin wont work

    • Remove Essentials Spawn
    • Open commands.yml in main directory and change/edit your config
    Code (Text):
    # This is the commands configuration file for Bukkit.
    # For documentation on how to make use of this file, check out the Bukkit Wiki at
    # If you need help on this file, feel free to join us on irc or leave a message
    # on the forums asking for advice.
    # IRC: #spigot @
    #    (If this means nothing to you, just go to )
    # Forums:
    # Bug tracker:

    command-block-overrides: []
      - version $1-
      - "mvspawn"
    • Restart/Start Your server
    --------------------{Open Source Code}--------------------
    If you use this source code please let me know. Thanks :)
    Code (Text):


    import java.util.Set;
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.Server;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.PluginCommand;
    import org.bukkit.configuration.ConfigurationSection;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerRespawnEvent;
    import org.bukkit.plugin.PluginManager;

    public class respawn
      extends JavaPlugin
      implements Listener
      private final ChatColor GREEN = ChatColor.GREEN;
      private Set<String> allowedWorlds;
      public void onEnable()
        getServer().getPluginManager().registerEvents(this, this);
        this.allowedWorlds = getConfig().getConfigurationSection("worlds").getKeys(false);
      @EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)
      public void onDeath(PlayerRespawnEvent event)
        Player player = event.getPlayer();
        if ((this.allowedWorlds.size() > 0) && (this.allowedWorlds.contains(player.getWorld().getName())))
          player.sendMessage(this.GREEN + "You respawned in the same world.");
      public boolean onCommand(CommandSender sender, Command cmd, String lbl, String[] args)
        if (!(sender instanceof Player)) {
          return true;
        Player player = (Player)sender;
        Location loc = player.getLocation();
        Location underneath = loc.subtract(0.0D, 1.0D, 0.0D);
        if ((cmd.getName().equalsIgnoreCase("swset")) &&
          (args.length == 0))
          if ((underneath.getBlock() == null) || (underneath.getBlock().getType() == Material.AIR))
            player.sendMessage(this.GREEN + "Cannot save spawn point on nothing.");
            return true;
          player.sendMessage(this.GREEN + "Successfully saved new spawn point.");
        return true;
      private void saveSpawn(Location loc)
        getConfig().set("worlds." + loc.getWorld().getName() + ".x", Integer.valueOf(loc.getBlockX()));
        getConfig().set("worlds." + loc.getWorld().getName() + ".y", Integer.valueOf(loc.getBlockY()));
        getConfig().set("worlds." + loc.getWorld().getName() + ".z", Integer.valueOf(loc.getBlockZ()));
        getConfig().set("worlds." + loc.getWorld().getName() + ".yaw", Float.valueOf(loc.getYaw()));
        getConfig().set("worlds." + loc.getWorld().getName() + ".pitch", Float.valueOf(loc.getPitch()));
      private Location getLocation(String path)
        int x = getConfig().getInt("worlds." + path + ".x");
        int y = getConfig().getInt("worlds." + path + ".y");
        int z = getConfig().getInt("worlds." + path + ".z");
        float yaw = (float)getConfig().getDouble("worlds." + path + ".yaw");
        float pitch = (float)getConfig().getDouble("worlds." + path + ".pitch");
        return new Location(Bukkit.getWorld(path), x + 0.5D, y, z + 0.5D, yaw, pitch);


    Please note: If you find any bugs please post them in the discussion area.
    All my plugins are coded and compiled in java 8 and only for Spigot 1.9 and above

    If you are also a coder who wants to help me fix bugs and or tweak anything let me know what I should change or add.

Recent Updates

  1. Updated to 1.10
  2. Plugin name spelling mistake