npc自救教程

前置指令
/scoreboard objectives add 次數(shù) dummy
/scoreboard objectives add 擊打間隔 dummy
第一列
循環(huán)/無條件/紅石控制/延遲15
damage @p 0 suicide entity @e[type=villager,c=1]
連鎖/有條件/保持開啟/延遲0
damage @p 0 suicide entity @e[type=villager,c=1]
連鎖/有條件/保持開啟/延遲0
damage @p 0 suicide entity @e[type=villager,c=1]
連鎖/有條件/保持開啟/延遲0
damage @p 0 suicide entity @e[type=iron_golem,c=1]
連鎖/有條件/保持開啟/延遲0
damage @p 0 suicide entity @e[type=villager,c=1]
連鎖/有條件/保持開啟/延遲0
scoreboard players remove @p 次數(shù) 1
第二列
循環(huán)/無條件/保持開啟/延遲0
replaceitem entity @e[type=villager,c=1] slot.armor.head 0 keep diamond_helmet 1 2400
連鎖/有條件/保持開啟/延遲0
scoreboard players add @p 次數(shù) 1
連鎖/有條件/保持開啟/延遲0
scoreboard players set @p 擊打間隔 0
連鎖/有條件/保持開啟/延遲0
damage @p 0 entity_attack entity @p
循環(huán)/無條件/保持開啟/延遲0
tp @e[type=villager,c=1] 平臺坐標請自寫 facing @p
循環(huán)/無條件/保持開啟/延遲0
effect @e[type=villager,c=1] resistance 1 255 true
循環(huán)/無條件/保持開啟/延遲0
tp @e[type=iron_golem,c=1] 鐵傀儡坐標請看視頻并自寫
第三列
循環(huán)/無條件/保持開啟/延遲20
scoreboard players add @a[scores={次數(shù)=!0}] 擊打間隔 1
第四列
循環(huán)/無條件/保持開啟/延遲0
execute @a[scores={擊打間隔=2,次數(shù)=!0}] ~~~ scoreboard players set @s 擊打間隔 0
連鎖/有條件/保持開啟/延遲0
setblock 坐標請看視頻并自寫 redstone_block
第五列-不必要
循環(huán)/無條件/保持開啟/延遲0
execute @a[hasitem={item=diamond,data=2400,location=slot.weapon.mainhand}] ~~~ setblock ~ ~-0.1 ~ wool 0 keep
第六列-必要部分
scoreboard players set @p 次數(shù) 0
setblock 坐標請看視頻并自寫 air
第七列
循環(huán)/無條件/保持開啟/延遲0
testfor @p[scores={次數(shù)=0]
連鎖/有條件/保持開啟/延遲0
setblock 坐標請看視頻并自寫 air
第八列-不必要
循環(huán)/無條件/保持開啟
replaceitem entity @p slot.hotbar 2 wool 64
都看完了,真的不考慮給個三連嗎QAQ