mojira.dev
MC-311272

The game crashes when referenced loot context parameters are not provided by certain loot tables

Most elements that uses loot context parameters confirm that paramaters they are goint to use is not null, and if that’s not the case they returns fallback value (number providers → 0, predicates → false, item modifiers → original stack, etc.).
However, following elements doesn’t perform such confirmation, which can results in crash if they are executed in context that doesn’t have try-catch (e.g. loot table when mobs are killed by non-player damage).

  • EnchantmentLevelProvider

  • EnvironmentAttributeValue

  • EnvironmentAttributeCheck

How to reproduce

  • Create world with attacked datapack.

  • Perform following action to test these classes:

    • EnchantmentLevelProvider: Summon a silverfish and kill it by non-player damage (e.g. fall damage)

    • EnvironmentAttributeValue: Barter with a piglin.

    • EnvironmentAttributeCheck: Summon an arumadillo and use a brush on them via a dispenser.

  • ※ These specific actions are to call loot tables without required parameter (enchantment_level for EnchantmentLevelProvider, origin for the other two) outside of try-catch (for exapmle, player attack or command have try-catch).

  • Each of these action causes crash.

Attachments

Comments 3

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:
1. (Explain what needs to be done for the issue to happen)
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Mueller857

boq

Confirmed

Platform HC

Normal

Crash, Data Packs

26.2

26.3 Pre-Release 2

Retrieved