全站通知:
载具引擎(VVE)/快捷栏UI
刷
历
编
阅读
2022-08-16更新
最新编辑:HangBack
阅读:
更新日期:2022-08-16
最新编辑:HangBack
跳到导航
跳到搜索
本页面内容并不完整,可能有错误或者遗漏的地方 我的世界玩家社区WIKI 欢迎您帮助我们完善这个页面
简介
快捷栏UI是通过hotbar
向玩家提供交互按键的系统。
注册并编写快捷栏UI
- 打开
data/vehicles/functions/guis
- 确定UI序号
n
- 新建
n
.mcfunction(下文称为gui
函数) - 打开
items
- 新建
n
.mcfunction(下文称为item
函数) - 在
gui
函数中编写以下内容:scoreboard players operation temp_id int = @s ctrl_vehicle
execute as @e[tag=vehicle] if score @s vehicle_id = temp_id int run tag @s add tmp
scoreboard players set temp_re int 1
execute if score temp_re int matches 0 run function vehicles:guis/items/n
tag @e remove tmp - 在
item
函数中编写以下内容:clear @s #vehicles:all{vehicle_ui:1b}
function vehicles:guis/drop_hotbar - 每次添加一个按钮都在item函数中做好快捷栏重置,在gui函数中做好按键检测和重置判断。需要重置快捷栏的时候执行
scoreboard players set temp_re int 0
- 按钮实现功能的细节参考
1
号示例UI