-
Notifications
You must be signed in to change notification settings - Fork 0
Jukebox Song Data Generation
Maksym Uimanov edited this page Feb 10, 2026
·
1 revision
The @GenerateJukeboxSong annotation is a data generation annotation that automatically creates jukebox song definitions for Minecraft mods using the Temporal API. It eliminates the need for manual JSON configuration by generating the necessary data providers at runtime.
- Automatic data generation: Creates jukebox song definitions without manual JSON files
- Metadata association: Links jukebox songs to their sound events, duration, and comparator output
- Integration with data providers: Seamlessly integrates with NeoForge's data generation system
- Type safety: Ensures compile-time validation of jukebox song configurations
-
Annotation processing: The annotation is processed by
GenerateJukeboxSongStrategyduring the data generation phase -
Field extraction: The strategy extracts the
ResourceKey<JukeboxSong>from the annotated field -
Description creation: Creates a
JukeboxSongDescriptioncontaining all song metadata -
Provider registration: Automatically registers the song with
ApiJukeboxSongProviderfor data generation
Apply the annotation to static fields of type ResourceKey<JukeboxSong>:
public final class ModJukeboxSongs {
@GenerateJukeboxSong(
soundEvent = "mymod:custom_song",
lengthInSeconds = 180,
comparatorOutput = 12
)
public static final ResourceKey<JukeboxSong> CUSTOM_SONG =
ResourceUtils.createKey(Registries.JUKEBOX_SONG, "custom_song");
}- soundEvent (String): The sound event resource location that plays when the song is in the jukebox
- lengthInSeconds (float): Duration of the song in seconds (affects jukebox playback timing)
- comparatorOutput (int): Redstone comparator signal strength (0-15) when the song is playing
The annotation integrates with the Temporal API's strategy system:
-
Strategy implementation:
GenerateJukeboxSongStrategyhandles the processing logic -
Provider system: Uses
ApiJukeboxSongProviderfor data generation -
Transformer support: Compatible with
JukeboxSongTransformerfor additional processing
Use @GenerateJukeboxSong when:
- Creating custom music discs for your mod
- Defining jukebox songs with specific comparator outputs
- Automating data generation for music-related content
- Ensuring consistent song metadata across your mod
The annotation is particularly useful for mods with multiple music discs, as it centralizes song configuration and eliminates manual JSON file management.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples