[SPIGOT-7608] Exception throws when getting list of PersistentDataContainer from empty NBT list Created: 29/Mar/24  Updated: 25/Dec/24  Resolved: 29/Mar/24

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

Type: Bug Priority: Minor
Reporter: Tran Huu An Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Craftbukkit

Attachments: Text File log-trimmed.txt    
Version: 4066-Spigot-e9ec548-45d6a60 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

An exception java.lang.IllegalArgumentException: The found tag instance (NBTTagList) cannot store List throws when trying to get List<PersistentDataContainer> from PersistentDataContainer if the underlying data is an empty NBT list, using PersistentDataContainer#get() with PersistentDataType.LIST.dataContainers() as type.

This occurs after restarting the server, or modifying the item's NBT with /minecraft:data modify command: /data modify entity @s[type=item,limit=1] Item.tag.PublicBukkitValues.namespace:id set value [].

Steps to reproduce:

  1. Clone this repository: https://github.com/nahkd123/spigot-persistent-container-bug
  2. Build the test plugin, then start the server with the plugin
  3. Run the command /demo give as a player
  4. Restart the server
  5. Run the command /demo check as a player while holding the item that was previously obtained from step 3
  6. An exception will be thrown


 Comments   
Comment by Tran Huu An [ 29/Mar/24 ]

md_5 told me to tag LynxPlay from #help-development Discord channel

Generated at Fri Apr 11 15:30:23 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.