First block
The crystal and the crystal block you declared in the entrypoint have no look yet. The game reads the look, name, and drop from resource files in the same format as vanilla.
Generate the resource files at build time
For a plain item and a cube block, you do not have to write the files by hand. Delete the template examples (ruby, ruby_block) from build.gradle.kts and write this.
polyResources {
item("crystal") { texture = "minecraft:item/amethyst_shard" }
block("crystal_block") {
texture = "minecraft:block/amethyst_block"
minedWith = "pickaxe"
}
}
When you run build, these files are generated in build/generated/poly-resources/main and go into the mod jar.
| Declaration | Generated files |
|---|---|
item("crystal") | Item definition, item model, English name Crystal |
block("crystal_block") | Block state, block model (cube_all), block item definition, loot (drops itself), English name Crystal Block |
minedWith = "pickaxe" | Added to the block tag for blocks mined with a pickaxe |
The textures borrow the vanilla amethyst ones. To use your own 16×16 PNG, put it at src/main/resources/assets/crystal_garden/textures/block/crystal_block.png and delete the texture line.
build runs checkPolyResources to find resource mistakes (uppercase file names, broken JSON, missing models or textures, a missing namespace) before you start the game. The full settings are in Mod development tools.
Korean names
English names are generated, but you write other languages yourself.
{
"item.crystal_garden.crystal": "크리스털",
"block.crystal_garden.crystal_block": "크리스털 블록"
}
The next pages add the sprout and key binding names to this file.
Files you write win
If a file with the same path exists in src/main/resources, polyResources does not generate that file. For a block with a special shape, you write only that file by hand. The crystal sprout on the next page is one.
Poly Mod Loader automatically adds the mod jar's assets/ and data/ as a resource pack and a data pack, so you register nothing. The path rules are in Resources and data.
Check
- Windows (PowerShell)
- macOS · Linux (bash)
.\gradlew.bat build
./gradlew build
If you start the game with runClient, the crystal is in the Ingredients tab of the creative inventory and the crystal block is in the Building Blocks tab.
Next step
Build the growing block.