Filled gametimeCommands

Discussion in 'Plugin Requests' started by madtomic, Jun 27, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    madtomic

    Plugin category: Mechnical

    Minecraft version: 1.12.2

    Suggested name:
    gametimeCommands

    What I want: I would like a plugin that would run a schedule task base on in-game time, run a list of commands and for all the players online at that time. Then logs the players it ran the task for.

    Task1:
    time: 0 #in Minecraft ticks, game time is 06:00
    commands:
    - say hello {player}
    - say here are some rewards
    - commandone {player} 1
    - commandtwo give {player} 10

    - This task is run every day on game time 0 or 06:00
    - All command is ran on console
    - {player} would be the list of all current online players
    - Everyone online at this time when the task is run would get all the commands ran for them.

    This list of players is logged each time the task is ran.

    ./logs/timestamp.yml

    Time:
    Players:
    playerone/uuid
    playertwo/uuid

    Minecraft time
    https://minecraft.gamepedia.com/Day-night_cycle

    Commands/Permissions: none

    Thank you for reading.
     
    Last edited: Jun 27, 2019
  2. Offline

    KarimAKL

    @madtomic I'm almost done with this plugin, i'll post a link to download it when i'm done.
     
  3. Offline

    madtomic

  4. Offline

    KarimAKL

    Should be done.
    Link: https://www.dropbox.com/s/0kgxfjl6p5x5h6b/GameTimeCommands.jar?dl=0

    Notes:
    1. In your example you didn't mention world names, and because the time is stored in the world i needed to get a world; so inside the 'tasks.yml' file you'll find it looks like this:
    Code:
    worldName:
      '0':
      - say hello {player}
      - say here are some rewards
    When the file is created it'll have these default values. 'worldName' will be replaced with the first world gotten from the list of worlds on the server.
    2. The 'config.yml' file will look like this:
    Code:
    Per-World-Commands: false
    Format: "dd-MM-yyyy HH꞉mm"
    ZoneID: "UTC"
    'Per-World-Commands' is a boolean that chooses whether the commands are run for all players on the server, or in the world.
    'Format' is the name of the log files created. Note that because file names cannot have a colon ( : ), i chose to set it to '꞉' by default. You can get the character here, it's name is "Modifier Letter Colon"
    'ZoneID' is the name of the time zone to use. By default it's "UTC" (+0)

    If you want anything changed or it's not working, let me know. :)
     
    madtomic likes this.
  5. Offline

    madtomic

    @KarimAKL

    One minor tweak is when sending messages.
    - say hello {player}
    - say here are some rewards

    These messages should be sent to the receiving player once. There is no need to send and repeat for each player.

    example two players online.
    playerone
    playertwo

    playerone would see
    [Server] hello playerone
    [Server] here are some rewards
    [Server] hello playertwo
    [Server] here are some rewards

    The 2nd message sets is not necessary.

    Thanks again!
     
  6. Offline

    KarimAKL

    @madtomic If i understand correctly then that has nothing with the plugin to do. The command '/say' broadcasts to the console and all online players, no matter which player is specified.
    EDIT: Btw, i made it so if you change the gamerule 'doDaylightCycle' to 'false', it'll only execute the commands once. That way you don't get spammed if the time stays on one specific tick all the time.
     
  7. Offline

    madtomic

    @KarimAKL

    doDaylightCycle - thanks for adding this check.

    The way it does now this setup. All the online player would trigger this same task once per player. So all online player would receive the say messages for each player that is online. I hope that is more clear what the issue is.

    Code:
    worldName:
      '0':
      - say hello {player}
      - say here are some rewards
     
    Last edited: Jun 30, 2019
  8. Offline

    KarimAKL

    @madtomic I understand your issue, try changing the commands to these:
    Code:
    - msg {player} hello {player}
    - msg {player} here are some rewards
    I think the problem is that the '/say' command tells everyone on the server, the problem isn't with the plugin.
     
    madtomic likes this.
  9. Offline

    madtomic

    @KarimAKL

    I see what you mean now. Thanks again!
     
    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page