#(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)

alpine prairie
#

Not many good plugins that do this and would love to be able to just script it.

wary quiverBOT
#

(pepper9200) Is there a way to change the length of a day or night in Denizen? Change the ticks or

wary quiverBOT
#

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.

pastel plume
#

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

regal tangleBOT
# pastel plume !e delta time
Group

Core

Event Lines

delta time hourly|minutely|secondly

Switches

every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).

Triggers

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

<context.second> returns the exact delta time since system start.

pastel plume
#

!c time

regal tangleBOT
# pastel plume !c time
Group

world

Syntax

time ({global}/player) [<time-duration>/reset] (<world>) (reset:<duration>) (freeze)

Short Description

Changes the current time in the minecraft world.

Description

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' ...

pastel plume
#

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

alpine prairie
#

Oh awesome. Thank you!

#

Wonder how this will react with the players sleeping to skip night. I’ll test it out

pastel plume
#

Since you would have to disable the gameRule doDaylightCycle, they time won't change.

#

!e player enters bed

regal tangleBOT
# pastel plume !e player enters bed
Group

Player

Event Lines

player enters bed

Triggers

when a player enters a bed.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.location> returns the LocationTag of the bed.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

pastel plume
#

You could utilize this event and check if enough players are in beds and skip the time manually.

#

!e player leaves bed

regal tangleBOT
# pastel plume !e player leaves bed
Group

Player

Event Lines

player leaves bed

Triggers

when a player leaves a bed.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.location> returns the LocationTag of the bed.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

pastel plume
#

Using a world flag.

#

!guide long term memory

regal tangleBOT
pastel plume
#

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

regal tangleBOT
polar copperBOT
#
Thread Closing Reminder

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