Skip to main content
Glama

setup_world

Configure Minecraft server world generation settings including level name, seed, world type, and difficulty to create a new world. Requires server restart after configuration.

Instructions

Configure server.properties for generating a new world. Sets the level name, seed, world type, and other generation options. The server must be restarted (with the old world deleted or renamed) to generate the new world.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
level_nameYesWorld folder name (e.g., 'world', 'creative_world')
seedNoWorld seed (blank for random)
world_typeNoWorld generation typeminecraft:normal
gamemodeNoDefault game modesurvival
difficultyNoDifficulty leveleasy
hardcoreNoEnable hardcore mode
generate_structuresNoGenerate villages, temples, etc.
generator_settingsNoJSON string for superflat/custom world generation settings
spawn_protectionNoSpawn protection radius in blocks

Implementation Reference

  • Implementation of the 'setup_world' tool. This tool configures the server.properties file with world generation settings, requiring a server restart to take effect.
    server.tool(
      "setup_world",
      "Configure server.properties for generating a new world. Sets the level name, seed, world type, and other generation options. The server must be restarted (with the old world deleted or renamed) to generate the new world.",
      {
        level_name: z.string().describe("World folder name (e.g., 'world', 'creative_world')"),
        seed: z.string().optional().describe("World seed (blank for random)"),
        world_type: z
          .enum([
            "minecraft:normal",
            "minecraft:flat",
            "minecraft:large_biomes",
            "minecraft:amplified",
            "minecraft:single_biome_surface",
          ])
          .optional()
          .default("minecraft:normal")
          .describe("World generation type"),
        gamemode: z
          .enum(["survival", "creative", "adventure", "spectator"])
          .optional()
          .default("survival")
          .describe("Default game mode"),
        difficulty: z
          .enum(["peaceful", "easy", "normal", "hard"])
          .optional()
          .default("easy")
          .describe("Difficulty level"),
        hardcore: z.boolean().optional().default(false).describe("Enable hardcore mode"),
        generate_structures: z
          .boolean()
          .optional()
          .default(true)
          .describe("Generate villages, temples, etc."),
        generator_settings: z
          .string()
          .optional()
          .describe("JSON string for superflat/custom world generation settings"),
        spawn_protection: z
          .number()
          .optional()
          .default(16)
          .describe("Spawn protection radius in blocks"),
      },
      async (params) => {
        const properties: Record<string, string> = {
          "level-name": params.level_name,
          "level-type": params.world_type.replace(":", "\\:"),
          gamemode: params.gamemode,
          difficulty: params.difficulty,
          hardcore: String(params.hardcore),
          "generate-structures": String(params.generate_structures),
          "spawn-protection": String(params.spawn_protection),
        };
    
        if (params.seed !== undefined) {
          properties["level-seed"] = params.seed;
        }
        if (params.generator_settings !== undefined) {
          properties["generator-settings"] = params.generator_settings;
        }
    
        manager.properties.setMultiple(properties);
    
        const lines = [
          `World configuration set:`,
          `  Name: ${params.level_name}`,
          `  Seed: ${params.seed || "(random)"}`,
          `  Type: ${params.world_type}`,
          `  Gamemode: ${params.gamemode}`,
          `  Difficulty: ${params.difficulty}`,
          `  Hardcore: ${params.hardcore}`,
          `  Structures: ${params.generate_structures}`,
          ``,
          `To generate this world:`,
          `1. Stop the server if running`,
          `2. Delete or rename the existing world folder ("${params.level_name}") if it exists`,
          `3. Start the server - it will generate a new world with these settings`,
        ];
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );

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