Skip to content

Piglin Barter Drops are Biased #4326

@JustAHuman-xD

Description

@JustAHuman-xD

❗ Checklist

  • I am using the official english version of Slimefun and did not modify the jar.
  • I downloaded the official version from the new build site Blob Builds.
  • I am using an up to date "DEV" (not "RC") version of Slimefun.
  • I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
  • I searched for similar open issues and could not find an existing bug report on this.

📍 Description

The piglin barter drop recipe type uses a hashset and iterates over it when generating the custom drop, the hash set, after its done being modified (post finalized event) will have a deterministic order for the runtime of the server.

Because of this, the items at the beginning of the iteration order have a bias towards being dropped.

📑 Reproduction Steps

Look at the code

💡 Expected Behavior

Drops would be properly randomized always

📷 Screenshots / Videos

No response

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Spigot

🎮 Minecraft Version

1.20.x

⭐ Slimefun version

Image

🧭 Other plugins

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueThis is an Issue that may be easy to fix if you are a beginner🐞 Bug ReportA bug that needs to be fixed.🧨 Confirmed BugThis bug has been confirmed by our team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions