mojira.dev
MC-98527

Effects added by modifying ActiveEffects tag are not updated instantaneously

Workaround

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

  1. Summon a couple of creepers in a world

  2. 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.

Comments 3

Cannot reproduce in 16w42a.

Is this still an issue for you in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

Works as intended, see Searge's comment on MC-66293

insane96mcp

(Unassigned)

Confirmed

potion, potion-effect

Minecraft 1.9, Minecraft 1.9.4, Minecraft 16w43a

Retrieved