Mojira Archive
MC-269964

Ominous item spawners are missing an NBT load for spawn_item_after_ticks

The minecraft:ominous_item_spawner entity introduced in 24w13a doesn't load the spawn_item_after_ticks field when being read from NBT. This means that they instantly drop their contents when reloaded, and they cannot be summoned.

The code in OminousItemSpawner#readAdditionalSaveData appears to have a typo when reading the field (it calls the method, but does not store it back into the field on the entity):

protected void readAdditionalSaveData(CompoundTag lvt1) {
        ItemStack lvt2 = lvt1.contains("item", 10) ? ItemStack.parse(this.registryAccess(), lvt1.getCompound("item")).orElse(ItemStack.EMPTY) : ItemStack.EMPTY;
        this.setItem(lvt2);
        lvt1.getLong("spawn_item_after_ticks");
}

Fixed

katietheqt

2024-03-27, 07:04 PM

2024-05-20, 12:56 PM

2024-05-20, 12:56 PM

11

6

Confirmed

Important

1215343

Expansion B

Entities, Save Data

24w13a, 24w14a, 1.20.5 Release Candidate 2

24w21a