stewbeet.plugins.resource_pack.sounds
The sounds plugin automatically processes sound files and generates the sounds.json configuration for Minecraft resource packs.
It groups numbered sound variants.
(This plugin requires the sounds.folder configuration to be set in meta.stewbeet)
Features Showcase
Example of a sounds folder with .ogg files:
Files are copied to resource pack and sounds.json is created:
Source Code: stewbeet/plugins/resource_pack/sounds/__init__.py
Source Code: stewbeet/core/utils/sounds.py
What it does
- Processes sound files from a designated sounds folder
- Groups numbered sound variants (e.g., sound_01.ogg, sound_02.ogg)
- Generates sounds.json configuration automatically
- Creates appropriate subtitles for sound identification
Dependencies
- β
Required:
sounds.folderconfiguration in meta.stewbeet - π Position: Should be able to run anywhere in the pipeline
(seebasic/beet.ymlfor an example) - π Assets: Requires a sounds folder with audio files
Configuration
Basic Example Configuration
pipeline:
- ...
- stewbeet.plugins.resource_pack.sounds
- ...
meta:
stewbeet:
sounds:
folder: "assets/sounds" # Path to sounds directory
exclude_patterns: ["some_folder/*"] # Optional: glob patterns to excludeβ οΈ Deprecated: The old
meta.stewbeet.sounds_folderkey is still supported but will emit a warning. Migrate tometa.stewbeet.sounds.folder.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
sounds.folder | string | Required | Path to the directory containing sound files. Set in meta.stewbeet.sounds.folder |
sounds.exclude_patterns | list[string] | [] | Glob patterns (relative to the sounds folder) of files to exclude from processing. E.g. ["some_folder/*", "debug_*.ogg"] |
Features
Sound File Processing
- π Recursively scans the sounds folder for audio files
- β
Only supports
.oggfile format for now - π« Supports glob-based exclusion via
exclude_patterns - π§Ή Sanitizes filenames (removes spaces, converts to lowercase)
- π Creates Sound objects with proper source paths and subtitles
Numbered Variant Grouping
Automatically groups sound variants with numbered suffixes:
dirt_bullet_impact_01.oggπ―dirt_bullet_impact_02.oggπ―dirt_bullet_impact_03.oggπ―
These become variants of the sound dirt_bullet_impact in sounds.json.
Supported numbering patterns:
name_01,name_02, etc. (with underscore)name1,name2, etc. (without underscore)
Sounds.json Generation
- π§ Automatically creates or updates sounds.json thanks to the
add_soundfunction instewbeet.core.utils.sounds - π·οΈ Generates subtitles based on sound names
- ποΈ Preserves sound properties (volume, pitch, weight, etc.)
- π Uses project namespace for sound references
Next steps
- Defining items and blocks: the textures and models this plugin consumes.
- All plugins: the rest of the pipeline, in the order it runs.
- Configuring the build: enabling, ordering and configuring plugins.