Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7608

Exception throws when getting list of PersistentDataContainer from empty NBT list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • 4066-Spigot-e9ec548-45d6a60 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
    • Yes

      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

            Unassigned Unassigned
            nahkd123 Tran Huu An
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: