[SPIGOT-7520] Attribute LootTableSeed missing for generated containers with attached LootTable Created: 14/Nov/23  Updated: 25/Dec/24  Resolved: 15/Nov/23

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Simon Stroh Assignee: Marvin Rieple
Resolution: Fixed Votes: 0
Labels: None
Environment:

Any


Attachments: PNG File Screenshot 2023-11-14 170806.png     PNG File ancient_city.png    
Version: This server is running CraftBukkit version 3937-Bukkit-864f616 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

I recently noticed that containers with attached LootTables in structures no longer store the LootTableSeed attribute, which results in non deterministic container content(when recreating a world with the same seed and reopening the same chest its contents will be different, which isn't vanilla behaviour).

I first noticed the bug in 1.20.2 builds for paper but the current spigot and craftbukkit builds show the same behaviour, while the vanilla client/server still stores the LootTableSeed. So i would assume the bug was introduced by bukkit/craftbukkit.

Steps to reproduce:

  • generate a new world using the newest craftbukkit or spigot 1.20.2 jar
  • find a structure with containers
  • pick one container(without opening it)
  • save the world
  • open the corresponding region file and search for the container
  • the container has the LootTable attribute attached, but is missing the LootTableSeed attribute

Alternatively:

  • generate a new world using the newest craftbukkit or spigot 1.20.2 jar
  • find a structure with containers
  • pick one container
  • open the container, write down its contents
  • stop the server
  • delete the corresponding region folder/file
  • restart the server
  • reopen the container, write down its contents
  • compare the container content from both samples

When recreating these steps on a vanilla 1.20.2 server the LootTableSeed attribute is present.

For some additional context:
The bug was introduced to paper in https://github.com/PaperMC/paper/commit/4cdbb0c86c40f5ff93a9a7cdca3102636b35b6d4(1.20 build #204 still works, while 1.20 build #205 doesn't), so one of the merged changes will be its cause. I don't seem to be able to find old craftbukkit or spigot builds, so i'm unable to pin it down any further.



 Comments   
Comment by Simon Stroh [ 14/Nov/23 ]

I'm unable to see the PR or the branch it was made from.

But the patch seems to work. All chests i checked had the LootTableSeed attribute.

Comment by Marvin Rieple [ 14/Nov/23 ]

Made a PR for this: craftbukkit#1300

You can test it with BuildTools: 

java -jar BuildTools.jar --rev 3939 --compile SPIGOT --pr craftbukkit:1300 
Comment by Simon Stroh [ 14/Nov/23 ]

Affected LootTables are:

Overworld:
minecraft:chests/village/village_armorer
minecraft:chests/village/village_snowy_house
minecraft:chests/village/village_weaponsmith
minecraft:chests/village/village_tannery
minecraft:chests/village/village_plains_house
minecraft:chests/village/village_fisher
minecraft:chests/ancient_city
minecraft:chests/ancient_city_ice_box
minecraft:chests/village/village_taiga_house
minecraft:chests/village/village_cartographer
minecraft:chests/pillager_outpost
minecraft:chests/village/village_fletcher

 

Nether:

minecraft:chests/bastion_other
minecraft:chests/ruined_portal
minecraft:chests/bastion_hoglin_stable
minecraft:chests/bastion_bridge
minecraft:chests/bastion_treasure

 

End:
None

Comment by Simon Stroh [ 14/Nov/23 ]

It definitely affects ancient_city chests. I will test it for other structures later.

Comment by Black Hole [ 14/Nov/23 ]

Using "/data get block ~ ~ ~" while standing on a chest is much easier.
I did a quick test with stronghold chests and it displays the LootTableSeed.

Comment by Marvin Rieple [ 14/Nov/23 ]

Does it affect every structure, which structures did you test specifically?

Generated at Sat Dec 13 20:46:46 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.