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

The order of the potions is never the same with the 'instant_health' and 'saturation' effects, because they use the same color

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 23w51b
    • None
    • Plausible
    • UI
    • Low
    • Platform

      see: https://github.com/neoforged/NeoForge/issues/443#issuecomment-1872934417

      Both effects have the same color (16262179, or #F82423), so therefore both effect's chains are the same! Thus, both effects are considered to be equal to each other (by the comparison code). So any change in ordering must happen before the sorting, as the sorting done by Minecraft has no effect to these two effects.

       

      Living entity effects are stored in a map; specifically, a hash map (HashMap). The order of entries of the map isn't guaranteed, therefore the order of entries within the map can change from each run of the JVM. This explains why the two effects (saturaion and instant health) seem to differ in their positions; which one goes first entirely depends on their ordering within the original map.

            Unassigned Unassigned
            Lolothepro29 Lolo
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: