mojira.dev
MCPE-226214

Scripting API: LootTableManager ignores tool enchantments

The method LootTableManager.prototype.generateLootFromBlock, when called with a tool with enchantments such as Silk Touch or Fortune, ignores enchantments and returns a list of loot items as if the block were broken with a non-enchanted tool.

I haven’t tried any other generateLootFrom* methods so I don’t know whether they have the same issue or not.

Steps to reproduce

  1. Create a world with a test addon MCPE-226214.mcpack activated. You can find it in the comment section.

  2. Whenever you change the selection in the hotbar, the addon simulates breaking an iron ore block with the selected item, and reports the result as a message.

  3. Craft a netherite pickaxe, enchant it with Silk Touch, then select it in the hotbar.

  4. Craft another netherite pickaxe, enchant it with Fortune III, then select it in the hotbar.

Observed results

  • On the step 3 I see the addon reporting “Breaking an iron ore block with the selected minecraft:netherite_pickaxe yields minecraft:raw_iron x 1”.

  • On the step 4 I always see the addon reporting “Breaking an iron ore block with the selected minecraft:netherite_pickaxe yields minecraft:raw_iron x 1” no matter how many times I try.

Expected results

  • On the step 3 I expect it yields minecraft:iron_ore instead, since the pickaxe I used has Silk Touch.

  • On the step 4 I expect it generally yields more than a single minecraft:raw_iron because the pickaxe has Fortune III.

Attachments

Comments 2

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach an example addon showcasing the issue?

Just a reminder, to make your bug report as effective as possible, please try and include the following steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Okay, I made an addon to reproduce the issue. But I can’t seem to attach the file via “Edit Report”. I’m going to update the description after posting this.

[media]

PHO

(Unassigned)

Unconfirmed

iOS

1.21.100

Retrieved