#(some_arthena) Redundant NBT data added upon retrieval

52 messages · Page 1 of 1 (latest)

fickle crest
#

Wow, second post today, I am sorry for spamming here so much.

Anyway, following issue:
I am working with item displays, and when I put an item in one and request a retrieval of said item (so basically, with the Denizen give command), it will have different NBT data from the item I put in it.
This, of course, concerns items that do have NBT data like armor stands and so on.
That is to say, the data seems to just be the standard data the item has, but it is now explicity appended to the item, which, sadly, results in the item being non-stackable with fresh items of the same kind.

Using the armor stand as example, following scenarios open up:
Item from creative inventory:
Using: "/data get entity @s SelectedItem":

{
    id: "minecraft:armor_stand",
    Count: 1b
}

Using: "/ex narrate <player.item_in_hand>":

i@armor_stand[armor_stand_data=map@[base_plate=true;visible=true;marker=false;is_small=false;arms=false]]

Item back from display:
Using: "/data get entity @s SelectedItem":

{
    id: "minecraft:armor_stand",
    tag: {
        EntityTags: {
            ShowArms: 0b,
            Marker: 0b,
            Small: 0b,
            NoBasePlate: 0b,
            Invisible: 0b
        }
    },
    Count: 1b
}

Using: "/ex narrate <player.item_in_hand>":

i@armor_stand[armor_stand_data=map@[base_plate=true;visible=true;marker=false;is_small=false;arms=false]]

Now it gets vexing, as you can see the NBT is the same for the narrate command but for the data command it is not.
This tells me that something either in Denizen or Spigot (I really hope it is Denizen, as otherwise I just wasted a slot for another person seeking help :D)
adds the default data to the item.

Now I wonder, can I somehow remove this data from the itemstack, and if so, how can I avoid removing purposefully added NBT data?
May it even be a bug that needs fixing, but I am just an underling to the Denizen royalty, so thee may pardon mine own audacity. 🙇‍♀️

If any more data on this issue is needed, please tell me what it is and I will debug this baby for you!
Have fun everyone!

valid falconBOT
#

(some_arthena) Redundant NBT data added upon retrieval

valid falconBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

smoky shuttle
#

I'm not sure what you're after

#

If you want to retrieve the item used in an item display use

fickle crest
#

That is to say, the data seems to just be the standard data the item has, but it is now explicity appended to the item, which, sadly, results in the item being non-stackable with fresh items of the same kind.

smoky shuttle
#

!t entity.item

jaunty turretBOT
# smoky shuttle !t entity.item

If the entity is a dropped item, returns the item represented by the entity.
If the entity is a trident, returns the trident item represented by the entity.
If the entity is a throwable projectile, returns the display item for that projectile.
If the entity is an eye-of-ender, returns the item to be displayed and dropped by it.
If the entity is a fireball, returns the fireball's display item.
If the entity is an Item Display, returns the entity's display item.

Group

properties

Returns

ItemTag

Mechanism

EntityTag.item

smoky shuttle
#

to get exact item

#

Do you have a script or something?

mint valley
#

When an armor stand is 'stored' in an item display, it gains additional data that renders it unstackable

#

that's the crux of this

mint valley
fickle crest
#

Ah that was not clear!
I am sorry for my incompetence, yes that is exactly the issue. 🙂

mint valley
#

lol you're perfectly fine, no need for that

#

i was just clarifying for ice, giving additional information is always better

fickle crest
smoky shuttle
#

Oh so an armor stand specific thing

fickle crest
#

Be right back with the results!

mint valley
#

presumebly anything with inherent hidden data? Something like a light block would have this issue too, i imagine

smoky shuttle
#

oh ye I get it now

fickle crest
# smoky shuttle Oh so an armor stand specific thing

Well, anything that has nbt data
If I put a stone item in, I get it back unscathed
However, items like armor stands, chests, shulker boxes (which I tested now) and probably many more will be polluted by this

smoky shuttle
#

Yeah so

#

it only applies the nbt when using an item from your inventory

#

ie: /ex spawn item_display[item=<player.item_in_hand>]

#

when using /ex spawn item_display[item=chest] this wont happen

#

that's probably due denizen showing data that isn't there

#

and then it gets applied from the item objects data

humble quiverBOT
#
Changed to Bug

Thread is now a Bug thread. This indicates a core code bug that a developer must resolved, not an error message or other support topic. Please do not misuse the Bug label. Use </helpthread:1028674284870180883> to switch the thread back to a normal help thread if you are not 100% confident it is a code bug.

fickle crest
smoky shuttle
#

not yet SCgrin

#

I mean I could ask you why you're using these items for item displays

#

and maybe give you another idea

fickle crest
#

it's a pseudo-block anyone can put anything in

smoky shuttle
#

but no different way yet

fickle crest
#

thanks, then I will resolve this I guess?

#

or not until the bug is fixed?
I am still new here, sorry

smoky shuttle
#

you can leave the thread open

#

it's marked as bug, so devs can search for it and find it to fix it

fickle crest
#

Alright alright alright!
Thank you so far, have a nice day

smoky shuttle
#

You too :)

split wadi
#

From some testing, this isn't a Denizen issue - testing with similar Java code

ItemStack chest = new ItemStack(Material.CHEST);
sender.sendPlainMessage(chest.getItemMeta().getAsString());
chest.editMeta(BlockStateMeta.class, blockStateMeta -> {
    blockStateMeta.setBlockState(blockStateMeta.getBlockState());
});
sender.sendPlainMessage(chest.getItemMeta().getAsString());

Produces the same result

[14:04:43 INFO]: {}
[14:04:43 INFO]: {BlockEntityTag:{Items:[],id:"minecraft:chest",x:0,y:0,z:0}}
#

Will try reporting this to Paper and see what they say

split wadi
#

Should still keep this thread open though, it might end up just being worked around in Denizen

fickle crest
#

Any resolution?

split wadi
fickle crest
#

The history of that bug report is very discouraging
I hope Denizen finds a workaround 😅

split wadi
#

Fixed for chests ref #commit-log message

#

There's still some more work to be done to fix this for armor stands, so can probably keep the post open for now

tepid river
#

@split wadi were armor stands fixed, or is this still an existing bug?

tepid river
#

going to close this for now. if you're reading this and encounter the same issue, please make a new thread and reference this one