Procházet zdrojové kódy

添加其他品质的测试表

LTCatt před 6 roky
rodič
revize
788abe3e9a

+ 7 - 0
data/item/functions/bonus_item/rank/blue.mcfunction

@@ -0,0 +1,7 @@
+# 生成蓝色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/ranks/blue
+data merge entity @e[distance=..1,limit=1,type=item] {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0]}
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join blue @e[tag=new_item]
+tag @e[tag=new_item] remove new_item

+ 7 - 0
data/item/functions/bonus_item/rank/green.mcfunction

@@ -0,0 +1,7 @@
+# 生成绿色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/ranks/green
+data merge entity @e[distance=..1,limit=1,type=item] {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0]}
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join green @e[tag=new_item]
+tag @e[tag=new_item] remove new_item

+ 2 - 3
data/item/functions/bonus_item/rank/purple.mcfunction

@@ -1,8 +1,7 @@
 # 生成紫色品质的物品实体
-setblock ~ ~ ~ cobweb
-loot spawn ~ ~ ~ loot item:ranks/purple
+
+loot spawn ~ ~ ~ loot item:gameparty/ranks/purple
 data merge entity @e[distance=..1,limit=1,type=item] {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0]}
 execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
 team join purple @e[tag=new_item]
 tag @e[tag=new_item] remove new_item
-setblock ~ ~ ~ air

+ 7 - 0
data/item/functions/bonus_item/rank/white.mcfunction

@@ -0,0 +1,7 @@
+# 生成白色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/ranks/white
+data merge entity @e[distance=..1,limit=1,type=item] {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0]}
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join white @e[tag=new_item]
+tag @e[tag=new_item] remove new_item

+ 26 - 0
data/item/loot_tables/gameparty/ranks/blue.json

@@ -0,0 +1,26 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 2,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +2\\\",\\\"color\\\":\\\"aqua\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":2}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:iron_sword",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"击退铁剑\\\",\\\"color\\\":\\\"aqua\\\"}\",\"Enchantments\":[\"id\":\"knockback\",\"lvl\":1],\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b}"
+        }
+    ]
+}
+
+]}]}

+ 48 - 0
data/item/loot_tables/gameparty/ranks/green.json

@@ -0,0 +1,48 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 6,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +1\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":1}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:ender_pearl",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"末影珍珠\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:netherite_sword",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"下界合金剑\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:bow",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"弓, 箭 x3\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"bonus_give_items\":[{\"id\":\"minecraft:arrow\",\"Count\":3,\"tag\":{\"is_bonus\":1b,\"bonus_clear_nbt\":1b}}]}"
+        }
+    ]
+}
+
+]}]}

+ 26 - 0
data/item/loot_tables/gameparty/ranks/purple.json

@@ -0,0 +1,26 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 2,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +3\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":3}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:bow",
+    "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}}]}"
+        }
+    ]
+}
+
+]}]}

+ 19 - 0
data/item/loot_tables/gameparty/ranks/white.json

@@ -0,0 +1,19 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 1,
+    "name": "minecraft:arrow",
+    "functions": [
+        {
+            "function": "minecraft:set_count",
+            "count": 3
+        },
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"箭 x3\\\",\\\"color\\\":\\\"white\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b}"
+        }
+    ]
+}
+
+]}]}

+ 0 - 31
data/item/loot_tables/ranks/purple.json

@@ -1,31 +0,0 @@
-{
-    "pools": [
-      {
-        "rolls": 1,
-        "entries": [
-          {
-            "type": "minecraft:item",
-            "weight": 3,
-            "name": "minecraft:nether_star",
-            "functions": [
-                {
-                    "function": "minecraft:set_nbt",
-                    "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +3\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":3}"
-                }
-            ]
-          },
-          {
-            "type": "minecraft:item",
-            "weight": 1,
-            "name": "minecraft:bow",
-            "functions": [
-                {
-                    "function": "minecraft:set_nbt",
-                    "tag": "{\"item_name\":\"{\\\"text\\\":\\\"击退弓, 箭 x20\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"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}}]}"
-                }
-            ]
-          }
-        ]
-      }
-    ]
-  }