HerobrineXia 5 лет назад
Родитель
Сommit
17f6fd3aca

+ 5 - 1
data/mini/functions/trade/game/new_trade_s.mcfunction

@@ -1,4 +1,8 @@
-loot spawn ~ ~ ~ loot mini:trade_s
+execute if score @s temp matches 1 run loot spawn ~ ~ ~ loot mini:trade_s
+execute if score @s temp matches 2 run loot spawn ~ ~ ~ loot mini:trade_a
+# execute if score @s temp matches 3 run loot spawn ~ ~ ~ loot mini:trade_s
+# execute if score @s temp matches 4 run loot spawn ~ ~ ~ loot mini:trade_s
+# execute if score @s temp matches 5 run loot spawn ~ ~ ~ loot mini:trade_s
 data modify entity @s Offers.Recipes append value {rewardExp:false,xp:20}
 data modify entity @s Offers.Recipes[-1].buy set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.buy
 data modify entity @s Offers.Recipes[-1].buyB set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.buyB

+ 201 - 0
data/mini/loot_tables/trade_a.json

@@ -0,0 +1,201 @@
+{
+    "type": "entity",
+    "functions": [
+        {
+            "function": "set_nbt",
+            "tag": "{TradeItem:1b}"
+        }
+    ],
+    "pools": [
+        {
+            "rolls": 1,
+            "entries": [
+                {
+                    "type": "group",
+                    "children": [
+                        {
+                            "type": "item",
+                            "name": "stone",
+                            "functions": [
+                                {
+                                    "function": "set_nbt",
+                                    "tag": "{buy:{id:\"bowl\",Count:2}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{sell:{id:\"emerald\",Count:1}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{maxUses:2}"
+                                }
+                            ],
+                            "conditions": [
+                                {
+                                    "condition": "inverted",
+                                    "term": {
+                                        "condition": "minecraft:entity_properties",
+                                        "entity": "this",
+                                        "predicate": {
+                                            "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:bowl\"}}]}}"
+                                        }
+                                    }
+                                }
+                            ]
+                        },
+                        {
+                            "type": "item",
+                            "name": "stone",
+                            "functions": [
+                                {
+                                    "function": "set_nbt",
+                                    "tag": "{buy:{id:\"wheat_seeds\",Count:1}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{sell:{id:\"emerald\",Count:1}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{maxUses:2}"
+                                }
+                            ],
+                            "conditions": [
+                                {
+                                    "condition": "inverted",
+                                    "term": {
+                                        "condition": "minecraft:entity_properties",
+                                        "entity": "this",
+                                        "predicate": {
+                                            "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:wheat_seeds\"}}]}}"
+                                        }
+                                    }
+                                }
+                            ]
+                        },
+                        {
+                            "type": "item",
+                            "name": "stone",
+                            "functions": [
+                                {
+                                    "function": "set_nbt",
+                                    "tag": "{buy:{id:\"light_gray_dye\",Count:1}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{sell:{id:\"emerald\",Count:1}}"
+                                },
+                                {
+                                    "function": "set_nbt",
+                                    "tag":"{maxUses:2}"
+                                }
+                            ],
+                            "conditions": [
+                                {
+                                    "condition": "inverted",
+                                    "term": {
+                                        "condition": "minecraft:entity_properties",
+                                        "entity": "this",
+                                        "predicate": {
+                                            "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:light_gray_dye\"}}]}}"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "type": "item",
+                    "name": "stone",
+                    "functions": [
+                        {
+                            "function": "set_nbt",
+                            "tag": "{buy:{id:\"oak_boat\",Count:1}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{sell:{id:\"emerald\",Count:3}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{maxUses:2}"
+                        }
+                    ],
+                    "conditions": [
+                        {
+                            "condition": "inverted",
+                            "term": {
+                                "condition": "minecraft:entity_properties",
+                                "entity": "this",
+                                "predicate": {
+                                    "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:oak_boat\"}}]}}"
+                                }
+                            }
+                        }
+                    ]
+                },
+                {
+                    "type": "item",
+                    "name": "stone",
+                    "functions": [
+                        {
+                            "function": "set_nbt",
+                            "tag": "{buy:{id:\"oak_sapling\",Count:1}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{sell:{id:\"emerald\",Count:2}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{maxUses:2}"
+                        }
+                    ],
+                    "conditions": [
+                        {
+                            "condition": "inverted",
+                            "term": {
+                                "condition": "minecraft:entity_properties",
+                                "entity": "this",
+                                "predicate": {
+                                    "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:oak_sapling\"}}]}}"
+                                }
+                            }
+                        }
+                    ]
+                },
+                {
+                    "type": "item",
+                    "name": "stone",
+                    "functions": [
+                        {
+                            "function": "set_nbt",
+                            "tag": "{buy:{id:\"stripped_oak_log\",Count:1}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{sell:{id:\"emerald\",Count:2}}"
+                        },
+                        {
+                            "function": "set_nbt",
+                            "tag":"{maxUses:2}"
+                        }
+                    ],
+                    "conditions": [
+                        {
+                            "condition": "inverted",
+                            "term": {
+                                "condition": "minecraft:entity_properties",
+                                "entity": "this",
+                                "predicate": {
+                                    "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:stripped_oak_log\"}}]}}"
+                                }
+                            }
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}