mojira.dev
MCPE-238040

world.getAbsoluteTime returns the daytime in @minecraft/server 2.7.0-beta

Steps to reproduce

  1. Create a new world with beta APIs enabled, and add the attached behaviour pack to the world.

  2. Enter the world.

  3. Notice that the time reported in chat matches the daytime instead of the absolute (game) time:

    • Locking the day-night cycle pauses the time reported in chat.

    • Setting the daytime with /time set <amount: int> changes the time reported in chat. This value can even be negative.

Expected behaviour

Calling world.getAbsoluteTime() returns the time since the start of the world, as specified by the script API documentation:

getAbsoluteTime(): number

Returns the absolute time since the start of the world.

According to the documentation, the time returned should be equal to the time given by running /time query gametime.

Actual behaviour

The time returned is instead the daytime, and matches the output of /time query daytime.

Notes

I do not know how long this bug has existed for.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media]

StrawberryJam

(Unassigned)

Unconfirmed

Windows

Windows 11

26.13

Retrieved