mojira.dev
MCPE-238056

LootPool.bonusRolls does not return a usable NumberRange

The Script API's LootPool.bonusRolls is typed as minecraftcommon.NumberRange (with min and max properties), but at runtime it returns an object that does not conform to that interface. When serialized via JSON.stringify, the value is stripped entirely. The min and max properties are inaccessible regardless of whether bonus_rolls is defined as a flat number (1) or a range object ({"min": 1, "max": 10}) in the loot table JSON.

Steps to Reproduce:

  1. Apply the attached mcpack.

  2. Open a world with the pack applied.

  3. Run the custom command /ss_ltm:bug_report.

  4. Observe the output in chat.

Expected Result: Each pool's bonus_rolls field serializes as a NumberRange:

"bonus_rolls": [
    { "bonus_rolls": { "min": 1, "max": 1 } },
    { "bonus_rolls": { "min": 1, "max": 10 } }
]

Actual Result: The bonus_rolls field is missing from each entry — the native object fails to serialize, leaving only index:

"bonus_rolls": [
    {"bonus_rolls": "N/A" },
    {"bonus_rolls": "N/A" }
]

Observed in: Minecraft Preview, @minecraft/server 2.8.0-beta, engine version 1.26.20

Attachments: Repro mcpack included.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media]

SmokeyStack

(Unassigned)

Unconfirmed

Windows

11

26.20.26 Preview

Retrieved