The bug
A potion with a potion effect that has ShowParticles
set to 0b
uses always the same color no matter what potion effect is used.
How to reproduce
Use the following command to give yourself a potion with
ShowParticles:1b
/give @p potion{CustomPotionEffects:[{Id:1b,ShowParticles:1b}],Potion:"minecraft:water"}
Use the following command to give yourself a potion with
ShowParticles:0b
/give @p potion{CustomPotionEffects:[{Id:1b,ShowParticles:0b}],Potion:"minecraft:water"}
The reason
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is that the method net.minecraft.potion.PotionUtils.func_185181_a(Collection<PotionEffect>)
only calculates the color if the effect shows particles. This is done that way because the value 0 is used to indicate that no particles should be created. A third value should probably be added to indicate whether particle effects should be displayed or not. Another way to solve this could be to have one byte value instead of a boolean for whether or not the particles are ambient which stores a value representing the state, for example:
Value | State |
---|---|
0 | No particles |
1 | Particles |
2 | Ambient particles |
Affected methods
net.minecraft.entity.EntityLivingBase.updatePotionEffects()
net.minecraft.client.renderer.entity.RenderTippedArrow.getEntityTexture(EntityTippedArrow)
Linked issues
is duplicated by 5
relates to 1
Attachments
Comments 5
Invalid: all potions/arrows without "potion" tag are now purple (MC-107192)
With multiple custom effects, this bugs occured when all effect have showparticles set to "0b".
If some effect have showparticles to 1b and others to 0b, the color mixer will ignore the color from the effect with showparticles to 0b (I don't know if it's intented or no).
Example:
/give @p minecraft:potion 1 0 {Potion:"minecraft:water",CustomPotionEffects:[{Id:6,ShowParticles:1b},{Id:8,ShowParticles:0b}]}
EffectID 6: Red
EffectID 8: Green
The result will be a Red potion, not yellow because Id 8 (green) is ignored
Can confirm.