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

The item count symbol within shulker box tooltips is untranslatable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.2 Pre-release 1
    • 1.18.1, 1.18.2 Release Candidate 1, 1.18.2, 1.19 Pre-release 1, 1.19, 1.19.1, 1.19.2, 22w43a, 22w45a, 1.19.3, 1.19.4, 1.20.1
    • Confirmed
    • Internationalisation
    • Normal
    • Platform

      The Bug:

      The "x" symbol that exists before the number of items in shulker box tooltips is untranslatable and is missing a translation key.

      Steps to Reproduce:

      1. Attempt to search for the existence of this string by using this search filter on the official Minecraft crowdin project.
      2. Take note as to whether or not the item count symbol within shulker box tooltips is untranslatable.

      Observed Behavior:

      The item count symbol within shulker box tooltips is untranslatable.

      Expected Behavior:

      The item count symbol within shulker box tooltips would be translatable.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

      net.minecraft.world.level.block.ShulkerBoxBlock.java
      public class ShulkerBoxBlock extends BaseEntityBlock {
         ...
         public void appendHoverText(ItemStack $is, @Nullable BlockGetter $bg, List<Component> $l, TooltipFlag $tf) {
            ...
            if (compoundtag != null) {
               ...
               if (compoundtag.contains("Items", 9)) {
                  NonNullList<ItemStack> nonnulllist = NonNullList.withSize(27, ItemStack.EMPTY);
                  ContainerHelper.loadAllItems(compoundtag, nonnulllist);
                  int i = 0;
                  int j = 0;
      
                  for(ItemStack itemstack : nonnulllist) {
                     if (!itemstack.isEmpty()) {
                        ++j;
                        if (i <= 4) {
                           ++i;
                           MutableComponent mutablecomponent = itemstack.getHoverName().copy();
                           mutablecomponent.append(" x").append(String.valueOf(itemstack.getCount()));
                           $l.add(mutablecomponent);
                        }
                     }
                  }
                  ...

      If we look at the above class, we can see that the item count symbol within shulker box tooltips is hardcoded, and as a result, is untranslatable. This is evident through the following line of code:

      mutablecomponent.append(" x").append(String.valueOf(itemstack.getCount()));

            slicedlime [Mojang] slicedlime
            Avoma [Mod] Avoma
            Votes:
            9 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: