The Best Resource for Minecraft
The Best Resource for Minecraft

Bossbars और titles: स्थायी स्थिति, समय और value/max विभाजन

Bossbars और titles: स्थायी स्थिति, समय और value/max विभाजन

एक bossbar रीस्टार्ट के बाद भी बना रहता है और title नहीं। यहाँ बनाएँ-फिर-संशोधित-करें पैटर्न, फ़ेड टाइमिंग जो लोग उल्टी सेट करते हैं, और प्रोग्रेस बार को चलाने का तरीका बताया गया है।

दोनों स्क्रीन पर टेक्स्ट दिखाते हैं और समानता यहीं समाप्त होती है। Titles बस चलाकर छोड़ देने वाले होते हैं; bossbars स्थायी ऑब्जेक्ट्स हैं जिन्हें आपको प्रबंधित करना होता है।

Bossbars स्टेटफ़ुल होते हैं

/bossbar add my:timer {"text":"Time left"}
/bossbar set my:timer players @a
/bossbar set my:timer max 600
/bossbar set my:timer value 600
/bossbar set my:timer color red
/bossbar set my:timer style notched_10

एक id, फिर उसे संशोधित करने वाले कमांड। वे बिंदु जहाँ लोग गलती करते हैं:

  • बार तब तक अदृश्य रहता है जब तक कि इसमें खिलाड़ी न हों। एक बनाना और कभी न चलाना

set ... players produces nothing, with no error.

  • यह विश्व सेव में बना रहता है। मिनीगेम के लिए बनाया गया बार अगले

सत्र में भी बना रहता है। /bossbar remove when finished, or they accumulate.

  • value and max are separate, और बार दिखाता है value / max. Setting only

value on a bar whose max is still 100 gives nonsense fill.

रंग: pink white red orange yellow green blue purple. Styles: progress notched_6 notched_10 notched_12 notched_20.

उलटी गिनती चलाना

/bossbar set my:timer value 599

दोहराने वाले फ़ंक्शन से प्रति सेकंड एक बार पूरी प्रणाली है। कोई अंतर्निहित टाइमर नहीं है। इसे वापस पढ़ना भी उपयोगी है:

/execute store result score @s Left run bossbar get my:timer value

bossbar get supports value, max, players and visible, which makes a bossbar a workable global variable when you want the player to see it.

Titles क्षणिक होते हैं

/title @a times 10 70 20
/title @a subtitle {"text":"Get ready"}
/title @a title {"text":"Round 2"}

उस क्रम में तीन चीजें, और क्रम महत्वपूर्ण है:

  1. times first. title के बाद इसे सेट करने से पहले से दिखाए गए title पर कोई प्रभाव नहीं पड़ता है।
  2. subtitle before title. अकेला subtitle कुछ भी प्रदर्शित नहीं करता है; title भेजना

ही दोनों को दिखने के लिए ट्रिगर करता है। उलटा करने पर, पहला बिना किसी subtitle के दिखाई देता है।

times is fadeIn stay fadeOut ticks में — प्रति सेकंड 20 ticks। 10 70 20 is half a second in, three and a half held, one out. People set 1 1 1 and wonder why nothing appears: three ticks total is a flash.

actionbar अलग है

/title @a actionbar {"text":"Saved"}

hotbar के ऊपर की पंक्ति। यह अनदेखा करता है times entirely — it shows for a fixed couple of seconds and fades. Re-sending it every tick keeps it up permanently, which is the standard way to run a custom HUD.

साफ़ करना

/title @a clear removes what is showing; /title @a reset also restores default timings. For bossbars, /bossbar set my:timer visible false hides without destroying state.

bossbar, title, और बाकी नियंत्रण एवं डिबग कमांड को एक फ़ॉर्म से इसमें बनाएँ: Advanced Command Builder — नियंत्रण और डिबग.

टूल आज़माएं: Advanced Command Builder — Control & Debug →