Просмотр исходного кода

Merge branch 'master' of github.com:00ll00/LTW3

00ll00 6 лет назад
Родитель
Сommit
194ae6d314

+ 15 - 0
data/item/advancements/special/consume_enchanted_apple.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "hurt": {
+            "trigger": "minecraft:consume_item",
+            "conditions": {
+                "item": {
+                    "item": "minecraft:enchanted_golden_apple"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:special/enchanted_apple"
+    }
+}

+ 15 - 0
data/item/advancements/special/consume_golden_apple.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "hurt": {
+            "trigger": "minecraft:consume_item",
+            "conditions": {
+                "item": {
+                    "item": "minecraft:golden_apple"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:special/golden_apple"
+    }
+}

+ 0 - 0
data/item/functions/test/bonus_item_tag.json → data/item/functions/bonus_item/bonus_item_tag.json


+ 4 - 0
data/item/functions/special/clear_effect.mcfunction

@@ -0,0 +1,4 @@
+effect clear @a[tag=consume_apple] absorption
+effect clear @a[tag=consume_apple] regeneration
+effect clear @a[tag=consume_apple] fire_resistance
+effect give @a[tag=consume_apple] minecraft:resistance 999999 4 true

+ 9 - 0
data/item/functions/special/enchanted_apple.mcfunction

@@ -0,0 +1,9 @@
+# 去除进度
+advancement revoke @s only item:special/consume_enchanted_apple
+
+# 计算生命值
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players operation @s mini_heart += @s mini_heart
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run function mini:/player_max_health
+# 去除buff
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run tag @s add consume_apple
+schedule function item:special/clear_effect 1t replace

+ 10 - 0
data/item/functions/special/golden_apple.mcfunction

@@ -0,0 +1,10 @@
+# 去除进度
+advancement revoke @s only item:special/consume_golden_apple
+
+# 计算生命值
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players add @s mini_heart 1
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run function mini:/player_max_health
+
+# 去除buff
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run tag @s add consume_apple
+schedule function item:special/clear_effect 1t replace

+ 0 - 1
data/item/functions/test/get_test_item.mcfunction

@@ -1 +0,0 @@
-summon item ~ ~ ~ {Item:{id:"fishing_rod",Count:1,tag:{"is_bonus":1b,"bonus_new":1b,"bonus_return":1b,"bonus_add_score":15,"bonus_give_items":[{"id":"minecraft:stone","Count":64,"tag":{"is_bonus":1b,"display":{"Name":'"普通的石头"'}}},{"id":"minecraft:bedrock","Count":64,"tag":{"is_bonus":1b,"display":{"Name":'"普通的基岩"'}}}],"item_name":'{"text":"破损的钓鱼竿","color":"green"}'}},CustomName:'{"text":"破损的钓鱼竿","color":"green"}',Tags:["team_green"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}

+ 2 - 2
data/item/loot_tables/gameparty/ranks/purple.json

@@ -11,7 +11,7 @@
         },
         {
             "function": "minecraft:set_nbt",
-            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +3\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":3}"
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +3\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":3,\"Motion\":[0,0,0]}"
         }
     ]
 },
@@ -22,7 +22,7 @@
     "functions": [
         {
             "function": "minecraft:set_nbt",
-            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"冲击弓, 箭 x20\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"Enchantments\":[{\"id\":\"punch\",\"lvl\":1}],\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"bonus_give_items\":[{\"id\":\"minecraft:arrow\",\"Count\":20,\"tag\":{\"is_bonus\":1b,\"bonus_clear_nbt\":1b}}]}"
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"冲击弓, 箭 x20\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"Enchantments\":[{\"id\":\"punch\",\"lvl\":1}],\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"bonus_give_items\":[{\"id\":\"minecraft:arrow\",\"Count\":20,\"tag\":{\"is_bonus\":1b,\"bonus_clear_nbt\":1b}}],\"Motion\":[0,0,0]}"
         }
     ]
 }

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

@@ -1,5 +1,11 @@
 # 如小游戏有多条命,需在小游戏中设置给玩家mini_heart生命上限并调用此函数
+# 设置生命值上限
+execute if score @s mini_heart matches 13.. run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},"小游戏生命值上限是12哦,请不要太贪心!"]
+execute if score @s mini_heart matches 13.. run scoreboard players set @s mini_heart 12
+
 # 根据玩家mini_heart数量决定生命值上限
+execute if score @s mini_heart matches 12 run attribute @s generic.max_health base set 24
+execute if score @s mini_heart matches 11 run attribute @s generic.max_health base set 22
 execute if score @s mini_heart matches 10 run attribute @s generic.max_health base set 20
 execute if score @s mini_heart matches 9 run attribute @s generic.max_health base set 18
 execute if score @s mini_heart matches 8 run attribute @s generic.max_health base set 16