For modpack makers
How to fit Groovy into a pack: what to switch off, what to retag, which recipes to change, and what a quest can point at. Every recipe, tag and advancement is data, so a datapack, KubeJS or CraftTweaker can change it. Songs are not data: they live in each world's library (data/, CONFIG.md).
Pack check
/ (operators, permission level 2) shows how Groovy sits in your pack. It prints to chat and to the server log, so it works from a server console. Chat shortens a list after 12 entries ("and 8 more"); the log has every list whole. Lines that need a look are yellow in chat and WARN in the log, and the command returns how many there were.
| line | what it tells you | a warning when |
|---|---|---|
| Content switches | how many recipes, loot tables and advancements of any pack load only while a Groovy block is switched on (groovy:config) | a file asks for a switch that doesn't exist ("flag": "radios"): it never loads, and nothing else says so |
| Recipes | the mod's recipes by type, its own and those a datapack or KubeJS added under groovy: | a recipe takes something no item in this pack matches (an empty tag) |
| Tags the recipes take | how many items each tag the mod's recipes take holds here (#c:ingots/) | a tag is empty; one of the mod's own tags is empty |
| Works with | the mods it integrates that are installed, with their versions, and those that aren't | never |
| Config | how many blocks are switched on and which are off; this world's station range, mast, radio distance, song cap and Live mode | never |
| Worldgen | Groovy adds none | never |
Run it after every change to the pack's scripts and datapacks.
Config
All options are in CONFIG.md. The ones packs usually touch:
| option | file | what for |
|---|---|---|
content.<block> (station, radio, synthesizer, onAirSign, coffeeMug, ...) | config/ | take a block out of the pack (below) |
station.baseRange, mast.rangePerSegment, mast.maxSegments | defaultconfigs/ | how far stations reach: 96 blocks, plus 32 per mast segment up to 8 |
songs.maxPerPlayer | defaultconfigs/ | how many songs each player may store in a world (256) |
live.enabled, live.delayTicks | defaultconfigs/ | Live mode on or off; the delay that hides network lag (10 ticks) |
Switching a block off
Set its switch in config/ to false, for example radio = false under [content]. The block's recipe doesn't load, it leaves the creative tab, JEI and EMI, and / lists it as off. Blocks already placed stay; what they still do is in CONFIG.md.
Your own data that makes or uses that block should leave with it. Give it the same condition Groovy's recipes carry, groovy:config with the switch's name in snake case (radio, station, synthesizer, on_air_sign, broadcast_microphone, cassette_rack, monitor_speaker, studio_couch, coffee_mug, acoustic_foam, studio_rug, desk_lamp, floor_lamp):
{
"neoforge:conditions": [
{ "type": "groovy:config", "flag": "radio" }
],
"type": "minecraft:crafting_shapeless",
"ingredients": [{ "item": "minecraft:note_block" }, { "tag": "c:ingots/iron" }, { "tag": "c:dusts/redstone" }],
"result": { "id": "groovy:radio", "count": 1 }
}
A switch name with a typo loads nothing; / names the file.
Tags
Every recipe input is a conventional c: tag where one exists, so every mod's iron, copper and quartz work: #c:ingots/, #c:ingots/, #c:nuggets/, #c:dusts/, #c:dusts/, #c:gems/, #c:strings, #c:rods/, #c:bricks/, the #c:dyes/, and vanilla's #minecraft:planks, #minecraft:wool and #minecraft:wool_carpets. / shows what each holds in your pack.
| tag | holds | used for |
|---|---|---|
#groovy:tapes (item) | the tape and the blank tape | what the cassette rack takes, from players and hoppers |
#groovy:holds_value (block) | the broadcast station | blocks that hold items; it is in #minecraft:wither_immune, #minecraft:dragon_immune and #create:non_breakable, so the Wither, the dragon and Create's drills leave them alone |
Recipes
Every recipe is a plain crafting recipe with a groovy: id (,
groovy:radio,
groovy:broadcast_station, ...), so it is changed like any other mod's. The exception is copying a tape: a tape and a blank tape anywhere in the grid (
groovy:blank_tapegroovy:tape_copy, a special recipe type that JEI shows on the tape's information page). Groovy has no recipe types of its own; its one datapack registry is groovy:instrument (Instruments).
Instruments
The six pitched presets and the drum kit are entries of the datapack registry groovy:instrument: groovy:keys, groovy:bass, groovy:lead, groovy:pad, groovy:pluck, groovy:bell and groovy:kit. The server syncs the registry to every player, so everyone hears the same sound. A song names its instruments by id.
- Retune a preset: put a file with its id's path under
data/, asgroovy/ groovy/ instrument/ docs/does for the bass. The file replaces the whole entry, and a field you leave out takes the default below, not the preset's value: copy the preset's file from the Groovy jar (examples/ datapack data/) and change what you need.groovy/ groovy/ instrument/ - Add an instrument: any other id,
data/formypack/ groovy/ instrument/ organ.json mypack:organ. The editor offers it after the presets on tracks of its kind. Its name comes from the lang keyinstrument.mypack.organin a resource pack, else the editor shows the id. A song that names it plays the kind's fallback on a server without your datapack. Live mode plays only the seven ids above; an added instrument plays as the fallback there. - Your pack must sit above Groovy's data to win, as for any file. A datapack a world finds new goes on top; KubeJS's
kubejs/always sits above the mods (example).data/ groovy/ groovy/ instrument/ - Changes need a world restart. The registry loads when the world starts;
/doesn't change it.reload - Bad values don't break the world. A field of the wrong type, an unknown waveform, filter mode or kit slot, or a field nobody reads is left out with a
WARNline in the log and takes its default. A number outside its range is clamped to the nearest end, logged with the entry's id when the server starts. An entry that isn't a JSON object or has nokindplays the built-in sound of its id. Only a file that isn't JSON at all stops the world from loading, as for every datapack registry; the log names the file.
A pitched instrument ("kind": "pitch"). Signal path: (1 − mix) × oscillator + mix × oscillator2, then the filter, then the envelope and the gain.
| field | range | default | what it does |
|---|---|---|---|
oscillator.wave | sine, triangle, saw, square, pulse, noise | sine | the main oscillator |
oscillator.pulse_width | 0.05–0.95 | 0.5 | the high part of a pulse wave, for both oscillators |
oscillator2.wave | as above | sine | the second oscillator, silent at mix 0 |
oscillator2.semitones | −24 to 24 | 0 | its interval above the first |
oscillator2.cents | −100 to 100 | 0 | its detune |
oscillator2.mix | 0–1 | 0 | 0 only the first oscillator, 1 only the second |
envelope.attack, envelope.decay | 0–10 s | 0.005, 0.1 | to full level, then down to the sustain level |
envelope.sustain | 0–1 | 1 | the level while the note is held |
envelope.release | 0–2 s | 0.05 | from the note's end to silence |
filter.mode | low_pass, band_pass, high_pass | low_pass | which output of the resonant filter |
filter.cutoff | 20–20,000 Hz | 20,000 | the cutoff at middle C (MIDI 60) |
filter.resonance | 0–0.9 | 0 | 0.9 rings hard |
filter.key_track | 0–1 | 0 | how far the cutoff follows the pitch; 1 is an octave per octave |
filter.envelope_octaves | −8 to 8 | 0 | the cutoff starts this many octaves higher and decays back |
filter.envelope_decay | 0.001–10 s | 0.1 | the time constant of that decay |
pitch_envelope.semitones | −48 to 48 | 0 | the pitch starts this much higher and decays back (drums) |
pitch_envelope.decay | 0.001–2 s | 0.05 | the time constant of that decay |
gain | 0–2 | 1 | the level |
octave | −3 to 3 | 0 | added to every note |
A kit ("kind": "drum") has voices, an object with one key per slot: kick, low_tom, mid_tom, snare, high_tom, clap, rim, cowbell, shaker, closed_hat, open_hat, crash. Each holds the fields above plus pitch (the MIDI note its oscillators play, 0–127, fractions allowed, default 60; noise ignores it) and choke_group (0–8, default 0; a hit cuts the ringing drums of the same group on its track, as the closed hat cuts the open one). A slot left out plays the built-in drum. A drum's gate closes after attack + decay, whatever the note's length.
Advancements and quests
Quests can point at Groovy's advancements: groovy:root (a blank tape, a radio or a synthesizer picked up), groovy:label_it (a song saved onto a tape), groovy:first_light (a station placed), groovy:tuned_in (a radio tuned to a station in range) and groovy:on_air (gone live). Your own advancements can use the triggers behind them: groovy:saved_song, groovy:tuned_radio and groovy:went_live, each with only the usual player condition. Fake players earn none of them.
Demo songs and demo tapes
| what | file | how to change it |
|---|---|---|
| the demo songs | data/, Groovy JSON | a file of the same name replaces one of ours (data/); a new name adds a song. A file that doesn't read is logged and left out |
| where tapes turn up | data/, a NeoForge global loot modifier of type groovy:demo_tapes | override the file: its conditions list the chests (neoforge:loot_table_id terms) and the chance (minecraft:random_chance, 0.2) |
| whether tapes turn up | songs.demoTapesInLoot in the server config | false: no new demo tapes; tapes found before keep playing |
Every world's library gets every demo song when the server starts and after /, so a demo tape found in a chest always plays. The synthesizer's Demo button loads the four songs in the jar, whatever the datapacks say.
KubeJS
Recipes and tags work like any other mod's. Turn a recipe off by id (event.remove({ id: 'groovy:radio' })): a datapack file with the same id only wins when its pack sits above the mod's data. Its data/ retunes the bell: KubeJS's data folder sits above every mod's, so it wins over Groovy's own file (Instruments). Groovy has no KubeJS events or bindings of its own.