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

Effect duration on players decreased by 1 before a command can see it, but not on mobs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • None
    • 1.19.2
    • None
    • Confirmed
    • Statistics

      When an effect is applied (eg by a tipped arrow) commands can detect the effect with the full duration on mobs, but for players, the duration has already decreased one tick.

      Steps to reproduce:

      1. Run the following commands:
        /give @s bow
        /give @s tipped_arrow{CustomPotionEffects:[{Id:27,Duration:5,Amplifier:0b}]} 10
        /setblock ~ ~ ~1 repeating_command_block[facing=south]{auto:1b,Command:'execute as @e[nbt={ActiveEffects:[{Id:27}]}] run tellraw @p {"nbt":"ActiveEffects[{Id:27}].Duration","entity":"@s"}'}
        /setblock ~ ~ ~2 chain_command_block[facing=south]{auto:1b,Command:'effect clear @e unluck'}
      2. Shoot a mob
      3. it returns "5" in chat
      4. Shoot a player (eg yourself)
      5. it returns "4" in chat, meaning that the duration has already decreased

      This is problematic for 2 instances:

      1. A duration of 1 tick can be detected on mobs, but not players.
      2. If the duration is set to a specific value (eg to the score of a shooter), it will not return the correct value.

            Unassigned Unassigned
            jirauser71590 user-f2760 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: