Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269964

Ominous item spawners are missing an NBT load for spawn_item_after_ticks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w21a
    • 24w13a, 24w14a, 1.20.5 Release Candidate 2
    • None
    • Confirmed
    • Entities, Save Data
    • Important
    • 1215343
    • Expansion B

      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");
      }
      

            Unassigned Unassigned
            katietheqt katietheqt
            Votes:
            11 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: