You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/custom-backpack/model-metadata.mdx
+59-19Lines changed: 59 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,12 @@ For clarification, the directory is named `backpacked` and not `backpack`. This
22
22
23
23
In the model meta directory, as created in the previous section, create a new JSON file with name of your backpack. The name must be the same as when you [registered the backpack](./register-the-backpack.md#registering), e.g. `<your_backpack_name>.json`.
24
24
25
-
Inside the newly created file, copy and paste in the following contents:
25
+
Inside the newly created file, copy and paste in the following contents. The will act as a template for your backpack.
26
26
```json title="<your_backpack_name>.json"
27
27
{
28
28
"shelf_offset": [0, 0, 0],
29
-
"gui_display": {
30
-
"rotation": [0, 0, 0],
31
-
"translation": [0, 0, 0],
32
-
"scale": [1.0, 1.0, 1.0]
29
+
"display": {
30
+
...
33
31
}
34
32
}
35
33
```
@@ -51,33 +49,75 @@ Inside the newly created file, copy and paste in the following contents:
51
49
52
50
<divclassName="code-block">
53
51
54
-
### Property: `gui_display`
52
+
### Property: `display`
55
53
56
-
This is an object that holds a GUI transform. This is applied when rendering the backpack model in list of available cosmetics.
57
-
- `rotation` is an array that contains a local XYZ rotation for the model
58
-
- `translation` is an array that contains a local XYZ translation for the model.
59
-
- `scale` is an array that contains an XYZ scale for the model.
54
+
This is an object that holds the display transforms for the model. This is used when rendering the backpack in the customisation menu and when rendering the backpack as an item. Luckily this is very easy to configure since it is exactly the same as configuring the display transforms for an item.
60
55
61
56

62
57
63
58
#### How to Configure
64
59
65
-
Open Blocbench and load the project for your backpack model. Disable the visibility of the `Straps` and `Player Model`, so only the `Backpack` elements are visible. Navigate to the **Display** tab at the top right, and under the **Slot** in the left sidebar, click the **GUI** icon. Configure your backpack to fit nicely into the GUI slot preview. Try to fill it without going outside the slot borders and set the `X` and `Y` rotation to `30` for convention. Then simply copy the values shown in Bloclbench to the `gui_display` property as shown below.
60
+
Open Blocbench and load the project for your backpack model. Disable the visibility of the `Straps` and `Player Model`, so only the `Backpack` elements are visible. Navigate to the **Display** tab at the top right, and you will see a **Slot**section in the leftside bar. This section contains different scenarios where the backpack may be drawn. If you're using the backpack template, this will come preconfigured with default settings. Go through all the different slot options (**Thirdperson Right**, **Ground**, **GUI**, etc) and tweak them as you need.
66
61
67
-
These display settings:
62
+
:::info
63
+
It is not necessary to configure the **Thridperson Left** and **Firstperson Left** as these slots will be automatically inferred by the **Thridperson Right** and **Firstperson Right** slots. To ensure they are not configured, press the reset button for each transform (Rotation, Translation, and Scale) while selected on **Thridperson Left** slot, and repeat for the **Firstperson Left** slot. The backpack template will not have these slots configured by default.
64
+
:::
68
65
69
-

66
+

70
67
71
-
Converts into:
72
-
```json
68
+
Once you've configured all your display transforms, export your model as a `Block/Item Model` to a temporary file (this can be deleted afterwards). Open the newly exported file (which should be a JSON file), and locate the `display` object. Copy the entire `display` object and replace the `display` object in your backpacks meta file.
69
+
70
+
Before replacing:
71
+
```json title="<your_backpack_name>.json"
73
72
{
74
-
"gui_display": {
75
-
"rotation": [30, 30, 0],
76
-
"translation": [-1.75, 5.25, 0],
77
-
"scale": [1.4, 1.4, 1.4]
73
+
"shelf_offset": [0, 0, 0],
74
+
"display": {
75
+
...
78
76
}
79
77
}
80
78
```
79
+
80
+
After replacing (your values may be different):
81
+
```json title="<your_backpack_name>.json"
82
+
{
83
+
"shelf_offset": [0, 0, 0],
84
+
"display": {
85
+
"thirdperson_righthand": {
86
+
"rotation": [75, -45, 0],
87
+
"translation": [0.75, 5.75, 3.25]
88
+
},
89
+
"firstperson_righthand": {
90
+
"rotation": [0, -45, 0],
91
+
"translation": [-0.5, 4.5, 0.5],
92
+
"scale": [0.5, 0.5, 0.5]
93
+
},
94
+
"ground": {
95
+
"translation": [0, 4.75, -2]
96
+
},
97
+
"gui": {
98
+
"rotation": [30, 35, 0],
99
+
"translation": [-1.25, 4.25, 0],
100
+
"scale": [1.1, 1.1, 1.1]
101
+
},
102
+
"head": {
103
+
"rotation": [0, -180, 0],
104
+
"translation": [0, 14.5, 2.5]
105
+
},
106
+
"fixed": {
107
+
"rotation": [0, -180, 0],
108
+
"translation": [0, 3.5, 1]
109
+
},
110
+
"on_shelf": {
111
+
"translation": [0, 1.25, -4]
112
+
}
113
+
}
114
+
}
115
+
```
116
+
117
+
:::note
118
+
Please note that `on_shelf` property is only applicable for addons in Minecraft 1.21.9 or above; however it can be safely left in the file even if on a lower version.
0 commit comments