-
Bug
-
Resolution: Works As Intended
-
None
-
Minecraft 1.9, Minecraft 1.9.4, Minecraft 16w43a
-
Java 8u73
-
Confirmed
This workaround works for 16w43a and 1.10
Use values for the Duration which are a multiples of 600 and then add 1, for example 601, 1201, 1801...
This currently works because the potions are updated when one of them has a duration % 600 == 0. Before this test happens the duration is decreased by one, which is why you have to add 1.
The bug
Changing the ActiveEffects tag of a mob does not update the potion effects. This means for example that mobs won't become invisible instantaneously.
Tried using /effect and it works properly
Video: https://youtu.be/nnkTrLmWk_Q
How to reproduce
- Summon a couple of creepers in a world
- Give them invisibility with:
/entitydata @e[type=creeper] {ActiveEffects:[{Id:14,Amplifier:0,Duration:1000000}]}
Some (maybe all) of them don't disappear.
Re enter your world; now they've disappeared.
Code analysis
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The problem is that when the ActivePotionEffects tag is read, the method net.minecraft.entity.EntityLivingBase.markPotionsDirty() is not called if the tag contained potion effects.