Browse Source

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

LTCatt 6 years ago
parent
commit
c895db87bd

+ 1 - 0
data/item/functions/bonus_item/bonus_item_tag.json

@@ -1,5 +1,6 @@
 {
     "is_bonus": true,
+    "bonus_clear_nbt":true,
     "bonus_new": true,
     "bonus_return": true,
     "item_name":"{\"text\": \"破损的钓鱼竿\",\"color\": \"green\"}",

+ 2 - 0
data/item/functions/bonus_item/tp.mcfunction

@@ -1,4 +1,6 @@
 #as item
 tp @s @a[tag=item_op,limit=1]
 tag @s add bonus_old
+# 判断是否需要清除nbt tag
+execute if data entity @s Item.tag{"bonus_clear_nbt":true} run data remove entity @s Item.tag
 data modify entity @s PickupDelay set value 0

+ 31 - 0
data/item/loot_tables/chests/test.json

@@ -0,0 +1,31 @@
+{
+    "type": "minecraft:chest",
+    "pools": [
+      {
+        "rolls": 1,
+        "entries": [
+          {
+            "type": "minecraft:item",
+            "weight": 1,
+            "functions": [
+              {
+                "function": "minecraft:set_damage",
+                "damage": {
+                  "min": 0.1,
+                  "max": 0.5
+                }
+              },
+              {
+                "function": "minecraft:enchant_randomly"
+              },
+              {
+                "function": "minecraft:set_nbt",
+                "tag": "{\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_return\":1b,\"item_name\":\"\\\"弓\\\"\",\"bonus_give_items\":[{\"id\":\"minecraft:arrow\",\"Count\":64,\"tag\":{\"is_bonus\":1b,\"bonus_clear_nbt\":1b}}]}"
+              }
+            ],
+            "name": "minecraft:bow"
+          }
+        ]
+      }
+    ]
+  }

+ 2 - 1
data/item/tags/items/bonus.json

@@ -1,5 +1,6 @@
 {
     "values": [
-        "minecraft:fishing_rod"
+        "minecraft:fishing_rod",
+        "minecraft:bow"
     ]
 }