Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_pinv(pinv()) clears EntityTag values #1349

Open
Nilleke opened this issue Jan 26, 2023 · 3 comments
Open

set_pinv(pinv()) clears EntityTag values #1349

Nilleke opened this issue Jan 26, 2023 · 3 comments
Labels
bug Things that don't work as designed

Comments

@Nilleke
Copy link
Contributor

Nilleke commented Jan 26, 2023

CommandHelper seems to not support EntityTag for ItemStacks, resulting in that information being lost when updating the inventory using:

set_pinv(pinv())

I guess this is similar to #1343 (BlockStateTag)

Tested on:

CommandHelper-3.3.5-b309
Purpur-1.19.3-b1895


Test item 1:

/give @s minecraft:item_frame{EntityTag:{Invisible:1b}}

Places an invisible item frame.
After set_pinv(pinv()) it will remove the invisible tag and place a normal item frame. Also applies to glow_item_frame.

Test item 2:

/give @s minecraft:polar_bear_spawn_egg{EntityTag:{id:"minecraft:iron_golem", CustomName:'{"text":"Jerry"}', CustomNameVisible:1b}}

Looks like a polar bear spawn egg but spawn an iron golem named Jerry. right-clicking a spawner makes it an iron golem spawner.
After set_pinv(pinv()) it turns into a normal polar bear spawn egg.

With 1.20 experimental features we now have a vanilla iron_golem_spawn_egg item (and other previously unobtainable eggs), which don't use EntityTag. But this tag can still be used to make the spawned mob have specific traits.

Test item 3:

/give @s bee_nest{BlockEntityTag:{Bees:[{EntityData:{id:"minecraft:bee"}},{EntityData:{id:"minecraft:bee"}},{EntityData:{id:"minecraft:bee"}}]}}

When placed during the day, 3 bees come out of the hive.
After set_pinv(pinv()) it will remove all the bee information, creating an empty hive. When placed during the day no bees come out.

This item can be obtained in vanilla survival using a silktouch enchanted tool.
Having access to this tag could allow us to check how many bees are in the beenest/hive item.

@PseudoKnight
Copy link
Contributor

PseudoKnight commented Jan 27, 2023

This is not currently supported by Bukkit, which is not surprising. (though Paper has limited support for ArmorStandMeta) We'd have to bypass the API to get into the nbt. Could optionally support armor stands when on Paper.

@malonnnn
Copy link

malonnnn commented Sep 14, 2023

I was about to make a new issue regarding a similar problem I am having, but I think it would be virtually a duplicate of this, so I'm simply bumping this one and adding my issue info here

https://discord.com/channels/446057847428481044/623194282727178260/1151596460773744680

@PseudoKnight
Copy link
Contributor

PseudoKnight commented Sep 15, 2023

This is a separate issue. Entity tags are when entire entity data is stored directly in an item.

Currently entity tags affect the following survival item meta:

  • Bee Hive (none is supported, so this is the most critical)
  • Axolotl Bucket (only custom name and axolotl type are supported)
  • Tropical Fish Bucket (only custom name, fish color, pattern and patterncolor are supported)

Less critically, this also affects these custom spawned or creatively copied items:

  • Spawn Egg
  • Item Frame
  • Armor Stand

Current thought is to encode the internal entity tag compound. This would require using internal Minecraft methods, though. It'd be similar to what Bukkit does with their serialize() method.

@PseudoKnight PseudoKnight added the bug Things that don't work as designed label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that don't work as designed
Projects
None yet
Development

No branches or pull requests

3 participants