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

You cannot tempt or tame cats or ocelots using tropical fish

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.13.2, Minecraft 19w03b, Minecraft 1.14, 1.15.2, 20w12a, 20w18a, 20w19a, 1.16 Pre-release 6, 1.16.4, 20w51a, 21w03a, 1.16.5, 21w06a, 21w10a, 1.17, 1.17.1, 1.18.1, 22w06a, 1.18.2, 22w13a, 22w18a, 1.19, 1.19.2, 1.19.3, 1.19.4, 23w12a, 1.20, 1.20.1, 1.20.4, 23w51b, 24w10a, 24w11a, 1.20.5, 1.20.6
    • Confirmed
    • Mob behaviour

      The Bug:

      You cannot tempt or tame cats or ocelots using tropical fish.

      Since you can tempt/tame cats and ocelots using raw cod and raw salmon, it seems quite illogical that this same concept cannot be seen with tropical fish.

      Steps to Reproduce:

      1. Summon a cat or ocelot and obtain some tropical fish.
      2. Attempt to tame the cat or ocelot using the tropical fish.
      3. Take note as to whether or not you can tempt or tame cats or ocelots using tropical fish.

      Observed Behavior:

      You cannot tempt or tame cats or ocelots using tropical fish.

      Expected Behavior:

      You would be able to tempt and tame cats and ocelots using tropical fish.

      Code Analysis:

      Code analysis by Avoma can be found below.

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

      net.minecraft.world.entity.animal.Cat.java
      public class Cat extends TamableAnimal {
         ...
         private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON);
         ...
      net.minecraft.world.entity.animal.Ocelot.java
      public class Ocelot extends Animal {
         ...
         private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON);
         ...

      If we look at the above classes, we can see that the only items that cats and ocelots are tempted by are cod and salmon. Because of this, tropical fish cannot be used to tempt/tame cats and ocelots, therefore resulting in this problem occurring.

      Fix:

      Simply adding tropical fish to the list of items that cats and ocelots are tempted by, will resolve this problem.

      net.minecraft.world.entity.animal.Cat.java
         ...
         private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH);
         ...
      net.minecraft.world.entity.animal.Ocelot.java
         ...
         private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH);
         ...

        1. MC-142555.mp4
          2.84 MB
        2. MC-142555 - Cat.png
          MC-142555 - Cat.png
          299 kB
        3. MC-142555 - Current Code.png
          MC-142555 - Current Code.png
          208 kB
        4. MC-142555 - Fixed Code.png
          MC-142555 - Fixed Code.png
          175 kB
        5. MC-142555 - Ocelot.png
          MC-142555 - Ocelot.png
          411 kB
        6. ocelot 1.13.2.mp4
          6.70 MB
        7. ocelot 24w10a.mp4
          6.90 MB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            21 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              CHK: