Skip to content

Commit 68e46bc

Browse files
committed
explain item models / client items
1 parent 12751d1 commit 68e46bc

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

web/.vitepress/config.mts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
cleanUrls: true,
88
markdown: {
99
config: (md) => {
10-
// md.use(minecraftHoverPlugin)
10+
// md.use(minecraftHoverPlugin)
1111
}
1212
},
1313
themeConfig: {
@@ -19,9 +19,10 @@ export default defineConfig({
1919

2020
sidebar: [
2121
{
22-
text: 'Developers',
22+
text: 'Resource Packs',
2323
items: [
24-
{ text: 'Resource Packs', link: '/developers/texture-packs' },
24+
{ text: 'Basics', link: '/developers/texture-packs' },
25+
{ text: 'Item Retexturing', link: '/developers/texture-packs/items' },
2526
]
2627
}
2728
],

web/.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const orEmpty = (str: string | null | undefined, seperator: string = " ") => str
2626
function inject() {
2727
for (const [attr, appl] of attrs) {
2828
document.querySelectorAll(`code[${attr}]`).forEach(entry => {
29-
const [ns, path] = parseIdent(entry.textContent)
29+
const [ns, path] = parseIdent(entry.innerHTML)
3030
const attrValue = entry.getAttribute(attr)
3131
tippy(entry, {
3232
content: appl(ns, path, attrValue),

web/developers/texture-packs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
# Custom SkyBlock Items Texture Pack Format
33

4+
> [!WARNING]
5+
> This wiki is currently being reworked. Most information should still be correct, but i cant be sure.
6+
47
Firmament generally tries to emulate the vanilla structure of resourcepacks whenever possible. Because of that it is extremely helpful to know the general structure of vanilla resource packs. The [minecraft wiki](https://minecraft.wiki/w/Resource_pack) is a good starting place to learn, but some basic terms will be explained here as well.
58

69
## Identifiers

web/developers/texture-packs/items.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@ Firmament allows you to replace the models of items in a couple of ways.
44

55
## By SkyBlock ID
66

7-
Firmament allows you to remodel
7+
Firmament allows you to entirely replace the item model of a SkyBlock item based on its SkyBlock ID. To do this, you can place a model at `firmskyblock:<itemid>`{model=item}.
88

9+
On older versions (before 1.21) Minecraft had system for specifying custom predicates inside of models:
910

11+
```json
12+
{
13+
"parent": "minecraft:item/handheld",
14+
"textures": {
15+
"layer0": "firmskyblock:item/bat_wand"
16+
},
17+
"overrides": [
18+
{
19+
"predicate": {
20+
"firmament:display_name": {
21+
"regex": ".*§d.*",
22+
"color": "preserve"
23+
}
24+
},
25+
"model": "firmskyblock:item/recombobulated_bat_wand"
26+
}
27+
]
28+
}
29+
```
30+
31+
Nowadays, these types of `overrides` / `predicate` combos are instead seperated out into a client item. The client item is located at `<namespace>:items/<itemid>.json`{fqfi}, which then references the actual rendered item model in its definition. Firmament supports exclusively for the `firmskyblock` namespace an automatic conversion from the old format to the new format. Users are nevertheless encouraged to instead of just creating a renderable item model (at `firmskyblock:<skyblockid>`{model=item}) to also create a client item definition (at `firmskyblock:items/<skyblockid>.json`{fqfi}).
32+
33+
That item definition would then reference the actual model file (at any location you want, but i for now have just chosen to reference the default legacy location):
34+
35+
```json{4}
36+
{
37+
"model": {
38+
"type": "minecraft:model",
39+
"model": "firmskyblock:item/<skyblockid>"
40+
}
41+
}
42+
```
43+
44+
Note that the inner `model` refers to any model, so you need to explicitly specify the `item/` prefix, which is implicit in the legacy item model system.

0 commit comments

Comments
 (0)