Ver código fonte

绿色物品表

LTCatt 6 anos atrás
pai
commit
9d793f7a9a

+ 11 - 0
data/item/functions/bonus_item/gameparty/normal/green.mcfunction

@@ -0,0 +1,11 @@
+# 生成绿色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/normal/green
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+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] add item_green
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 96 - 0
data/item/loot_tables/gameparty/normal/green.json

@@ -0,0 +1,96 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 26,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_count",
+            "count": 2
+        },
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +2\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":2}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 4,
+    "name": "minecraft:golden_apple",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"生命果\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"display\":{\"Lore\":[\"{\\\"text\\\":\\\"恢复 4 颗心或生命值 +1\\\",\\\"italic\\\":0,\\\"color\\\":\\\"gray\\\"}\"],\"Name\":\"{\\\"text\\\":\\\"生命果\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 4,
+    "name": "minecraft:iron_sword",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"<击退 II> 铁剑\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"Enchantments\":[{\"id\":\"knockback\",\"lvl\":2}],\"display\":{\"Name\":\"{\\\"text\\\":\\\"<击退 II> 铁剑\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 4,
+    "name": "minecraft:ender_pearl",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"末影珍珠\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"display\":{\"Name\":\"{\\\"text\\\":\\\"末影珍珠\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 3,
+    "name": "minecraft:splash_potion",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"缓慢 V (0:10)\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"CustomPotionEffects\":[{\"Id\":2,\"Amplifier\":0,\"Duration\":200}],\"CustomPotionColor\":11458519,\"display\":{\"Name\":\"{\\\"text\\\":\\\"喷溅型迟缓药水\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 3,
+    "name": "minecraft:splash_potion",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"跳跃提升 VII (0:02)\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"CustomPotionEffects\":[{\"Id\":8,\"Amplifier\":6,\"Duration\":40}],\"CustomPotionColor\":2292811,\"display\":{\"Name\":\"{\\\"text\\\":\\\"喷溅型跳跃药水\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 4,
+    "name": "minecraft:crossbow",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"<快速装填 III> 弩, 箭 x15\\\",\\\"color\\\":\\\"green\\\"}\",\"Enchantments\":[{\"id\":\"quick_charge\",\"lvl\":3}],\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"bonus_give_items\":[{\"id\":\"minecraft:arrow\",\"Count\":15,\"tag\":{\"is_bonus\":1b,\"bonus_clear_nbt\":1b}}],\"display\":{\"Name\":\"{\\\"text\\\":\\\"<快速装填 III> 弩\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}"
+        }
+    ]
+},
+{
+    "type": "minecraft:item",
+    "weight": 4,
+    "name": "minecraft:fishing_rod",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"钓鱼竿\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"display\":{\"Name\":\"{\\\"text\\\":\\\"钓鱼竿\\\",\\\"italic\\\":0,\\\"color\\\":\\\"green\\\"}\"}}"
+        }
+    ]
+}
+
+]}]}