CommandBlock: {
    type: "compound";
    value: {
        Command: { type: "string"; value: string };
        CustomName: { type: "string"; value: string };
        ExecuteOnFirstTick: { type: "byte"; value: number };
        LastExecution: { type: "long"; value: [high: number, low: number] };
        LastOutput: { type: "string"; value: string };
        LastOutputParams: {
            type: "list";
            value: { type: "string"; value: string[] };
        };
        SuccessCount: { type: "int"; value: number };
        TickDelay: { type: "int"; value: number };
        TrackOutput: { type: "byte"; value: number };
        Version: { type: "int"; value: number };
    };
}

NBT structure of [command block](https://minecraft.wiki/w/command block) and [minecart with command block](https://minecraft.wiki/w/minecart with command block).

Type declaration

  • type: "compound"
  • value: {
        Command: { type: "string"; value: string };
        CustomName: { type: "string"; value: string };
        ExecuteOnFirstTick: { type: "byte"; value: number };
        LastExecution: { type: "long"; value: [high: number, low: number] };
        LastOutput: { type: "string"; value: string };
        LastOutputParams: {
            type: "list";
            value: { type: "string"; value: string[] };
        };
        SuccessCount: { type: "int"; value: number };
        TickDelay: { type: "int"; value: number };
        TrackOutput: { type: "byte"; value: number };
        Version: { type: "int"; value: number };
    }
    • Command: { type: "string"; value: string }

      The command entered into the command block.

    • CustomName: { type: "string"; value: string }

      The custom name or hover text of this command block.

    • ExecuteOnFirstTick: { type: "byte"; value: number }

      1 or 0 (true/false) - true if it executes on the first tick once saved or activated.

    • LastExecution: { type: "long"; value: [high: number, low: number] }

      Stores the time when a command block was last executed.

    • LastOutput: { type: "string"; value: string }

      The translation key of the output's last line generated by the command block. Still stored even if the gamerule commandBlockOutput is false. Appears in the command GUI.

    • LastOutputParams: { type: "list"; value: { type: "string"; value: string[] } }

      The params for the output's translation key.

    • SuccessCount: { type: "int"; value: number }

      Represents the strength of the analog signal output by redstone comparators attached to this command block.

    • TickDelay: { type: "int"; value: number }

      The delay between each execution.

    • TrackOutput: { type: "byte"; value: number }

      1 or 0 (true/false) - true if the LastOutput is stored. Can be toggled in the GUI by clicking a button near the "Previous Output" textbox.

    • Version: { type: "int"; value: number }

      The data version.