Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Loot Table support #2423

Open
ejm opened this issue Apr 10, 2022 · 1 comment
Open

Enhanced Loot Table support #2423

ejm opened this issue Apr 10, 2022 · 1 comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage

Comments

@ejm
Copy link
Contributor

ejm commented Apr 10, 2022

Major SpongeAPI version

8

Is this likely to be a breaking change?

Yes

What are you requesting?

Currently, Sponge supports some concept of Loot tables through the LootTable class and related weighted table utility classes, but there's (seemingly) no way to get the loot table of an entity or block entity nor is there any way to set a custom loot table for an entity with the Data API.

Other mod APIs support such operations, such as the Bukkit (Spigot?) API and Forge API, notably using the concept of a LootContext which contains data used by the Vanilla server to calculate drops (the amount of luck the roller has, etc.).

It would be helpful to have such API support in Sponge for use in minigames and utility plugins like "mob stackers." Chances are, this would require changes to the existing weighted table classes to support a LootContext-like object, so this change would likely be breaking.

Thanks!

@ejm ejm added the status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage label Apr 10, 2022
@Lignium
Copy link
Contributor

Lignium commented Sep 11, 2023

I think we can first add keys Keys#LOOT_TABLE with ResourceKey type and Keys#LOOT_TABLE_SEED to assign a generation seed. This will be enough to assign an existing loot table from a data pack to a chest or mob.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage
Projects
None yet
Development

No branches or pull requests

2 participants