Splash Potion of Saturation has no effect
Splashing yourself with a potion that has Saturation edited onto it through the CustomPotionEffects list tag renders you with no Saturation effect.
You can use the following command to generate such a potion to test with:
/give @p minecraft:splash_potion 1 0 {CustomPotionEffects:[{Id:23,Amplifier:0,Duration:1}],Potion:"minecraft:empty"}
Linked Issues
is duplicated by1
relates to4
- Fixed
Jack Buckley
[Mojang] Jeb (Jens Bergensten)- 22
- 13
- Confirmed
- Survival
- saturation splash-potion
1.6.2 - 18w14b
1.6.2 1.8 1.8.1-pre3 15w44b 1.10.2 16w36a 16w39a 16w39b 16w39c 16w41a 16w42a 16w43a 16w44a 1.11-pre1 1.11 16w50a 1.11.1 1.11.2 17w13a 17w13b 17w14a 17w15a 17w16a 17w17b 17w18a 17w18b 1.12-pre1 1.12-pre2 1.12-pre3 1.12-pre5 1.12-pre6 1.12-pre7 1.12 17w31a 1.12.1-pre1 1.12.1 1.12.2-pre1 1.12.2-pre2 1.12.2 17w43a 17w43b 17w48a 17w50a 18w01a 18w03b 18w06a 18w09a 18w14b- 18w15a
Created Issue:
Splash Potion of Saturation has no effect
Splashing yourself with a potion that has Saturation edited onto it through the CustomPotionEffects list tag renders you with no Saturation effect.
A comment with security level 'global-moderators' was removed.
is duplicated by
Splashing yourself with a potion that has Saturation edited onto it through the CustomPotionEffects list tag renders you with no Saturation effect.
You can use the following command to generate such a potion to test with:
/give @p minecraft:splash_potion 1 0 {CustomPotionEffects:[{Id:23,Amplifier:0,Duration:1}],Potion:"minecraft:empty"}
Splashing yourself with a potion that has Saturation edited onto it through the CustomPotionEffects list tag renders you with no Saturation effect.
You can use the following command to generate such a potion to test with:
/give @p minecraft:splash_potion 1 0 {CustomPotionEffects:[{Id:23,Amplifier:0,Duration:1}],Potion:"minecraft:empty"}
relates to
relates to
is duplicated by
relates to
relates to
relates to
is duplicated by
Duplicate of MC-25866.
I looked at the relevant code for this.
First off, Saturation is an instant effect, which means that having it apply for 600 units (the game will say seconds, but it's actually ticks) may not be what you want - it's instant, permanent full hunger for 30 seconds effectively (you can see this with /effect @p minecraft:saturation 600 3). But still, the behavior with AreaEffectClouds is a bug.
AreaEffectClouds have some complex logic in their onUpdate to check for entities, render particles, and decrease sizes, but the main potion applying logic is simply this: (MCP names followed by 1.10.2 obfuscated names)
for (PotionEffect potioneffect : potions) { if (potioneffect.getPotion().isInstant()) { potioneffect.getPotion().affectEntity(this, this.getOwner(), entitylivingbase, potioneffect.getAmplifier(), 0.5D); } else { entitylivingbase.addPotionEffect(new PotionEffect(potioneffect)); } }
And if you look at Potion.affectEntity, it only is for handling healing of entities:
public void affectEntity(@Nullable Entity source, @Nullable Entity indirectSource, EntityLivingBase entityLivingBaseIn, int amplifier, double health) { if ((this != MobEffects.INSTANT_HEALTH || entityLivingBaseIn.isEntityUndead()) && (this != MobEffects.INSTANT_DAMAGE || !entityLivingBaseIn.isEntityUndead())) { if (this == MobEffects.INSTANT_DAMAGE && !entityLivingBaseIn.isEntityUndead() || this == MobEffects.INSTANT_HEALTH && entityLivingBaseIn.isEntityUndead()) { int j = (int)(health * (double)(6 << amplifier) + 0.5D); if (source == null) { entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)j); } else { entityLivingBaseIn.attackEntityFrom(DamageSource.causeIndirectMagicDamage(source, indirectSource), (float)j); } } } else { int i = (int)(health * (double)(4 << amplifier) + 0.5D); entityLivingBaseIn.heal((float)i); } }
Since the effect is neither instant health nor instant damage, the first if statement passes but the second one does not, meaning nothing happens. (Normally, the logic for saturation happens in Potion.performEffect(EntityLivingBase, int) (rp.a(sf, int), lines 76 - 100)).
The trivial fix is to manually handle saturation potions in affectEntity, maybe just by copying the logic from performEffect. Of course, if that is done one can't have a duration on saturation potions in area effect clouds (but the same behavior applies to instant health). It doesn't seem like the logic in AreaEffectCloud can be tweaked to always use addPotionEffect (though I'm not entirely sure why), though if it could that would make for cleaner logic. The ideal fix would probably require some larger refactoring of those two potion methods.
One final note - this issue is highly related to MC-25866 (though not a duplicate per se).
Method and class names based on 1.11 decompiled using MCP 9.35 rc1
The bug
When a mob is shot with a tipped arrow all effects are applied as if they were no instant effects. This causes instant effects with the Amplifier 0 to not be applied because the method net.minecraft.potion.Potion.performEffect(EntityLivingBase, int) can be considered broken for instant effects because it only shifts with the amplifier but does not add 0.5 at the end.
This can be fixed by having the method net.minecraft.entity.projectile.EntityTippedArrow.arrowHit(EntityLivingBase) test if the effect is instant and in that case call the method net.minecraft.potion.Potion.affectEntity(Entity, Entity, EntityLivingBase, int, double) instead. After this change tipped arrows would be affected by MC-25866 / MC-98123 as well.
This report relates to MC-25866.
Regarding saturation potions: MC-25866.
Confirmed.
And how would you go about getting a "Splash Potion of Saturation"? There's no such thing listed on the potions page on the wiki.
@Torabi - It's accessed through the /give command, with potion effect 23 as the CustomPotion modifier.
I would very much like to see this bug patched, I had hoped to include Splash potions of Saturation in an important gameplay mechanic of a Custom Map I had been working on, but was unpleasantly surprised to find this bug in the process.
Fingers crossed Mojang gets to this in the near future! (:
This is likely Working as Intended for the time being, as a potion with the saturation effect cannot be acquired through normal gameplay mechanics. There are many aspects to potion brewing that were left incomplete, but hopefully Mojang will revisit potions in the future.
Invalid as it refers to unimplemented things
I think that you misunderstand.
I can drink a potion that has saturation as a custom potion effect, and receive the saturation effect. However, I can not splash a splash potion that has saturation as a custom potion effect, and receive the saturation effect.
The fact that this is not implemented is the bug, as this is not the case with literally every other potion effect, such as Health Boost (Id:21) which is an effect that cannot be obtained through, as Torabi said "...normal gameplay mechanics."
I think that this should be reopened, unless the fact that I can splash myself with health boost is a bug.
This is comparable with the Giant: A feature that is actually in the game, but can only be used by special means, not actually supported by the developers.
How is this comparable with the giant?
Because, to me:
Potions are something that are available to all players of the game on the front end. Giants can only be accessed through either commands or NBT editing. The fact that one thing is broken with one potion does not mean that it is an idea that fell by the wayside of the developer, it just means that it's broken, and is a bug.
How is this just something that isn't supported by the developer?
The saturation potion is, to my knowledge, only implemented for technical reasons, to make things work behind the scenes.
However, since I don't have 100% developer confirmation and I don't really want to poke one now: Reopened.
Confirmed for
Confirmed for 1.10.2.
This is highly related to
MC-98123, and most of the code analysis there applies here as well (the same usage of affectEntity is found in EntityPotion).Confirmed for 17w50a.
Seems to be somehow related to MC-121429 and how Minecraft processes instant effects in potions.