Skip to main content
Glama

set_time

Change Minecraft world time using preset options like day, night, or custom tick values to control lighting and gameplay conditions.

Instructions

Set the world time. Presets: 'day' (1000), 'noon' (6000), 'sunset' (12000), 'night' (13000), 'midnight' (18000), 'sunrise' (23000). Or use a tick value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeYesTime value: 'day', 'noon', 'sunset', 'night', 'midnight', 'sunrise', or a tick number (0-24000)

Implementation Reference

  • The "set_time" tool is registered and implemented in src/tools/command-tools.ts. It takes a time string (preset or tick value), resolves it to a tick number, and sends a "time set" command via RCON.
    server.tool(
      "set_time",
      "Set the world time. Presets: 'day' (1000), 'noon' (6000), 'sunset' (12000), 'night' (13000), 'midnight' (18000), 'sunrise' (23000). Or use a tick value.",
      {
        time: z
          .string()
          .describe("Time value: 'day', 'noon', 'sunset', 'night', 'midnight', 'sunrise', or a tick number (0-24000)"),
      },
      async ({ time }) => {
        const presets: Record<string, string> = {
          day: "1000",
          noon: "6000",
          sunset: "12000",
          night: "13000",
          midnight: "18000",
          sunrise: "23000",
        };
        const value = presets[time.toLowerCase()] ?? time;
        try {
          const response = await manager.rcon.send(`time set ${value}`);
          return { content: [{ type: "text", text: response }] };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tamo2918/Minecraft-Server-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server