我的世界中,不少玩家都遇见过别人房子上的浮空字吧?那么具体浮空字要怎么做呢?大家别急,下面就让小编来告诉大家吧!
相关下载: 网易版我的世界手游 1.1.2.50 安卓网易最新版大小:56.2M
初步思路:利用玩家右键村民这个准则实现检测右键点击,用实体受到伤害和玩家是否造成伤害来检测玩家是否左键点击。
在村民的nbt上,普通村民右键是会出现交易框的,在这里加上Offers:{Recipes:[]}这个nbt即可消除显示。(村民无任何交易选项,无法交易,故不显示)。对于受伤害实体的nbt,你需要做的是让它不会轻易被玩家攻击致死。小编的方法就是使用生命提升和生命恢复,因为如果用抗性提升后无法检测到实体被攻击。
代码:
创建变量:
/scoreboard objectives add villager stat.talkedToVillager 右键村民/scoreboard objectives add ifhit stat.damageDealt 造成伤害/scoreboard objectives add hit dummy 受到伤害
右键浮空字:召唤实体:
/summon armor_stand ~ ~ ~ {CustomName:"领取甘蔗(右键)",CustomNameVisible:1b,NoBasePlate:1,NoGravity:1,Invisible:1}
/summon villager ~ ~ ~ {NoAI:1b,Silent:1b,Offers:{Recipes:[]},ActiveEffects:[{Id:14,Duration:9999999,Amplifier:0,Ambient:1,ShowParticles:0b}],Tags:["lqgz"]}
右键触发:[高频循环]
/execute @e[type=villager,tag=lqgz] ~ ~ ~ give @a[score_villager_min=1,r=6] reeds 1 0 {display:{Name:"www.Ganxiaozhe.com"}}
/scoreboard players set @a[score_villager_min=1] villager 0
左键浮空字:召唤实体:
/summon armor_stand ~ ~ ~ {CustomName:"回复血量(左键)",CustomNameVisible:1b,NoBasePlate:1,NoGravity:1,Invisible:1}
/summon Sheep ~ ~0.5 ~ {CustomName:"hit",NoAI:1,Silent:1,ActiveEffects:[{Id:14,Amplifier:0,Duration:500000,ShowParticles:0b},{Id:21,Amplifier:100,Duration:500000,ShowParticles:0b},{Id:10,Amplifier:100,Duration:500000,ShowParticles:0b}]}
左键触发:[高频循环]
/scoreboard players add @e[type=Sheep,name=hit] hit 1 {HurtTime:10s}
/execute @e[type=Sheep,name=hit,score_hit_min=1] ~ ~ ~ effect @a[score_ifhit_min=1,r=6] 10 1 10 true
/execute @e[type=Sheep,name=hit,score_hit_min=1] ~ ~ ~ tellraw @a[score_ifhit_min=1,r=6] [{"text":"你的血量已回复","color":"red","bold":"true"}]
/scoreboard players set @e[type=Sheep,name=hit,score_hit_min=1] hit 0
/scoreboard players set @a[score_ifhit_min=1] ifhit 0
保证实体正常运行:使村民保持隐形:[高频循环]
/effect @e[type=villager,tag=lqgz] invisibility 100000 0 true
使羊保持隐形、抗性并回复血量:[高频循环]
/effect @e[type=Sheep,name=hit] invisibility 100000 0 true
/effect @e[type=Sheep,name=hit] health_boost 100000 100 true
/effect @e[type=Sheep,name=hit] regeneration 100000 100 true
以上就是小编带来的我的世界浮空字制作技巧步骤教程了,如果你也想用这些装饰一下你的世界的话,就试试吧!