mojira.dev
MC-122840

"/data remove" cannot delete beam_target tag in End Crystals

Attempting to remove the beam_target tag from an End Crystal returns "Modified entity data of End Crystal" but does not in fact remove the tag. (prior to 24w06a, removing BeamTarget instead reset its X, Y, and Z values to 0, but likewise did not remove the data).

Steps to reproduce:

  1. /summon end_crystal ~ ~ ~

  2. /data merge entity @e[type=end_crystal,limit=1,sort=nearest] {beam_target:[I; 100, 100, 100]}

  3. /data remove entity @e[type=end_crystal,limit=1,sort=nearest] beam_target

  4. /data get entity @e[type=end_crystal,limit=1,sort=nearest]

Notice the beam still exists, and the NBT still shows the beam_target unchanged, despite the command returning successful. Other methods to remove the data, such as /data merge, likewise have no effect.

The only way currently to "remove" the beam_target tag is to delete the entity altogether and re-summon an identical one in its place, sans target data, which is not ideal as this causes a noticeable jump in animation when the entity is replaced.

Related issues

Comments

[Mod] Neko

Removing the tag won't stop the game from rewriting it again.

migrated

That's true but why would the game rewrite it rather than remove the beam animation? Seems unintuitive.

Skylinerw

/data remove does actually remove the tag. The primary issue comes from the fact that the crystal does not wipe out its current in-memory beam target before setting it via NBT. However, any issues arising from editing an entity during its lifetime are closed as invalid. But to explain this particular issue further:

For the first one: the compound is indeed removed entirely. However, since the crystal does not wipe out its in-memory beam target first when merging NBT data, it will remain. It will only manipulate its beam target from NBT if the BeamTarget compound is specified, which won't be the case with /data remove. /data get is writing the entity anew to NBT, so its original beam target is included since it wasn't removed.

For the second one: removing a specific child does work, but the game is getting a very specific collection of positional data for BeamTarget, where any missing keys will default to 0.


As far as removing the beam target, you can try this work-around:

/data merge entity @e[type=minecraft:ender_crystal,limit=1] {BeamTarget:{X:2147483647}}

The X value is set to max int. This doesn't stop the beam from trying to render, but it should hopefully be too large of an offset to see it. You may experience anomalies (such as lines appearing on the screen depending on camera angle), though with that value I personally did not.

NeunEinser

Reopened for Mojang to decide.
Other things similar to this have been fixed or triaged already.

Avoma

Can confirm in 20w48a.

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

ampolive

Can confirm in 1.17.1.

migrated

Confirmed for 1.17.1

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.18.2.

KirbAvion

Can confirm in 22w15a.

KirbAvion

In 1.19 Pre-release 2

Avoma

Can confirm in 1.19.

KirbAvion

In 23w33a.

KirbAvion

As of 24w11a, possibly earlier (given the tag changes were made in 24w06a), /data remove no longer "zeroes" beam_target, but it still doesn't remove it either. So I would say that this does affect 24w11a, but that some of the details may need to be updated.

[Mod] turbo

@unknown: I made you the reporter because the current reporter was last active in 2017. You can make any necessary changes to the summary and description, and keep the report up to date.

migrated

when i made this report in 2017, i didn't expect people to maintain it for 7 years

i could've blocked the emails, but i didnt because i was kindof curious how long it would go on

thank you all for putting more work into this than i could've imagined 

KirbAvion

gegy

Confirmed

Commands

/data, command, end_crystal, nbt

Minecraft 17w48a, 20w10a, 20w11a, 20w12a, 20w13a, ..., 1.21.3, 24w46a, 1.21.4 Pre-Release 1, 1.21.4, 25w05a

25w07a

Retrieved