Skip to main content
Bookshelf Bookshelf Bookshelf
    搜索 Ctrl+K
    • English
    • 中文
    • 快速开始
    • 模块
    • 示例
    • 参与贡献
    • 更新日志
    • Related
    • FAQ

      运行时模块(Runtime)

      • 🖥️ 位运算(Bitwise)
      • 🧱 方块(Block)
      • 🗂️ Collection
      • 🎨 颜色(Color)
      • ⛰️ 环境(Environment)
      • 🏗️ 生成(Generation)
      • ❤️ 生命(Health)
      • 🎯 碰撞箱(Hitbox)
      • 🏷️ 编号(ID)
      • 🖱️ 交互(Interaction)
      • 🔗 链接(Link)
      • 🧮 数学(Math)
      • 🏃 移动(Move)
      • 🧭 位置(Position)
      • 🎲 随机(Random)
      • 🔦 射线追踪(Raycast)
      • ⏲️ 计划(Schedule)
      • 📰 侧边栏(Sidebar)
      • 🧣 样条曲线(Spline)
      • 🔠 字符串(String)
      • ⌚ 时间(Time)
      • ➡️ 向量(Vector)
      • 👀 视线(View)
      • 🏅 经验值(XP)

      开发模块(Development)

      • 🔬 转存(Dump)
      • 📄 日志(Log)

      预制件(Prefabs)

      • 🌳 树库(Tree)
      1. 模块
      2. 侧边栏(Sidebar)
      • Copy page
      • View source

      📰 侧边栏(Sidebar)#

      #bs.sidebar:help

      使用记分板系统创建视觉吸引力和动态的侧边栏。


      🔧 函数#

      你可以在下方找到此模块中的所有可用函数。


      创建#

      #bs.sidebar:create

      创建并注册新的侧边栏。

      输入:

      函数宏:

      • 参数

        • objective: 用于侧边栏的计分项。

        • display_name: 显示的计分项名称。必须是有效的 SNBT 文本组件。

        • contents: 侧边栏上显示的行内容。

          • : 必须是有效的 SNBT 文本组件,或是包含左右两侧 SNBT 文本组件的数组。

      示例:创建并显示一个左对齐文本的新侧边栏:

      # Create a new sidebar
      function #bs.sidebar:create { \
          objective: "my_guessing_game", \
          display_name: { text: "Guess my name" }, \
          contents: [ \
              { text: " Clues:", color: "gold", bold: true }, \
              { text: "  • I gave my name to a famous test" }, \
              { text: "  • I am a pioneer of computer science and AI" }, \
              [{ text: " My name is: " }, { score: { objective: "enigma", name: "VHVyaW5n" }}], \
          ], \
      }
      
      # Display the sidebar
      scoreboard objectives setdisplay sidebar my_guessing_game
      

      示例:创建并显示一个右对齐文本的新侧边栏:

      # Create a new sidebar
      function #bs.sidebar:create { \
          objective: "my_guessing_game_2", \
          display_name: { text: "Guess my name V2" }, \
          contents: [ \
              ["", { text: " Clues:", color: "gold", bold: true }], \
              ["", { text: "  • I gave my name to a famous test" }], \
              ["", { text: "  • I am a pioneer of computer science and AI" }], \
              ["", [{ text: " My name is: " }, { score: { objective: "enigma", name: "VHVyaW5n" }}]], \
          ], \
      }
      
      # Display the sidebar
      scoreboard objectives setdisplay sidebar my_guessing_game_2
      

      制作人员:Aksiome


      刷新#

      #bs.sidebar:refresh

      更新侧边栏的动态部分。

      输入:

      函数宏:

      • 参数

        • objective: 要刷新侧边栏的记分项(objective)。

      示例:刷新侧边栏:

      function #bs.sidebar:refresh {objective:"my_guessing_game"}
      

      制作人员:Aksiome


      💬 这对你有帮助吗?

      欢迎在下方留下你的问题和反馈!

      Previous 计划(Schedule) Next 样条曲线(Spline)

      On this page

      • 函数
        • 创建
        • 刷新
      mcbookshelf/Bookshelf
      - -
      Edit this page

      © Copyright 2025, Gunivers

      Made with Sphinx and Breeze theme.

       Code of Conduct  License (MPL 2.0)  Mentions Légales (FR)
      Back to top