User Tools

Site Tools


mtr:development:api_reference:set_time

Setting Simulation Time (POST)

Sync the Minecraft game time to Transport Simulation Core.

Note: The example endpoint sets the time for all dimensions at once, which is probably the desired behaviour.

Schema Reference

Example Endpoint

http://localhost:8888/mtr/api/operation/set-time?dimensions=all

Field Explanation

  • gameMillis: Milliseconds elapsed since midnight of the game time (e.g. 300000 for morning in Minecraft)
  • millisPerDay: Total number of milliseconds of the game time (e.g. a Minecraft day is 20 minutes which is 1200000 milliseconds)
  • isTimeMoving: Equivalent to the doDaylightCycle gamerule in Minecraft

Example Request Body

{
    "gameMillis": 300000,
    "millisPerDay": 1200000,
    "isTimeMoving": false
}
mtr/development/api_reference/set_time.txt · Last modified: 2024/05/26 08:03 by jonafanho