[Homes] Use beds to set your home [Semi-Formatted]

Discussion in 'Archived: Plugin Requests' started by ggmike, Jun 21, 2012.

  1. Offline

    ggmike

    Title: Homebeds

    What I want: A plugin that will allow players to set their homes by righ-clicking on a bed without sleeping. Keep a log file with the location of each players house. Have a small delay like 5 sec till you set your house.

    Similar: I used the spawnbed plugin but with the resent update it stopped working so I really need a new one!

    No commands or permissions.
     
  2. Offline

    Lonesface

    I'm pretty sure vanilla Minecraft does this already.. Unless what you want is more of setting a /home from clicking a bed?
     
  3. Offline

    ggmike

    Exactly...
     
  4. Offline

    CarrotPCdude

    If vanilla doesn't do this already, the Essentials has this feature. (It does also have lots of other things, but many of them are very useful)
     
  5. Offline

    ggmike

    Well I want it so that when the bed breaks the home will be reseted which is not included in any of these...
     
  6. Offline

    Lonesface

    I'm pretty sure vanilla does this already. Anyhow, essentials does all that you want.
     
  7. Offline

    ggmike

    I know but I want a warm up or like "Click again in under 5 sec to set your home" so that people wont' accidentally place their home somewhere they don't want to.

    And also I want it to have a log file with the coords of each players home.
     
  8. If your using essentials then try

    /home bed
     
  9. Offline

    Lonesface

    Well.. That's not at all what you said before.
     
  10. Offline

    PhoenixFlight

    Code:
    public class Idgaf extends JavaPlugin {
      private final ArrayList<Player> defining;
      public void onEnable() {
        defining = new ArrayList<Player>();
        getServer().getPluginManager().registerEvents(new Whatever(), this);
      }
     
      public void onDisable() {
        try {
          File f = new File("plugins/whatever/log.txt");
          if(!f.exists())
            f.createNewFile();
          FileWriter fw = new FileWriter(new FileOutputStream(f));
          for(Player p : getServer().getOnlinePlayers())
            fw.write(p.getName() + " -- " + p.getBedRespawnLocation().toString());
          for(Player p : getServer().getOfflinePlayers())
            fw.write(p.getName() + " -- " + p.getBedRespawnLocation().toString());
          fw.close();
        } catch(IOException ex) {
          ex.printStackTrace();
        }
      }
     
      public void onCommand(CommandSender sender, [other crap here]) {
        if(command.getName().equalsIgnoreCase("home")) {
          if(sender instanceof Player && ((Player)sender).getBedRespawnLocation() != null) {
            ((Player)sender).teleport(((Player)sender).getBedRespawnLocation());
            return true;
          }
        }
        return false;
      }
     
      private class Whatever() implements Listener {
        @EventHandler
        public void onInteract(final PlayerInteractEvent event) {
          if(event.getClickedBlock() == null)
            return;
          if(event.getClickedBlock().getMaterial() == Material.BED) {
            if(!defining.contains(event.getPlayer()) {
              getServer().scheduleAsyncDelayedTask(new Runnable() {
                public void run() {
                  if(defining.contains(event.getPlayer())
                    defining.remove(event.getPlayer());
                }
              }, 100L);
              event.getPlayer().sendMessage("Click the bed again to confirm your home selection.");
              event.setCancelled(true);
            } else {
              defining.remove(event.getPlayer());
            }
          }
        }
      }
    }
    
    Not sure if that'll even compile... I didn't feel like opening an IDE. Still, that's the basic idea of it, I guess.
     
  11. Offline

    ggmike

    Not sure what this is...
    Can somebody make a plugin that has these features?
    *Needs double click under 5 sec for the home to be set on that bed
    *Leave a msg ("Your bed has been set")
    *Keep a log file with everyones homes.
     
  12. Offline

    Konkz

    [​IMG]

    I found a plugin that does this already, not 'SimpleBed' use google etc.
     
  13. Offline

    ggmike

    Sorry but I can't find one with those features... anybody able of making one please. I really need it.
     
  14. Offline

    ggmike

    No answer yet...
     
  15. Offline

    ggmike

    Please guys I really need such a plugin!
    It's a must for my server!
     

Share This Page