MonsterSpawner: {
    type: "compound";
    value: {
        Delay: { type: "short"; value: number };
        DisplayEntityHeight: { type: "float"; value: number };
        DisplayEntityScale: { type: "float"; value: number };
        DisplayEntityWidth: { type: "float"; value: number };
        EntityIdentifier: { type: "string"; value: string };
        MaxNearbyEntities: { type: "short"; value: number };
        MaxSpawnDelay: { type: "short"; value: number };
        MinSpawnDelay: { type: "short"; value: number };
        RequiredPlayerRange: { type: "short"; value: number };
        SpawnCount: { type: "short"; value: number };
        SpawnData?: {
            type: "compound";
            value: {
                Properties: { type: "compound"; value: object };
                TypeId: { type: "string"; value: string };
                Weight: { type: "int"; value: number };
            };
        };
        SpawnPotentials?: {
            type: "list";
            value: {
                type: "compound";
                value: {
                    Properties: { type: "compound"; value: object };
                    TypeId: { type: "string"; value: string };
                    Weight: { type: "int"; value: number };
                }[];
            };
        };
        SpawnRange: { type: "short"; value: number };
    };
}

NBT structure of a [monster spawner](https://minecraft.wiki/w/monster spawner).

Type declaration

  • type: "compound"
  • value: {
        Delay: { type: "short"; value: number };
        DisplayEntityHeight: { type: "float"; value: number };
        DisplayEntityScale: { type: "float"; value: number };
        DisplayEntityWidth: { type: "float"; value: number };
        EntityIdentifier: { type: "string"; value: string };
        MaxNearbyEntities: { type: "short"; value: number };
        MaxSpawnDelay: { type: "short"; value: number };
        MinSpawnDelay: { type: "short"; value: number };
        RequiredPlayerRange: { type: "short"; value: number };
        SpawnCount: { type: "short"; value: number };
        SpawnData?: {
            type: "compound";
            value: {
                Properties: { type: "compound"; value: object };
                TypeId: { type: "string"; value: string };
                Weight: { type: "int"; value: number };
            };
        };
        SpawnPotentials?: {
            type: "list";
            value: {
                type: "compound";
                value: {
                    Properties: { type: "compound"; value: object };
                    TypeId: { type: "string"; value: string };
                    Weight: { type: "int"; value: number };
                }[];
            };
        };
        SpawnRange: { type: "short"; value: number };
    }
    • Delay: { type: "short"; value: number }

      Ticks until next spawn. If 0, it spawns immediately when a player enters its range.

    • DisplayEntityHeight: { type: "float"; value: number }

      The height of entity model that displayed in the block.

    • DisplayEntityScale: { type: "float"; value: number }

      The scale of entity model that displayed in the block.

    • DisplayEntityWidth: { type: "float"; value: number }

      The width of entity model that displayed in the block.

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

      The id of the entity to be summoned.

    • MaxNearbyEntities: { type: "short"; value: number }

      The maximum number of nearby (within a box of SpawnRange*2+1 × SpawnRange*2+1 × 8 centered around the spawner block needs testing) entities whose IDs match this spawner's entity ID.

    • MaxSpawnDelay: { type: "short"; value: number }

      The maximum random delay for the next spawn delay.

    • MinSpawnDelay: { type: "short"; value: number }

      The minimum random delay for the next spawn delay.

    • RequiredPlayerRange: { type: "short"; value: number }

      Overrides the block radius of the sphere of activation by players for this spawner.

    • SpawnCount: { type: "short"; value: number }

      How many mobs to attempt to spawn each time.

    • OptionalSpawnData?: {
          type: "compound";
          value: {
              Properties: { type: "compound"; value: object };
              TypeId: { type: "string"; value: string };
              Weight: { type: "int"; value: number };
          };
      }

      (May not exist) Contains tags to copy to the next spawned entity(s) after spawning.

      • type: "compound"
      • value: {
            Properties: { type: "compound"; value: object };
            TypeId: { type: "string"; value: string };
            Weight: { type: "int"; value: number };
        }
        • Properties: { type: "compound"; value: object }

          UNKNOWN.

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

          The entity's namespaced ID.

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

          UNDOCUMENTED.

    • OptionalSpawnPotentials?: {
          type: "list";
          value: {
              type: "compound";
              value: {
                  Properties: { type: "compound"; value: object };
                  TypeId: { type: "string"; value: string };
                  Weight: { type: "int"; value: number };
              }[];
          };
      }

      (May not exist) List of possible entities to spawn.

    • SpawnRange: { type: "short"; value: number }

      The radius around which the spawner attempts to place mobs randomly. The spawn area is square, includes the block the spawner is in, and is centered around the spawner's x,z coordinates - not the spawner itself. needs testing Default value is 4.