Skip to content

Fix crash for blocks that use copy block entity data function#93

Merged
MelanX merged 1 commit into1.21from
fix/copy-entity-data-function
Jan 3, 2026
Merged

Fix crash for blocks that use copy block entity data function#93
MelanX merged 1 commit into1.21from
fix/copy-entity-data-function

Conversation

@MelanX
Copy link
Copy Markdown
Member

@MelanX MelanX commented Dec 23, 2025

If you have a block in your child of BlockLootProviderBase that registers it's loot table like this, Minecraft fails to encode the data because id is missing. That results in a crash when the game wants to save the players inventory for example.

this.drops(ModBlocks.experienceCrystal, this.noSilk(), this.copyNBT("Xp"));

This PR makes sure to always add the block entity id to the item.

@MelanX MelanX requested a review from noeppi-noeppi December 23, 2025 12:48
@MelanX MelanX merged commit 4d4b716 into 1.21 Jan 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant