-
Bug
-
Resolution: Invalid
-
None
-
1.20.5, 1.20.6 Release Candidate 1, 1.21
-
Windows 10, JRE 21
-
Confirmed
-
Data Packs, Loot tables
Previous to 1.20.5, you could copy nbt from the mined block to the dropped block, so I could for instance, make a monster spawner drop a mosnter spawner item with the nbt that specified the mobs inside the spawner, so when you placed it in creative mode, it would still have those mobs inside. The loot table would look like this:
{ "pools": [ { "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:spawner", "functions": [ { "function": "minecraft:copy_nbt", "source": "block_entity", "ops": [ { "source": "{}", "target": "BlockEntityTag", "op": "merge" } ] } ] } ] } ] }
In 1.20.5, the nbt needs to be copied to the Item.components path for the spawner item to work as intended in my example. The new item modifier that replaced "minecraft:copy_nbt" is "minecraft:copy_custom_data", but this item modifier copies the provided nbt to the item in the following path: Item.components."minecraft:custom_data". So now it is not possible to do what I previously described with this item modifier.
The new "minecraft:copy_component" item modifier allows you to copy item components from the mined entity block to the Item.components path of the item, but that won't work either as entity blocks don't have item components, at least not the monster spawner entity block with an entity inside, as one can see by doing /data get block <coords of the spawner>, so there's nothing to include or to copy.
I have not found a way to do what I could prevously do.
I have attached 3 images of me mining a spawner in 1.20.4 with a datapack that contains the loot table I wrote at the start of this post. The datapack is also attached here. That dropped spawner item, when put in creative, it will still contain the mob inside (in this case, a zombie). The other 3 images are me mining a spawner in 1.20.5 with a datapack containing a loot table using item modifier "minecraft:copy_custom_data". The datapack is also attached. As you can see in the images, the nbt gets copied to Item.components."minecraft:custom_data", the tooltip doesn't say that it contains a zombie, and when put in creative mode, the spawner will be empty