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

You cannot tempt or tame cats or ocelots using cooked cod or salmon

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17 Release Candidate 2, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, 1.17.1, 21w37a, 21w38a, 21w39a, 21w41a, 21w43a, 1.18, 1.18.1, 22w03a, 22w05a, 22w06a, 1.18.2, 22w17a, 22w19a, 1.19
    • None
    • None
    • Community Consensus
    • (Unassigned)

    Description

      The Bug:

      You cannot tempt or tame cats or ocelots using cooked cod or salmon.

      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 the cooked variants of these items.

      Steps to Reproduce:

      • Summon a cat or ocelot and obtain some cooked cod or salmon.
      • Attempt to tame the cat or ocelot using the cooked item.
      • Take note as to whether or not you can tempt or tame cats or ocelots using cooked cod or salmon.

      Observed Behavior:

      You cannot tempt or tame cats or ocelots using cooked cod or salmon.

      Expected Behavior:

      You would be able to tempt and tame cats and ocelots using cooked cod and salmon.

      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.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, both cooked cod and cooked salmon cannot be used to tempt/tame cats and ocelots, which seems quite illogical.

      Potential Fix:

      Simply adding both cooked cod and cooked salmon to the list of items that cats and ocelots are tempted by, should resolve this problem. The correct line of codes within their classes should look something like the following:

      net.minecraft.world.entity.animal.Cat.java
      public class Cat extends TamableAnimal {
         ...
         private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON, Items.COOKED_COD, Items.COOKED_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, Items.COOKED_COD, Items.COOKED_SALMON);
         ...

      Attachments

        1. MC-204760.mp4
          5.71 MB
        2. MC-204760.png
          MC-204760.png
          719 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                CHK: