PaperMC / PaperMC/Paper

Cancelling LootGenerateEvent does not cancel unpackLootTable

Open
#12,998 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted version: 1.21.8
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Cancelling the LootGenerateEvent should also cancel unpackLootTable, which happens before the LootGenerateEvent.

Observed/Actual behavior

Cancelling the LootGenerateEvent does not cancel unpackLootTable.

Steps/models to reproduce
  1. Create a plugin that cancels the LootGenerateEvent
  2. Interact with a chest that has a loot table (can't be opened in spectator)
  3. The loot table was cleared (you can open the loot chest in spectator mode)
Plugin and Datapack List

No plugins, this is an issue I experienced while developing a plugin.

Paper version

This server is running Paper version 1.21.8-39-main@616a879 (2025-08-18T02:25:55Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
You are running the latest version

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the LootGenerateEvent and unpackLootTable entry points in Paper's loot handling. Reproduce the issue with a plugin that cancels LootGenerateEvent and a chest loot table, then add regression coverage showing that cancellation leaves the loot table available for the stated spectator-mode check.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.