Mojira Archive
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.

Works As Intended

Insane96MCP

2016-03-01, 09:49 AM

2020-08-02, 08:06 PM

2016-10-23, 10:33 PM

0

3

Confirmed

potion, potion-effect

Minecraft 1.9, Minecraft 1.9.4, Minecraft 16w43a

-