1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript Event Help

Discussion in 'Skript' started by WatchBOT, Sep 4, 2017.

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

    WatchBOT New Member

    Joined:
    Sep 4, 2017
    Messages:
    7
    Likes Received:
    0
    Skript Version: Latest
    Minecraft Version: 1.9.2

    ---
    Is there an event that detects a time change, and what addons adds this?
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Well in vanilla skript there's periodical events - every <timespan>
    Code ( (Unknown Language)):
    1. every 10 minutes:
    2.     #do something
    not sure if thats what youre looking for or what
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    I wouldn't recommend them, periodical events are known to be laggy and shouldn't be used. It's better to do a while loop on the skript load event.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    No, the event im looking for should be something like On Weather Change, but with time.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Well, time changes every tick so...
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Well in the world I currently want to create my skript I have the gamerule DoDaylightCycle turned off. Therefor I wanted to create skript which could detect whenever someone executed a time changing command and cancel it:
    Code (Skript):
    1. On Time Change:
    2.        cancel event
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Code (Skript):
    1. on command "/time":
    2.     cancel event# im not sure if this works else
    3.     make console execute command "/time set 0"
    4.     send "Nah dude! Stap!"
     
    • Like Like x 1
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    it does. You can also cancel all commands if you don't specify a command on the event.

    The problem with your code is that it only disables a command, if the time changes by other means this code won't disallow it.

    You can apply the code to every command that changes time but that's tedious if there are a bunch. Anyway, that's probably the best guess.

    Using packets perhaps, disable the sending of that packet for example?
     
    • Like Like x 1
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Alright thanks everyone who helped! If anyone has any other ideas please submit them :emoji_grinning:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...