我的世界可點(diǎn)擊的浮空字怎么做?可點(diǎn)擊的浮空字在游戲中可以說(shuō)是非常好玩的一件事,玩家可以通過右鍵或左鍵來(lái)對(duì)浮空字進(jìn)行點(diǎn)擊,接下來(lái)西西就給大家?guī)?lái)的是可點(diǎn)擊的浮空字制作方法詳解!
我的世界可點(diǎn)擊的浮空字制作方法介紹
在服務(wù)器里也不需要玩家具有權(quán)限,是不是要右鍵比告示牌炫酷多了呢?代碼適用版本為1.11.2 (點(diǎn)擊圖片查看動(dòng)圖)
圖片就介紹到這里,下面是思路以及代碼部分~
整體思路:
初步思路是利用玩家右鍵村民這個(gè)準(zhǔn)則實(shí)現(xiàn)檢測(cè)右鍵點(diǎn)擊,用實(shí)體受到傷害和玩家是否造成傷害來(lái)檢測(cè)玩家是否左鍵點(diǎn)擊。
在村民的nbt上,普通村民右鍵是會(huì)出現(xiàn)交易框的,這里為其加上Offers:{Recipes:[]}這個(gè)nbt即可消除顯示。(村民無(wú)任何交易選項(xiàng),無(wú)法交易,故不顯示)。對(duì)于受傷害實(shí)體的nbt,你需要使它不會(huì)輕易被玩家攻擊致死。這里我使用生命提升和生命恢復(fù),因?yàn)槿绻每剐蕴嵘鬅o(wú)法檢測(cè)到實(shí)體被攻擊。
代碼:
創(chuàng)建變量:
/scoreboard objectives add villager stat.talkedToVillager 右鍵村民 /scoreboard objectives add ifhit stat.damageDealt 造成傷害 /scoreboard objectives add hit dummy 受到傷害
右鍵浮空字:
召喚實(shí)體:
/summon armor_stand ~ ~ ~ {CustomName:"領(lǐng)取甘蔗(右鍵)",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"]}
右鍵觸發(fā):[高頻循環(huán)]
/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
左鍵浮空字:
召喚實(shí)體:
/summon armor_stand ~ ~ ~ {CustomName:"回復(fù)血量(左鍵)",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}]}
左鍵觸發(fā):[高頻循環(huán)]
/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":"你的血量已回復(fù)","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
保證實(shí)體正常運(yùn)行:
使村民保持隱形:[高頻循環(huán)]
/effect @e[type=villager,tag=lqgz] invisibility 100000 0 true
使羊保持隱形、抗性并回復(fù)血量:[高頻循環(huán)]
/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