#(pepper9200) Is there a way to change the length of a day or night in Denizen? Change the ticks or
29 messages · Page 1 of 1 (latest)
(pepper9200) Is there a way to change the length of a day or night in Denizen? Change the ticks or
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
I've checked some of the spigot plugins that do that and all of them disabled the gamerule doDaylightCyclead and have a loop running to set the time manually.
So in denizen it would be
!e delta time
Core
delta time hourly|minutely|secondly
every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).
every <count> seconds, minutes, or hours of game calculation time. Default repetitions count of 1.
This is specifically based on the rate of time advancement in the game server,
which is not necessarily equivalent to the real passage of time (for example, this event may fire slower if the server is lagging).
For real time, see !event system time.
<context.second> returns the exact delta time since system start.
world
time ({global}/player) [<time-duration>/reset] (<world>) (reset:<duration>) (freeze)
Changes the current time in the minecraft world.
Changes the current time in a world or the time that a player sees the world in.
If no world is specified, defaults to the NPCs world. If no NPC is available,
defaults to the player's world. If no player is available, an error will be thrown.
If 'player' is specified, this will change their personal time.
This is separate from the global time, and does not affect other players.
When that player logs off, their time will be reset to the global time.
Additionally, you may instead specify 'reset' ...
You would have to math it out, 1 second is 20 ticks and a full day in minecraft are 20 minutes -> 24000 ticks.
With that knowledge you could do:
longer_days:
type: world
debug: false
events:
on delta time secondly:
- define world <world[world_name]>
- repeat 5:
- time <[world].time.add[2]>t <[world]>
- wait 4t
waitTime = 20t / amountRepeats
timeChangePerSecond = amountRepeats * timeAddition
In this case timeChangePerSecond is 10 minecraft ticks ( 5 * 2t ) instead of 20. The total waitTime must not exceed 20t, otherwise you'll create unlimited script queues. @alpine prairie
Oh awesome. Thank you!
Wonder how this will react with the players sleeping to skip night. I’ll test it out
Since you would have to disable the gameRule doDaylightCycle, they time won't change.
!e player enters bed
Player
player enters bed
when a player enters a bed.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.location> returns the LocationTag of the bed.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
You could utilize this event and check if enough players are in beds and skip the time manually.
!e player leaves bed
Player
player leaves bed
when a player leaves a bed.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.location> returns the LocationTag of the bed.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
View the guide page 'Long Term Memory: Flags' at: https://guide.denizenscript.com/guides/basics/flags.html
When a player enters a bed, add 1 to the flag and compare that with the amount of players required inside the world.
When a player leaves a bed, sub 1 from the flag.
!t world.players
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@alpine prairie