The bug
Normally, when getting an effect with a duration of or longer than 1639 seconds, '**:**' is displayed in the HUD. However, if the effect is applied while you already had it (but for a shorter duration), that doesn't happen instead a duration higher than 27 minutes is displayed.
Leaving and re-entering the world fixes it.
Expected behavior
'**:**' be displayed.
Actual behavior
'27:18' is displayed.
How to reproduce
Use the following command
/effect give @s minecraft:speed 10
While the effect is still active, use
/effect give @s minecraft:speed 1000000
Code analysis
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta, applies to 1.12.2 as well.
The reason why this happens is because the method net.minecraft.potion.PotionEffect.combine(PotionEffect)
(and others as well) are not using the value of the net.minecraft.potion.PotionEffect.isPotionDurationMax
field of the other potion.
public void combine(PotionEffect other)
{
if (this.field_188420_b != other.field_188420_b)
{
LOGGER.warn("This method should only be called for matching effects!");
}
if (other.amplifier > this.amplifier)
{
this.amplifier = other.amplifier;
this.duration = other.duration;
// Added this
this.isPotionDurationMax = other.isPotionDurationMax;
}
else if (other.amplifier == this.amplifier && this.duration < other.duration)
{
this.duration = other.duration;
// Added this
this.isPotionDurationMax = other.isPotionDurationMax;
}
else if (!other.isAmbient && this.isAmbient)
{
this.isAmbient = other.isAmbient;
}
this.field_188421_h = other.field_188421_h;
}
Linked issues
relates to
Comments


Confirmed for
14w30c
14w31a
Minecraft 1.8-pre 1

Confirmed for 1.8.

Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason why this happens is because the method net.minecraft.potion.PotionEffect.combine(PotionEffect)
(and others as well) are not using the value of the net.minecraft.potion.PotionEffect.isPotionDurationMax
field of the other potion.
public void combine(PotionEffect other)
{
if (this.field_188420_b != other.field_188420_b)
{
LOGGER.warn("This method should only be called for matching effects!");
}
if (other.amplifier > this.amplifier)
{
this.amplifier = other.amplifier;
this.duration = other.duration;
// Added this
this.isPotionDurationMax = other.isPotionDurationMax;
}
else if (other.amplifier == this.amplifier && this.duration < other.duration)
{
this.duration = other.duration;
// Added this
this.isPotionDurationMax = other.isPotionDurationMax;
}
else if (!other.isAmbient && this.isAmbient)
{
this.isAmbient = other.isAmbient;
}
this.field_188421_h = other.field_188421_h;
}

Confirmed for 1.13.1.

Confirmed in 1.15.2, but fixed in 20w20b or earlier.
Confirmed.