《我的世界》可点击浮空字超详细制作教程

作者:网络 来源:网络 更新时间:2017-11-07 11:08:10
初步思路是利用玩家右键村民这个准则实现检测右键点击,用实体受到伤害和玩家是否造成伤害来检测玩家是否左键点击。
整体思路: 初步思路是利用玩家右键村民这个准则实现检测右键点击,用实体受到伤害和玩家是否造成伤害来检测玩家是否左键点击。 在村民的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
salon36