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 @unknown 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);
...
Linked issues
is duplicated by 3
relates to 2
Attachments
Comments 22
As highlighted in MC-269327, this also impacts pufferfish. This problem did not exist before version 1.14. In versions prior to 1.14, ocelots could be fed both pufferfish and tropical fish. However, version 1.13.2 is inaccurately listed as affected in this bug report, despite the issue not occurring in that version.
Pufferfish are toxic to ingest, so cats should not eat them, the tropical fish sprite also has a clown fish for the icon, and clownfish get toxic components from anemone, so they too should not be feed to cats. I do not think tropical fish should be allowed to be fed to fish since there is a large variety of colors that could mirror many poisonous fish, The player also cannot cook tropical fish, but they can eat them which is did cause confusion for this being seen as a bug.
Solution: make tropical fish toxic to the player.
Can confirm for 20w11a, I distinctly remember them being able to eat them back when they were just clown fish.