I don't seem to be able to use
{Effect:[{Id:23, [...] }]}
on an AreaEffectCloud - it simply gives no effects and everything else works perfectly.
Exact command I'm using:
/summon area_effect_cloud ~ ~ ~ {Particle:mobSpell,ReapplicationDelay:10,Radius:2.5f,RadiusPerTick:-0.0025f,RadiusOnUse:-0.05f,Duration:1000,DurationOnUse:0f,WaitTime:0,Effects:[{Id:23,Amplifier:2,Duration:600,ShowParticles:0b}],Potion:"minecraft:water"}
What I expected to happen:
Saturation effect applied to player
What actually happened was:
No effect was applied
Steps to Reproduce:
1. Put the command above in a command block
2. Activate the command block
3. Stand in cloud; no effect is applied
Code analysis by @unknown can be found in this comment.
Linked issues
Comments


That's the point - it doesn't work with saturation. Of course it works with all other effects, but not for saturation.

Just discovered this bug myself in 1.10.2. Kinda disappointing.

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)
net.minecraft.entity.EntityEffectCloud.onUpdate() (ru.m(), lines 261-265)
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:
net.minecraft.potion.Potion.affectEntity(Entity, Entity, EntityLivingBase, int, double) (rp.a(rw, rw, sf, int, double), lines 102-114)
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).

Confirmed for 17w48a.
Seems to be somehow related to MC-121429 and how Minecraft processes instant effects in potions.
Note that changing the Effect id to 1 (Speed) makes this work.
This results in the command:
/summon AreaEffectCloud ~ ~ ~ {Particle:mobSpell,ReapplicationDelay:10,Radius:2.5f,RadiusPerTick:-0.0025f,RadiusOnUse:-0.05f,Duration:1000,DurationOnUse:0f,WaitTime:0,Effects:[{Id:1,Amplifier:2,Duration:600,ShowParticles:0b}],Potion:"minecraft:water"}