我的世界篝火系统怎么用命令方块实现?服务器多人生存中,为了更加接近真实的生存环境,建议采用本期推荐的篝火系统。这并不属于原版游戏中的任何属性,但是我们可以利用命令方块加上红石电路轻松实现接近真实生存环境的篝火系统。
篝火系统:
先把新的五个计分板贴上来:
/scoreboard objectives add vc dummy
复制代码
/scoreboard objectives add ch dummy
复制代码
/scoreboard objectives add cc dummy
复制代码
/scoreboard objectives add cl dummy
复制代码
/scoreboard objectives add cb dummy
复制代码
解析:
vc=变量cold的上限,多久减1温度
ch=玩家的头盔
cc=玩家的衣服
cl=玩家的裤子
cb=玩家的鞋子
然后搭建一个这样的新系统:
20个指令,分别为玩家的头盔、衣服。裤子、鞋子根据不同的材料设置不同的分数:
/scoreboard players set @e[type=Player] ch 5 {Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}
/scoreboard players set @e[type=Player] ch 10 {Inventory:[{Slot:103b,id:"minecraft:golden_helmet"}]}
/scoreboard players set @e[type=Player] ch 15 {Inventory:[{Slot:100b,id:"minecraft:chainmail_helmet"}]}
/scoreboard players set @e[type=Player] ch 20 {Inventory:[{Slot:103b,id:"minecraft:iron_helmet"}]}
/scoreboard players set @e[type=Player] ch 25 {Inventory:[{Slot:103b,id:"minecraft:diamond_helmet"}]}
其他装备槽位如上,改一下helmet就行了。
接着改一改上篇冰块处的指令:
是的,最长的那个冰块处指令,被我改长了。
从左至右的指令分别是:
/scoreboard players set @e[type=Player] vc 0
把vc的值重置。
/execute @e[type=Player] ~ ~ ~ /scoreboard players operation @p vc += @p ch
/execute @e[type=Player] ~ ~ ~ /scoreboard players operation @p vc += @p cc
/execute @e[type=Player] ~ ~ ~ /scoreboard players operation @p vc += @p cl
/execute @e[type=Player] ~ ~ ~ /scoreboard players operation @p vc += @p cb
把穿上装备所加的分加到vc上面。
/scoreboard players remove @e[tag=voc,type=Player] cold 1
扣1点cold。
/scoreboard players tag @e[score_cold=1,type=Player] add rc
给玩家贴上rc标签。
/scoreboard players set @e[tag=rc] cold 61
把被贴上rc标签的玩家重置cold为61。
/execute @e[tag=rc] ~ ~ ~ /scoreboard players operation @p cold += @p vc
把装备加长的保暖时间加上。
/scoreboard players set @e[tag=rc] ch 0
/scoreboard players set @e[tag=rc] cc 0
/scoreboard players set @e[tag=rc] cl 0
/scoreboard players set @e[tag=rc] cb 0
重置玩家的保暖值为0。
/scoreboard players remove @e[tag=rc] temperature 1
把被贴上rc标签的玩家减少1点温度。
/scoreboard players tag @e[tag=rc] remove rc
移除rc标签。
小编点评:
玩家穿的装备越多,温度就会越高。十分适合服务器多人生存和野外冒险地图。