Skip to content

Painting Variant Data Generation

Maksym Uimanov edited this page Feb 12, 2026 · 1 revision

Painting Variant Data Generation

The @GeneratePainting annotation is a data generation annotation that automatically creates painting variant definitions for Minecraft mods using the Temporal API. It eliminates the need for manual JSON configuration by generating the necessary data providers at runtime.

Responsibilities / Purpose

  • Automatic data generation: Creates painting variant definitions without manual JSON files
  • Dimension configuration: Defines the width and height of painting variants
  • Tag integration: Automatically adds paintings to the minecraft:placeable tag
  • Integration with data providers: Seamlessly integrates with NeoForge's painting variant data generation system

How it works

  1. Annotation processing: The annotation is processed by GeneratePaintingStrategy during the data generation phase
  2. Field extraction: The strategy extracts the ResourceKey<PaintingVariant> from the annotated field
  3. Description creation: Creates a PaintingVariantDescription containing the variant resource key and dimensions
  4. Provider registration: Automatically registers the painting variant with ApiPaintingVariantProvider for data generation
  5. Tag assignment: Automatically adds the painting to the minecraft:placeable tag

How to use / Configure

Apply the annotation to static fields of type ResourceKey<PaintingVariant>:

public final class ModPaintings {
    @GeneratePainting(width = 2, height = 1)
    public static final ResourceKey<PaintingVariant> CUSTOM_PAINTING = 
        ResourceUtils.createKey(Registries.PAINTING_VARIANT, "custom_painting");
}

Annotation parameters

  • width (int, default 1): The width of the painting in block units
  • height (int, default 1): The height of the painting in block units

Extension points

The annotation integrates with the Temporal API's strategy system:

  • Strategy implementation: GeneratePaintingStrategy handles the processing logic
  • Provider system: Uses ApiPaintingVariantProvider for data generation
  • Transformer support: Compatible with PaintingVariantTransformer for additional processing
  • Tag integration: Automatically adds paintings to the minecraft:placeable tag

When to use

Use @GeneratePainting when:

  • Creating custom painting variants for your mod
  • Defining paintings with specific dimensions for different wall spaces
  • Automating data generation for decorative content
  • Ensuring consistent painting configuration across your mod

The annotation is particularly useful for mods with multiple paintings, as it centralizes painting configuration and eliminates manual JSON file management while providing control over painting dimensions. The automatic tag assignment ensures that all generated paintings are properly placeable in the game world.

Clone this wiki locally