Mojira Archive
MCPE-170184

Trade Tables no longer support custom entity Spawn Eggs

In 1.19.80, spawn egg syntax was changed so that you reference the entity instead of using "set_actor_id" in loot tables and commands. However this change doesn't seem to have considered trade tables or the language files.

For my mini-blocks addon, I've updated the pack to provide the player with the correct mini-block spawn egg from the entity when it's picked up via loot tables which works fine. (Loot table).

However, to get the mini-blocks in survival, you buy them from the wandering trader.
The problem is, using "minecraft:spawn_egg" with "set_actor_id" in the wandering trader trade table gives a default spawn egg instead of the mini-block, but changing it to match the loot table's updated system just breaks the trade table.

e.g.
Pre 1.19.80 this worked:

{
    "max_uses": 3,
    "wants": [{
            "item": "minecraft:emerald"
        }, {
            "item": "wool:9"
        }
    ],
    "gives": [{
            "item": "minecraft:spawn_egg",
            "functions": [{
                    "function": "set_actor_id",
                    "id": "fmb:cyan_wool"
                }
            ],
            "quantity": 8
        }
    ]
}

But in 1.19.80/81 it just gives a default spawn egg.

Using the updated syntax:

{
    "max_uses": 3,
    "wants": [{
            "item": "minecraft:emerald"
        }, {
            "item": "wool:9"
        }
    ],
    "gives": [{
            "item": "fmb:cyan_wool_spawn_egg",
            "quantity": 8
        }
    ]
}

causes the error:

[Json][error]-In trade file: trading/economy_trades/wandering_trader_trades.json | "item" not found

[Entity][error]-In trade file: trading/economy_trades/wandering_trader_trades.json | Trade [
   {
      "choice" : null,
      "functions" : null,
      "item" : "fmb:cyan_wool_spawn_egg",
      "quantity" : 8
   }
]
 doesn't have any recieves, at least one is required

[Json][error]-In trade file: trading/economy_trades/wandering_trader_trades.json | num_to_select[1] must not be greater than the number of trades[0]

As for the language files. They still reference "minecraft:spawn_egg:id" which works fine, but I assume this should also be changed to "namespace:actor_spawn_egg" to match the change.
Here are the packs to check.

7.3.0 uses the pre-1.19.80 wandering trader system and gives blank spawn eggs
7.3.1 has the updated syntax and throws errors

To replicate in version 7.3.0 (1.19.80+):
1. Spawn a wandering trader (or find one in survival)
2. Open their trades by interacting with them
3. See blank spawn eggs instead of mini-blocks

Expected results:
Wandering trader has mini-blocks for sale
Actual Results:
Wandering trader sells blank spawn eggs

To replicate in version 7.3.1 (1.19.80+):
1. Spawn a wandering trader (or find one in survival)
2. Open their trades by interacting with them
3. See no trades at all

Expected results:
Wandering trader has mini-blocks for sale
Actual Results:
Wandering trader has no trades

Fixed

Foxy No-Tail

2023-05-01, 10:42 AM

2024-02-06, 08:22 PM

2024-02-06, 08:22 PM

36

12

Confirmed

1025568

1.19.80, 1.19.81 Hotfix

1.20.0.24 Preview, 1.20.60.21 Preview, 1.20.60