Skip to main content
Glama

fill_blocks

Fill a defined 3D region in Minecraft with blocks using coordinates and block IDs, supporting modes like replace, hollow, or outline for world editing.

Instructions

Fill a region with blocks. Uses the /fill command. Max 32,768 blocks per operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
x1YesStart X
y1YesStart Y
z1YesStart Z
x2YesEnd X
y2YesEnd Y
z2YesEnd Z
blockYesBlock ID
modeNoFill modereplace

Implementation Reference

  • The handler function for the fill_blocks tool which executes the fill command via RCON.
    async ({ x1, y1, z1, x2, y2, z2, block, mode }) => {
      try {
        const response = await manager.rcon.send(
          `fill ${x1} ${y1} ${z1} ${x2} ${y2} ${z2} ${block} ${mode}`
        );
        return { content: [{ type: "text", text: response }] };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema for the fill_blocks tool.
    {
      x1: z.number().describe("Start X"),
      y1: z.number().describe("Start Y"),
      z1: z.number().describe("Start Z"),
      x2: z.number().describe("End X"),
      y2: z.number().describe("End Y"),
      z2: z.number().describe("End Z"),
      block: z.string().describe("Block ID"),
      mode: z
        .enum(["destroy", "hollow", "keep", "outline", "replace"])
        .optional()
        .default("replace")
        .describe("Fill mode"),
    },
  • Registration of the fill_blocks tool with the MCP server.
    server.tool(
      "fill_blocks",
      "Fill a region with blocks. Uses the /fill command. Max 32,768 blocks per operation.",
      {
        x1: z.number().describe("Start X"),
        y1: z.number().describe("Start Y"),
        z1: z.number().describe("Start Z"),
        x2: z.number().describe("End X"),
        y2: z.number().describe("End Y"),
        z2: z.number().describe("End Z"),
        block: z.string().describe("Block ID"),
        mode: z
          .enum(["destroy", "hollow", "keep", "outline", "replace"])
          .optional()
          .default("replace")
          .describe("Fill mode"),
      },

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