mojira.dev
MC-301082

The generic loot context doesn't provide interacting_entity and target_entity parameters

The minecraft:generic loot context is supposed to provide all parameters (and thus disable parameter checking). However, the parameters interacting_entityand target_entity that were added in 25w31a are not provided by this loot context.

How to reproduce:

I’ve attached a datapack with the following loot table as minecraft:brush/armadillo

{
  "type": "minecraft:generic",
  "pools": [
    {
      "bonus_rolls": 0.0,
      "entries": [
        {
          "type": "minecraft:item",
          "functions": [
            {
              "function": "fill_player_head",
              "entity": "interacting_entity"
            },
            {
              "function": "set_name",
              "name": {
                "selector": "@s"
              },
              "entity": "target_entity"
            }
          ],
          "name": "minecraft:player_head"
        }
      ],
      "rolls": 1.0
    }
  ],
  "random_sequence": "minecraft:brush/armadillo"
}

The loot table works as intended: Brushing a armadillo gives a player head of the player that does the brushing, named after the armadillo. When the type is set to minecraft:entity_interact the loot table validates without issue.

  1. Add the attached data pack to a world. (use /reload if necessary)

  2. Look in the game log:

    [18:54:12] [Worker-Main-12/WARN]: Found loot table element validation problem in {minecraft:brush/armadillo@minecraft:loot_table}.pools[1].entries[0].functions[0]: Parameters [<parameter minecraft:interacting_entity>] are not provided in this context
    [18:54:12] [Worker-Main-12/WARN]: Found loot table element validation problem in {minecraft:brush/armadillo@minecraft:loot_table}.pools[1].entries[0].functions[1]: Parameters [<parameter minecraft:target_entity>] are not provided in this context

Expected result:

There shouldn’t be any warnings about parameters not being provided when using the generic context.

Attachments

Comments 0

No comments.

jacobsjo

(Unassigned)

Confirmed

Platform

Low

Loot tables

25w33a

Retrieved