"/ptime day" "/ptime night"

Discussion in 'Spigot Plugin Help' started by beyonddead, May 26, 2015.

  1. So after a few extensive google searches of...

    "playertime spigot"
    "personaltime spigot"
    "ptime day" "ptime night"

    I just can't find a plugin that modifies the client-side of a player's day time.

    This is huge on most creative servers, so I'm trying to find it.

    Thanks!
     
  2. Main Class:

    Code (Text):
    package fr.Skud31.Time;

    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener{
     
       public void onEnable(){
         getServer().getPluginManager().registerEvents(this, this);
         getCommand("time").setExecutor(new Commands(this));
       }

    }

    Command Class:


    Code (Text):
    package fr.Skud31.Time;

    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;

    public class Commands implements CommandExecutor{
     
       public Main plugin;
     
       public Commands(Main plugin){
         this.plugin = plugin;
       }
     
       public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]){
       
         if(sender instanceof Player){
         
           Player p = (Player) sender;
         
           if(label.equalsIgnoreCase("time")){
             if(args.length == 0){
               p.sendMessage(ChatColor.RED + "You have to specify argument.");
               return true;
             }
             if(args[0].equalsIgnoreCase("day")){
               p.setPlayerTime(6000, true);
               p.sendMessage("You set day");
             }
             if(args[0].equalsIgnoreCase("night")){
               p.setPlayerTime(15000, true);
               p.sendMessage("You set the night");
             }
           }
         
         }else{
           sender.sendMessage(ChatColor.RED + "You have to be a player to do that.");
         }
       
         return true;
       }
     
    }
     
    Plugin.yml:

    name: Time
    version: 1.0
    author: Skud31
    main: fr.Skud31.Time.Main
    commands:
    time:
    description: set your own time

    ________________

    Sorry for my bad english I'm french :3
     
    • Like Like x 2
  3. Its essentials, essentials.ptime is the permission
     
  4. This would work but I believe it is unnecessary if you have Essentials.
     
  5. STX

    STX

    Good day !, like you, I tried to look for a plugin that meets what you need, unfortunately I did not find it, but the closest to your request may be the following plugin: https://www.spigotmc.org/resources/dimensionchanger-skychanger.2567/
    The advantage of this plugin is that you can set the dimension to a world or a player. Try to put it at -1.
    I hope I have helped. (Although its inconvenience was a year ago)
     
    • Optimistic Optimistic x 1