1. विकी
  2. /एंटिटी
  3. /Client entity फ़ाइल

Client entity फ़ाइल

Bedrock मॉब का रिसोर्स पैक वाला हिस्सा: client entity फ़ाइल, जिसमें materials, textures, geometry, animations, render controllers, scripts और spawn egg होते हैं।

Behavior फ़ाइल तय करती है कि मॉब क्या करता है। Client entity फ़ाइल तय करती है कि वह कैसा दिखता है: कौन-सा मॉडल, कौन-सी skin, कौन-से animations और उसका spawn egg कैसा दिखता है। यह रिसोर्स पैक में रहती है।

इसे छोटे नामों (nicknames) की एक लिस्ट की तरह सोचें। यहाँ आप हर मॉडल, texture और animation को एक छोटा नाम देते हैं, और रिसोर्स पैक की दूसरी फ़ाइलें वही नाम इस्तेमाल करती हैं।

फ़ाइलें

रिसोर्स पैक
RP/
  entity/
    ruby_golem.entity.json
  models/
    entity/
      ruby_golem.geo.json
  textures/
    entity/
      ruby_golem.png
      ruby_golem_angry.png
  animations/
    ruby_golem.animation.json
  animation_controllers/
    ruby_golem.animation_controllers.json
  render_controllers/
    ruby_golem.render_controllers.json

सिर्फ़ entity फ़ाइल, एक मॉडल और एक texture ज़रूरी हैं। बाकी optional हैं: अपने खुद के लिखने की जगह आप vanilla animations और render controllers उधार ले सकते हैं।

फ़ाइल का नाम कुछ भी हो सकता है। इसे बिहेवियर पैक से identifier जोड़ता है।

एक पूरा उदाहरण

यह Entity फ़ाइल वाले Ruby Golem की client फ़ाइल है। जब golem की wiki:mood property angry होती है, तो यह गुस्से वाला texture दिखाती है।

RP/entity/ruby_golem.entity.json
{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "wiki:ruby_golem",
      "materials": {
        "default": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/ruby_golem",
        "angry": "textures/entity/ruby_golem_angry"
      },
      "geometry": {
        "default": "geometry.wiki.ruby_golem"
      },
      "animations": {
        "walk": "animation.wiki.ruby_golem.walk",
        "attack": "animation.wiki.ruby_golem.attack",
        "look_at_target": "animation.common.look_at_target",
        "attack_controller": "controller.animation.wiki.ruby_golem.attack"
      },
      "scripts": {
        "scale": "1.2",
        "animate": [
          { "walk": "q.modified_move_speed" },
          "look_at_target",
          "attack_controller"
        ]
      },
      "render_controllers": ["controller.render.wiki.ruby_golem"],
      "spawn_egg": {
        "base_color": "#9b111e",
        "overlay_color": "#f4c2c2"
      }
    }
  }
}

ज़्यादातर vanilla client फ़ाइलें "format_version": "1.10.0" इस्तेमाल करती हैं, और आपकी फ़ाइल के लिए भी यह अच्छा विकल्प है। पेज का बाकी हिस्सा हर field को एक-एक करके समझाता है।

identifier

मॉब की ID, बिल्कुल वैसी ही जैसी बिहेवियर पैक में है: wiki:ruby_golem। अगर दोनों मेल नहीं खाते, तो मॉब अदृश्य हो जाता है।

materials

Material गेम को बताता है कि pixels कैसे बनाने हैं: ठोस, पारदर्शी, चमकते हुए वगैरह। आप गेम में पहले से मौजूद materials में से चुनते हैं और हर एक को एक छोटा नाम देते हैं।

RP/entity/ruby_golem.entity.json (description)
"materials": {
  "default": "entity_alphatest",
  "glow": "entity_emissive_alpha"
}
Materialकिसके लिए इस्तेमाल करें
entityपूरी तरह ठोस skins, कोई transparent pixel नहीं
entity_alphatestपूरी तरह transparent छेदों वाली skins। सबसे सुरक्षित default।
entity_alphablendआधे-पारदर्शी pixels, जैसे कांच या slime
entity_emissive_alphaअंधेरे में चमकने वाले हिस्से, texture के alpha से तय होते हैं

कई vanilla मॉब के materials उनके अपने नाम पर होते हैं (pig, iron_golem)। वे एक ही मॉब के लिए tune किए गए हैं, इसलिए अपने मॉब के लिए आम entity... वाले ही इस्तेमाल करें।

textures

हर skin के लिए छोटे नाम। Paths रिसोर्स पैक के root से शुरू होते हैं और उनमें .png नहीं लिखा जाता।

RP/entity/ruby_golem.entity.json (description)
"textures": {
  "default": "textures/entity/ruby_golem",
  "angry": "textures/entity/ruby_golem_angry"
}

आप जितने चाहें उतने लिख सकते हैं। कौन-सा दिखेगा, यह render controller तय करता है। Skins पेंट करने के टिप्स Pixel textures में हैं।

geometry

हर मॉडल के लिए छोटे नाम। वैल्यू वह identifier है जो .geo.json फ़ाइल के अंदर लिखा है, फ़ाइल का नाम नहीं।

RP/entity/ruby_golem.entity.json (description)
"geometry": {
  "default": "geometry.wiki.ruby_golem"
}

एक मॉब के कई मॉडल हो सकते हैं। जैसे vanilla मुर्गियों (chickens) का एक सामान्य, एक ठंडा और एक baby मॉडल है।

animations

Animations और animation controllers के लिए छोटे नाम। आप अपने खुद के और vanilla वाले मिला सकते हैं।

RP/entity/ruby_golem.entity.json (description)
"animations": {
  "walk": "animation.wiki.ruby_golem.walk",
  "look_at_target": "animation.common.look_at_target",
  "attack_controller": "controller.animation.wiki.ruby_golem.attack"
}

सिर्फ़ नाम देना काफ़ी नहीं: ये तभी चलते हैं जब इन्हें scripts.animate में लिखा जाए (नीचे देखें) या कोई animation controller इन्हें शुरू करे।

उधार लेने लायक काम के vanilla animations, अगर आपकी bones के नाम मेल खाते हों:

Animationक्या हिलाता हैकिन bones की उम्मीद करता है
animation.common.look_at_targetसिर को उस ओर जिधर मॉब देख रहा हैhead
animation.quadruped.walkचलते समय चार पैरleg0 से leg3
animation.humanoid.moveचलते समय बाँहें और पैरleftarm, rightarm, leftleg, rightleg

animation_controllers

पुरानी client फ़ाइलें controllers को animations की जगह अपनी अलग array में लिखती हैं:

पुराना तरीका
"animation_controllers": [
  { "attack": "controller.animation.wiki.ruby_golem.attack" }
]

हर entry एक छोटे नाम वाला object है। यहाँ लिखे controllers scripts.animate के बिना अपने-आप चलते हैं। format_version 1.10.0 और उससे नए में, controllers को animations में रखना और उन्हें scripts.animate से शुरू करना आम तरीका है, जैसा पूरे उदाहरण में है।

render_controllers

Render controller चुनता है कि कौन-सी geometry, texture और material बनाना है। लिस्ट में कई हो सकते हैं, और सब draw होते हैं।

RP/entity/ruby_golem.entity.json (description)
"render_controllers": ["controller.render.wiki.ruby_golem"]

एक मॉडल, एक skin और एक material वाले मॉब के लिए आपको अपना render controller नहीं चाहिए। Vanilla controller.render.default, default नाम वालों को draw करता है। Textures बदलने के लिए अपना एक छोटा controller लिखें:

RP/render_controllers/ruby_golem.render_controllers.json
{
  "format_version": "1.8.0",
  "render_controllers": {
    "controller.render.wiki.ruby_golem": {
      "geometry": "Geometry.default",
      "materials": [{ "*": "Material.default" }],
      "textures": [
        "q.property('wiki:mood') == 'angry' ? Texture.angry : Texture.default"
      ]
    }
  }
}

Geometry.default, Material.default और Texture.angry client फ़ाइल के छोटे नामों की ओर इशारा करते हैं। materials में * का मतलब है "हर bone"। Texture वाली लाइन एक Molang सवाल है: गुस्से वाले golems को गुस्से वाली skin मिलती है।

यह सिर्फ़ इसलिए काम करता है क्योंकि बिहेवियर पैक में property पर "client_sync": true लगा है। इसके बिना रिसोर्स पैक वैल्यू देख ही नहीं सकता।

आप Molang शर्त से पूरे render controller को चालू और बंद भी कर सकते हैं। Vanilla creepers अपनी charged चमक के लिए यही करते हैं:

शर्त वाला render controller
"render_controllers": [
  "controller.render.wiki.ruby_golem",
  { "controller.render.wiki.ruby_golem_glow": "q.property('wiki:mood') == 'angry'" }
]

scripts

scripts में Molang के छोटे टुकड़े होते हैं जो प्लेयर के डिवाइस पर चलते हैं।

Scriptकब चलती हैकिसके लिए है
initializeएक बार, जब मॉब पहली बार दिखता हैVariables की शुरुआती वैल्यू सेट करने के लिए
pre_animationहर frame, animations से पहलेAnimations को जिन वैल्यू की ज़रूरत है, उन्हें निकालने के लिए
animateहर frameकौन-से animations और controllers चलाने हैं
scaleहर frameपूरे मॉडल को बड़ा या छोटा करने के लिए
variablesScript नहीं: एक लिस्टVariables को public मार्क करने के लिए ताकि attachables उन्हें पढ़ सकें

animate

हर entry animations का एक छोटा नाम है। इसे 0 से 1 तक की ताकत के साथ चलाने के लिए एक object में लपेटें:

RP/entity/ruby_golem.entity.json (scripts)
"animate": [
  { "walk": "q.modified_move_speed" },
  "look_at_target",
  "attack_controller"
]

Golem जितना तेज़ चलता है, walk उतना ज़ोर से चलता है, और उसके रुकने पर बंद हो जाता है। look_at_target हमेशा चलता है।

scale

RP/entity/ruby_golem.entity.json (scripts)
"scale": "q.is_baby ? 0.5 : 1.2"

यह सिर्फ़ बदलता है कि मॉब कैसा दिखता है। बिहेवियर पैक में सेट किया गया उसका collision box उतना ही रहता है। Vanilla चमगादड़ (bats) अपना मॉडल छोटा करने के लिए "0.35" इस्तेमाल करते हैं।

pre_animation

RP/entity/ruby_golem.entity.json (scripts)
"pre_animation": [
  "v.is_angry = q.property('wiki:mood') == 'angry';"
]

हर जगह एक ही लंबा expression दोहराने की जगह, यहाँ एक बार वैल्यू निकालें और कई animations में v.is_angry इस्तेमाल करें।

spawn_egg

spawn_egg के बिना creative inventory में मॉब का कोई egg नहीं होता। इसे बनाने के दो तरीके हैं।

दो रंग। गेम background रंग और धब्बों वाला एक standard egg बनाता है:

RP/entity/ruby_golem.entity.json (description)
"spawn_egg": {
  "base_color": "#9b111e",
  "overlay_color": "#f4c2c2"
}

आपकी अपनी तस्वीर। item_texture.json का एक छोटा नाम इस्तेमाल करें, बिल्कुल आइटम icon की तरह (आइटम textures देखें):

RP/entity/ruby_golem.entity.json (description)
"spawn_egg": {
  "texture": "wiki_ruby_golem_egg"
}

अगर उस छोटे नाम में कई textures की लिस्ट है, तो एक चुनने के लिए "texture_index" जोड़ें। यह 0 से शुरू होता है। Egg के लिए बिहेवियर पैक में "is_spawnable": true और lang फ़ाइल में एक नाम भी चाहिए:

RP/texts/en_US.lang
entity.wiki:ruby_golem.name=Ruby Golem
item.spawn_egg.entity.wiki:ruby_golem.name=Ruby Golem Spawn Egg

दूसरी fields

Fieldयह क्या करती है
enable_attachablestrue करने पर attachables से मॉब पर कवच और हाथ में पकड़े आइटम दिखते हैं
hide_armortrue करने पर मॉब का पहना कोई भी कवच छिप जाता है
held_item_ignores_lightingtrue करने पर हाथ में पकड़े आइटम अंधेरे में भी पूरी रोशनी में दिखते हैं
locatorsमॉडल पर नाम वाले बिंदु, जैसे जहाँ lead (पट्टा) जुड़ता है
particle_effectsParticles के छोटे नाम, animations में इस्तेमाल के लिए
sound_effectsसाउंड के छोटे नाम, animations में इस्तेमाल के लिए
min_engine_versionयह फ़ाइल तभी लोड करें जब पैक इस game version या उससे नए को target करता हो

जब कुछ गड़बड़ हो

आपको क्या दिखता हैसबसे संभावित वजह
मॉब अदृश्य है, सिर्फ़ परछाई दिखती हैidentifier बिहेवियर पैक से मेल नहीं खाता, या geometry का नाम गलत है
बैंगनी और काले चौखानेTexture का path गलत है, या उसके आखिर में .png है
छेद पारदर्शी की जगह काले दिखते हैंentity की जगह entity_alphatest इस्तेमाल करें
कोई animation कभी नहीं चलतावह animations में है लेकिन scripts.animate या किसी controller में नहीं
कोई spawn egg नहींspawn_egg नहीं है, या बिहेवियर पैक में is_spawnable false है
Texture कभी नहीं बदलताProperty में "client_sync": true नहीं है

ज़्यादा मदद Troubleshooting में है। मॉब बनाने की पूरी walkthrough के लिए आपका पहला custom मॉब देखें।

We use cookies to improve your experience and analyse site traffic. Learn more