示例:耐力条
最后更新于
最后更新于
改前:
改后:
将图像和文本向上移动
plugins\CustomNameplates\contents\images\coin.yml
image: coin
height: 10
ascent: -14 → -5
width: 10
plugins\CustomNameplates\configs\custom-placeholders.yml
descent-text:
money:
text: "%vault_eco_balance%"
descent: 23 → 14
is-unicode: false
现在重新加载插件并重新安装资源包以查看更改。
默认配置在玩家处于水中时隐藏金钱,但在这种情况下我们不必隐藏它。
plugins\CustomNameplates\configs\custom-placeholders.yml
# 改前
conditional-text:
actionbar:
priority_1:
text: '%nameplates_background_other_actionbar%'
conditions:
'||':
'!=':
value1: '%player_remaining_air%'
value2: "300"
'!gamemode': survival
priority_2:
text: '%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'!equals':
value1: '%nameplates_actionbar%'
value2: ""
priority_3:
text: '%nameplates_static_money_hud%'
# 改后
conditional-text:
actionbar:
priority_1:
text: '%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'||':
'!=':
value1: '%player_remaining_air%'
value2: "300"
'!gamemode': survival
priority_2:
text: '%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'!equals':
value1: '%nameplates_actionbar%'
value2: ""
priority_3:
text: '%nameplates_static_money_hud%'
现在重新加载配置文件并查看结果。
添加耐力条
方法 1: 由于我们知道此 HUD 的宽度是固定的,我们可以使用 %nameplates_offset_100%%nameplates_vanilla_stamina_hud%
来添加另一行
conditional-text:
actionbar:
priority_1:
text: '%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'||':
'!=':
value1: '%player_remaining_air%'
value2: "300"
'!gamemode': survival
priority_2:
text: '%nameplates_offset_100%%nameplates_vanilla_stamina_hud%%nameplates_offset_-180%%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'!equals':
value1: '%nameplates_actionbar%'
value2: ""
priority_3:
text: '%nameplates_offset_100%%nameplates_vanilla_stamina_hud%%nameplates_offset_-180%%nameplates_static_money_hud%'
方法 2: 我们也可以使用静态文本
static-text:
stamina_hud:
position: right
text: '%nameplates_vanilla_stamina_hud%'
value: 180
conditional-text:
actionbar:
priority_1:
text: '%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'||':
'!=':
value1: '%player_remaining_air%'
value2: "300"
'!gamemode': survival
priority_2:
text: '%nameplates_static_stamina_hud%%nameplates_offset_-180%%nameplates_static_money_hud%%nameplates_offset_-180%%nameplates_static_other_actionbar%'
conditions:
'!equals':
value1: '%nameplates_actionbar%'
value2: ""
priority_3:
text: '%nameplates_static_stamina_hud%%nameplates_offset_-180%%nameplates_static_money_hud%'