LootTable#populateLoot Missing required parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
When using the steps to reproduce code, the loot should populate without error.
Observed/Actual behavior
When using the steps to reproduce code, an error occurs at LootTable#populateLoot():
java.lang.IllegalArgumentException: Missing required parameters: [<parameter minecraft:direct_killer_entity>, <parameter minecraft:this_entity>, <parameter minecraft:block_state>, <parameter minecraft:block_entity>, <parameter minecraft:explosion_radius>]
Steps/models to reproduce
LootContext.Builder context = new LootContext.Builder(block.getLocation());
LootTable table = Bukkit.getLootTable(key);
table.populateLoot(null, context.build());
Plugin and Datapack List
CustomPlugin, CustomDataPack(for loot table)
Paper version
This server is running Paper version git-Paper-169 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: b4e3b3d)
You are running the latest version
Previous version: git-Paper-167 (MC: 1.20.1)
Other
This is the loot table I am using from the data pack:
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:paper",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "minecraft:pickaxes"
}
}
]
}
]
}
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the LootTable#populateLoot API and the LootContext.Builder usage shown in the reproduction. Trace how required parameters are validated for the supplied block location and compare that behavior with the documented API contract. Done means the provided context no longer produces the reported missing-parameters error, with coverage for this reproduction if an existing test area is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100