mojira.dev
MC-311271

Some loot context parameters are missing from the `generic` loot context type

Following parameters is not declared as required parameters for ALL_PARAMS(generic) loot context in LootContextParamSets, which causes unnecessary warning for loot tables with its type set as generic and standalone LootDataTypes files since they also uses ALL_PARAMS for validation.

  • INTERACTING_ENTITY

  • TARGET_ENTITY

  • ENCHANTMENT_LEVEL

  • ENCHANTMENT_ACTIVE

How to reproduce

Though this easily confirmed by checking LootContextParamSets, here is steps to reproduce the issue in-game:

  • Load attached datapack on snapshot-10. This pack includes following elements, each of them uses their respective loot context parameter with minimum configuration:

    • Predicate

      • test:interacting_entity

      • test:target_entity

      • test:enchantment_active

    • Number provider

      • test:enchantment_active

  • There should warnings on launcher log as follows:

    • Found loot table element validation problem in {test:enchantment_active@minecraft:predicate}: Parameters [<parameter minecraft:enchantment_active>] are not provided in this context

    • Found loot table element validation problem in {test:interacting_entity@minecraft:predicate}: Parameters [<parameter minecraft:interacting_entity>] are not provided in this context

    • Found loot table element validation problem in {test:target_entity@minecraft:predicate}: Parameters [<parameter minecraft:target_entity>] are not provided in this context

  • Note that these standalone files themselves is a valid and works correctly if they are used in appropriate context. Apparently, there is no way to say standalone files are contextually invalid unless without their usage, and that’s why ALL_PARAMS are used for validation of them.

  • Speaking of ENCHANTMENT_LEVEL, no warning is shown becauseEnchantmentLevelProvider doesn’t even declare that they uses this parameter (which is a separate problem). It should override getReferencedContextParams() like other elements does.

Attachments

Comments 2

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

Data Packs

26.2

26.3 Pre-Release 2

Retrieved