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

Redstone components lose 1 tick of delay when (de-)activated by a player input

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16, 1.16.1, 20w28a, 20w29a, 1.16.2 Pre-release 2, 1.16.2, 1.16.3, 1.16.4, 1.18.1, 1.20.6, 24w19b
    • None
    • Community Consensus
    • Redstone
    • Normal
    • Platform

      Redstone components that are (de)powered as a direct result of player actions lose 1 tick of delay. 

      All player actions cause this behaviour, including:

      • Flicking a lever on or off
      • Pressing a button
      • Stepping on a pressure plate
      • Activating tripwire
      • Placing or breaking blocks
      • Right clicking a note block, opening or closing (trap)doors and fence gates, changing the delay on a repeater, etc.
      • Executing commands
      • Interacting with containers (adding/removing items)

      Any redstone component that has delay is affected by this behaviour, including:

      • Repeaters
      • Comparators
      • Redstone torches
      • Droppers
      • Dispensers
      • Observers
      • Redstone lamps when depowering
      • Buttons when depowering

      The attached screenshot ("input_bug.png") shows a simple mechanism to showcase the behaviour. 
      If the lever on the purple wool block is powered, the redstone torch will lose 1 tick of its delay, which results in the red line depowering 1 tick before the green line.
      If instead the lever on the blue wool block is powered, the redstone torch has its usual 2 ticks of delay, and both the red and green line depower in sync.

       

      Code analysis

      This behaviour occurs because player interaction packets sent by the client are handled before the world time is incremented. New tasks are usually scheduled after the world time is incremented, so scheduled tasks as a result of player actions skip 1 tick of delay when the world timer increments.

      Incrementing the world time after all the dimensions have been ticked will fix this issue.

        1. 2020-04-14_22.33.08.png
          2020-04-14_22.33.08.png
          811 kB
        2. 2024-05-14_20-33-11.mp4
          1.77 MB
        3. input_bug.png
          input_bug.png
          106 kB

            Unassigned Unassigned
            Space Walker Space Walker
            Votes:
            26 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              CHK: