-
Bug
-
Resolution: Unresolved
-
None
-
24w12a
-
None
-
Plausible
-
Data Packs, Loot tables
-
Normal
-
Platform
The Bug
When changing a loot table to use a set_count function where the count value is based on storage, you will get the same loot result as before changing the loot table until restarting the game.
Steps to reproduce
- Copy the vanilla data/minecraft/loot_tables/blocks/diamond_ore.json
- Add a set count function like this
{ "function": "set_count", "add": false, "count": 2 }
- Do a /reload
You will get 2 diamonds when mining the diamond ore - Change the function to something like this
{ "function": "set_count", "add": false, "count": { "type": "minecraft:storage", "storage": "neun:ore_counts", "path": "diamonds" } }
- Do /data modify storage neun:ore_counts diamonds set value 3
- Do /reload
You will still get 2 diamonds when mining the diamond ore - Change count to hardcoded 5 and /reload
You will get 5 diamonds when mining the diamond ore - Change count back to storage based and /reload
You will still get 5 diamonds when mining the diamond ore - Close and reopen the world
You will still get 5 diamonds when mining the diamond ore - Close and reopen the game
You will now get 3 diamonds when mining the diamond ore - Do /data modify storage neun:ore_counts diamonds set value 20
You will now get 20 diamonds when mining the diamond ore
Expected Behavior
The loot table should base its diamond count on the storage after /reload
Observed Behavior
You need to close and reopen the game to get the desired behavior.
Attachment
I attached the datapack I used for testing. Since you need to update it to reproduce, I still recommend you create your own, but you can use it as a basis.