Attachable गेम को बताता है कि जब कोई आइटम पकड़ा या पहना जाए तो कौन-सा 3D मॉडल बनाना है। इसके बिना, पकड़ा हुआ आइटम अपने सपाट icon की तरह दिखता है। Armor को हमेशा इसकी ज़रूरत होती है, क्योंकि पहना हुआ armor प्लेयर पर लगा एक मॉडल होता है।
यह कहाँ जाता है
रिसोर्स पैक
RP/
attachables/
ruby_helmet.json
models/
entity/
ruby_helmet.geo.json
textures/
models/
ruby_armor.pngफ़ाइल
identifier बिहेवियर पैक में आइटम के identifier जैसा ही होना चाहिए।
RP/attachables/ruby_helmet.json
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "wiki:ruby_helmet",
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/ruby_armor",
"enchanted": "textures/misc/enchanted_actor_glint"
},
"geometry": {
"default": "geometry.humanoid.armor.helmet"
},
"scripts": {
"parent_setup": "variable.helmet_layer_visible = 0.0;"
},
"render_controllers": ["controller.render.armor"]
}
}
}इसके fields वही हैं जो एक client entity फ़ाइल इस्तेमाल करती है:
| Field | यह क्या करता है |
|---|---|
materials | मॉडल कैसे बनाया जाता है। Armor armor इस्तेमाल करता है, दूसरे पकड़े जाने वाले मॉडल आमतौर पर entity_alphatest। |
textures | मॉडल का texture, .png के बिना। |
geometry | मॉडल। geometry.humanoid.armor.helmet जैसे vanilla armor आकार काम करते हैं, या आपकी अपनी .geo.json। |
render_controllers | कौन-से textures और materials साथ जाते हैं। |
scripts | आइटम बनाते समय चलने वाला Molang। ऊपर वाला parent_setup vanilla helmet layer को छिपाता है। |
टिप्स
- हर आइटम के लिए एक attachable। पूरे armor set के लिए चार फ़ाइलें।
- Armor texture पूरे set के लिए एक ही sheet होता है, vanilla
textures/models/armor/diamond_1.pngकी तरह बिछाया हुआ। - अपना मॉडल किसी model editor में बनाएँ, उसे
.geo.jsonके रूप में एक्सपोर्ट करें और यहाँ उसकाgeometry.<name>इस्तेमाल करें।