mojira.dev
MCPE-238050

LootItem.name returns undefined for custom items/blocks when reading loot tables via Script API LootTableManager

Description:

When using the Script API's LootTableManager.getLootTable() to read a loot table containing both custom (add-on defined) and vanilla entries, the LootItem.name property correctly returns the identifier for vanilla items and blocks (e.g., minecraft:diamond, minecraft:diamond_block) but returns undefined for custom items and blocks (e.g., ss_ltm:custom_item, ss_ltm:custom_block).

Steps to Reproduce:

  1. Apply the attached mcaddon.

  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: All four loot table entries return their respective identifiers via LootItem.name.id:

  • ss_ltm:custom_block

  • ss_ltm:custom_item

  • minecraft:diamond_block

  • minecraft:diamond

Actual Result: Only the vanilla entries return their identifiers. The two custom entries return undefined for LootItem.name, resulting in N/A when accessed:

pool_entries: [
  { "name": "N/A" },              // ss_ltm:custom_block - MISSING
  { "name": "N/A" },              // ss_ltm:custom_item - MISSING
  { "name": "minecraft:diamond_block" },  // OK
  { "name": "minecraft:diamond" }         // OK
]

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

Attachments: Repro mcaddon 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