-
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, 1.21, 1.21.3
-
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:
- Summon a cat or ocelot and obtain some tropical fish.
- Attempt to tame the cat or ocelot using the tropical fish.
- 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.
public class Cat extends TamableAnimal { ... private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON); ...
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.
... private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH); ...
... private static final Ingredient TEMPT_INGREDIENT = Ingredient.of(Items.COD, Items.SALMON, Items.TROPICAL_FISH); ...