I was on my friend's server, which he wanted me to make a custom potion for him that doesn't give him the effects, which also has the color of the harming potion. So I did the following command:
/give @p minecraft:splash_potion 1 0 {CustomPotionEffects:[{Id:7,Amplifier:0,Duration:0}]}
which gives you a splash harming potion. So when I tested it out, for some reason, I still received the harming potion effect. Same thing happens with splash potion of healing.
Video link: https://youtu.be/TiY_0HK1I7Y
Code analysis by @unknown in this comment
Comments 5
Confirmed for
16w04a
This report seems valid because the according normal potion does not apply the effect
/give @p potion 1 0 {CustomPotionEffects:[{Id:7b,Duration:0,Amplifier:0b,ShowParticles:0b}]}
And incorrect duplicate link. To duplicate MC-89312 the command would need to contain the Potion
tag for the NBT data of the potion.
Please link to this comment in the description
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 because the net.minecraft.entity.projectile.EntityPotion.onImpact(RayTraceResult)
method (thrown potion) calls the net.minecraft.potion.Potion.affectEntity(Entity, Entity, EntityLivingBase, int, double)
method for instant potion effects which does not test if the duration is higher than 0 whereas the net.minecraft.item.ItemPotion.onItemUseFinish(ItemStack, World, EntityLivingBase)
method (normal potion) only adds all effects using the net.minecraft.entity.EntityLivingBase.addPotionEffect(PotionEffect)
method.
is a potion of instant harming, tier I.
Why shouldn't it do any effect ?