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

Java Random reimplemented incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 21w41a, 1.18 Pre-release 1, 1.18 Release Candidate 1, 1.18.1 Release Candidate 2, 22w11a, 22w14a
    • None
    • Community Consensus
    • World generation
    • Low
    • Platform

      A few members of our community have been studying the latest snapshot code and they claim to have found an issue in the class LegacyRandomSource.
      Java documentation specifies that Next(bits) should return (int)(seed >>> (48 - bits)). However, current code seems to return (int)(seed >> (48 - bits)).
      This could cause future issues related to nextInt returning negative numbers in rare cases, and incomplete parity with Bedrock.

      Members that confirmed this issue in our community: cortex and MrSpike.

            Unassigned Unassigned
            atleast3chars MC@h Matt
            Votes:
            11 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              CHK: