Преглед изворни кода

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt пре 5 година
родитељ
комит
57397605df

+ 2 - 2
data/mini/functions/colormatch/tick2.mcfunction

@@ -1,7 +1,7 @@
 
 
 # 检测玩家死亡
 # 检测玩家死亡
-execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ magma_block run function mini:colormatch/player_lose_heart
-execute as @a[tag=mini_running] at @s if block ~ ~-2 ~ magma_block run function mini:colormatch/player_lose_heart
+execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ magma_block if score $state mem matches 5 run function mini:colormatch/player_lose_heart
+execute as @a[tag=mini_running] at @s if block ~ ~-2 ~ magma_block if score $state mem matches 5 run function mini:colormatch/player_lose_heart
 
 
 # 检测玩家背包
 # 检测玩家背包
 execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b},Count:1b}] run function mini:colormatch/game/show_floor_block
 execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b},Count:1b}] run function mini:colormatch/game/show_floor_block

+ 7 - 7
data/mini/functions/hotpm/game_init.mcfunction

@@ -19,19 +19,19 @@ kill @e[type=trident]
 # 生成地图
 # 生成地图
 
 
 #   101
 #   101
-setblock 1023 4 3022 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"!",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm101",sizeY:24,sizeZ:23,showboundingbox:0b}
-setblock 1023 5 3022 minecraft:redstone_block
+setblock 1032 4 3031 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm101",sizeY:32,sizeZ:32,showboundingbox:0b}
+setblock 1032 5 3031 minecraft:redstone_block
 
 
 #   100
 #   100
-setblock 1023 4 2999 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm100",sizeY:24,sizeZ:23,showboundingbox:0b}
-setblock 1023 5 2999 minecraft:redstone_block
+setblock 1032 4 2999 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm100",sizeY:32,sizeZ:32,showboundingbox:0b}
+setblock 1032 5 2999 minecraft:redstone_block
 
 
 #   001
 #   001
-setblock 1000 4 3022 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:1b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm001",sizeY:23,sizeZ:22,showboundingbox:0b}
-setblock 1000 5 3022 minecraft:redstone_block
+setblock 1000 4 3031 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm001",sizeY:32,sizeZ:32,showboundingbox:0b}
+setblock 1000 5 3031 minecraft:redstone_block
 
 
 #   000
 #   000
-setblock 1000 4 2999 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm000",sizeY:24,sizeZ:23,showboundingbox:0b}
+setblock 1000 4 2999 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm000",sizeY:32,sizeZ:32,showboundingbox:0b}
 setblock 1000 5 2999 minecraft:redstone_block
 setblock 1000 5 2999 minecraft:redstone_block
 
 
 # 生成物品
 # 生成物品

+ 6 - 0
data/mini/functions/main/lose_heart_effect.mcfunction

@@ -0,0 +1,6 @@
+effect clear @a[tag=have_totem] regeneration
+effect clear @a[tag=have_totem] fire_resistance
+effect clear @a[tag=have_totem] absorption
+effect give @a[tag=have_totem] resistance 999999 4
+effect give @a[tag=have_totem] instant_health 1 10
+tag @a[tag=have_totem] remove have_totem

+ 9 - 1
data/mini/functions/main/player_lose_heart.mcfunction

@@ -1,7 +1,15 @@
 # 玩家失去一条命时调用此函数
 # 玩家失去一条命时调用此函数
 
 
+# 检测不死图腾
+execute if score @s mini_heart matches 1 if entity @s[nbt={SelectedItem:{id:"minecraft:totem_of_undying"}}] run tag @s add have_totem
+execute if score @s mini_heart matches 1 if entity @s[nbt={Inventory:[{Slot:-106b,id:"minecraft:totem_of_undying"}]}] run tag @s add have_totem
+execute if entity @s[tag=have_totem] run effect clear @s resistance
+execute if entity @s[tag=have_totem] run effect give @s instant_damage 1 10 true
+execute if entity @s[tag=have_totem] run effect give @s instant_damage 1 10 true
+schedule function mini:main/lose_heart_effect 1t
+
 # 减少命
 # 减少命
-execute if score @s mini_heart matches 1.. run scoreboard players remove @s mini_heart 1
+execute if score @s[tag=!have_totem] mini_heart matches 1.. run scoreboard players remove @s mini_heart 1
 execute at @s run function lib:sounds/hurt
 execute at @s run function lib:sounds/hurt
 # 计算血量
 # 计算血量
 function mini:main/player_max_health
 function mini:main/player_max_health