mojira.dev
MC-172738

Eye of ender does not store data in NBT

The bug

Throws eye of ender entities do not store their data in NBT. This causes them to fly to (0,0,0) after reloading them and always breaking (never dropping an item).

Affected data

  • target position

  • life time

  • whether item should drop

  • item (note that this is read from NBT)

How to reproduce

  1. Create a world which has strongholds

  2. Move close to (0,0)

  3. Throw eye of enders

  4. While they are still flying reopen the world
    ❌ They are now flying to (0,0,0) and never drop an item

Linked issues

Attachments

Comments

Avoma

Can confirm in 20w51a.

ampolive

Can confirm in 1.17.1.

migrated

item (note that this is read from NBT)

This is not the case (anymore)

/give @s minecraft:ender_eye{CustomModelData:1}
/data get entity @e[type=eye_of_ender,limit=1] Item
ampolive

Can confirm in 21w44a.

muzikbike

Flying to the origin has been the case since at least 1.1.

I can confirm that spawn egg-summoned and spawner-summoned eyes of ender gravitate towards (0,0) in 1.18.2.

muzikbike

Relates to MC-81656 and MC-260236.

haykam

This issue still exists in Minecraft 1.21 pre-release 1.

Code analysis (Yarn mappings)

The EyeOfEnderEntity#targetX, EyeOfEnderEntity#targetY, EyeOfEnderEntity#targetZ, EyeOfEnderEntity#lifespan, and EyeOfEnderEntity#dropsItem fields are not managed by the EyeOfEnderEntity#readCustomDataFromNbt or EyeOfEnderEntity#writeCustomDataToNbt methods. On the other hand, the the value of the EyeOfEnderEntity#ITEM tracked data is. As a result, the former fields are not saved to or read from disk, causing their values to be the Java defaults when the entity is reconstructed.

marcono1234

(Unassigned)

1168637

Confirmed

Platform

Low

Entities

eye_of_ender

20w08a, 1.16.2, 1.16.3, 1.16.4, 20w46a, ..., 22w15a, 1.19.3, 23w05a, 1.21 Pre-Release 1, 1.21.4

Retrieved