I have the following patch, which is applied to all entity loot tables (via the pattern "loot_table/entities/.*\\.json"):
[
{
"op": "test",
"path": "/type",
"value": "minecraft:entity"
},
{
"op": "test",
"path": "/pools/0/entries/0/name",
"value": "minecraft:rotten_flesh"
},
{
"op": "copy",
"from": "/pools/0",
"path": "/temporary_pool"
},
{
"op": "add",
"path": "/temporary_pool/entries/0/name",
"value": "gcats:cloth"
},
{
"op": "move",
"from": "/temporary_pool",
"path": "/pools/-"
}
]
I expected it to add a new pool that's the same as the first pool but with minecraft:rotten_flesh replaced with gcats:cloth, leaving the first pool unaffected. However, it replaces name in the first pool as well. Here is the output of /patched dump file minecraft:loot_table/entities/zombie.json:
{
"type": "minecraft:entity",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 0.0
},
"function": "minecraft:set_count"
},
{
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"enchantment": "minecraft:looting",
"function": "minecraft:enchanted_count_increase"
}
],
"name": "gcats:cloth"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"vehicle": {
"type": "minecraft:zombie_horse"
}
}
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"function": "minecraft:set_count"
},
{
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"enchantment": "minecraft:looting",
"function": "minecraft:enchanted_count_increase"
}
],
"name": "minecraft:red_mushroom"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:random_chance_with_enchanted_bonus",
"enchanted_chance": {
"type": "minecraft:linear",
"base": 0.035,
"per_level_above_first": 0.01
},
"enchantment": "minecraft:looting",
"unenchanted_chance": 0.025
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_ingot"
},
{
"type": "minecraft:item",
"name": "minecraft:carrot"
},
{
"type": "minecraft:item",
"functions": [
{
"conditions": [
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_on_fire": true
}
}
},
{
"condition": "minecraft:entity_properties",
"entity": "direct_attacker",
"predicate": {
"equipment": {
"mainhand": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "#minecraft:smelts_loot"
}
]
}
}
}
}
}
]
}
],
"function": "minecraft:furnace_smelt"
}
],
"name": "minecraft:potato"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_baby": true
},
"vehicle": {
"type": "minecraft:chicken"
}
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:music_disc_lava_chicken"
}
],
"rolls": 1.0
},
{ // moved from /temporary_pool by srl_dp/GCATs-datapack.zip
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 0.0
},
"function": "minecraft:set_count"
},
{
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"enchantment": "minecraft:looting",
"function": "minecraft:enchanted_count_increase"
}
],
"name": "gcats:cloth"
}
],
"rolls": 1.0
}
],
"random_sequence": "minecraft:entities/zombie"
}
I have the following patch, which is applied to all entity loot tables (via the pattern
"loot_table/entities/.*\\.json"):[ { "op": "test", "path": "/type", "value": "minecraft:entity" }, { "op": "test", "path": "/pools/0/entries/0/name", "value": "minecraft:rotten_flesh" }, { "op": "copy", "from": "/pools/0", "path": "/temporary_pool" }, { "op": "add", "path": "/temporary_pool/entries/0/name", "value": "gcats:cloth" }, { "op": "move", "from": "/temporary_pool", "path": "/pools/-" } ]I expected it to add a new pool that's the same as the first pool but with
minecraft:rotten_fleshreplaced withgcats:cloth, leaving the first pool unaffected. However, it replacesnamein the first pool as well. Here is the output of/patched dump file minecraft:loot_table/entities/zombie.json:{ "type": "minecraft:entity", "pools": [ { "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", "functions": [ { "add": false, "count": { "type": "minecraft:uniform", "max": 2.0, "min": 0.0 }, "function": "minecraft:set_count" }, { "count": { "type": "minecraft:uniform", "max": 1.0, "min": 0.0 }, "enchantment": "minecraft:looting", "function": "minecraft:enchanted_count_increase" } ], "name": "gcats:cloth" } ], "rolls": 1.0 }, { "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", "conditions": [ { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "vehicle": { "type": "minecraft:zombie_horse" } } } ], "functions": [ { "add": false, "count": { "type": "minecraft:uniform", "max": 1.0, "min": 0.0 }, "function": "minecraft:set_count" }, { "count": { "type": "minecraft:uniform", "max": 1.0, "min": 0.0 }, "enchantment": "minecraft:looting", "function": "minecraft:enchanted_count_increase" } ], "name": "minecraft:red_mushroom" } ], "rolls": 1.0 }, { "bonus_rolls": 0.0, "conditions": [ { "condition": "minecraft:killed_by_player" }, { "condition": "minecraft:random_chance_with_enchanted_bonus", "enchanted_chance": { "type": "minecraft:linear", "base": 0.035, "per_level_above_first": 0.01 }, "enchantment": "minecraft:looting", "unenchanted_chance": 0.025 } ], "entries": [ { "type": "minecraft:item", "name": "minecraft:iron_ingot" }, { "type": "minecraft:item", "name": "minecraft:carrot" }, { "type": "minecraft:item", "functions": [ { "conditions": [ { "condition": "minecraft:any_of", "terms": [ { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "flags": { "is_on_fire": true } } }, { "condition": "minecraft:entity_properties", "entity": "direct_attacker", "predicate": { "equipment": { "mainhand": { "predicates": { "minecraft:enchantments": [ { "enchantments": "#minecraft:smelts_loot" } ] } } } } } ] } ], "function": "minecraft:furnace_smelt" } ], "name": "minecraft:potato" } ], "rolls": 1.0 }, { "bonus_rolls": 0.0, "conditions": [ { "condition": "minecraft:killed_by_player" }, { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "flags": { "is_baby": true }, "vehicle": { "type": "minecraft:chicken" } } } ], "entries": [ { "type": "minecraft:item", "name": "minecraft:music_disc_lava_chicken" } ], "rolls": 1.0 }, { // moved from /temporary_pool by srl_dp/GCATs-datapack.zip "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", "functions": [ { "add": false, "count": { "type": "minecraft:uniform", "max": 2.0, "min": 0.0 }, "function": "minecraft:set_count" }, { "count": { "type": "minecraft:uniform", "max": 1.0, "min": 0.0 }, "enchantment": "minecraft:looting", "function": "minecraft:enchanted_count_increase" } ], "name": "gcats:cloth" } ], "rolls": 1.0 } ], "random_sequence": "minecraft:entities/zombie" }