Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-98527

Effects added by modifying ActiveEffects tag are not updated instantaneously

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: Minecraft 1.9, Minecraft 1.9.4, Minecraft 16w43a
    • Fix Version/s: None
    • Environment:

      Java 8u73

    • Confirmation Status:
      Confirmed

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              insane96mcp Insane96MCP
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: