Daily Rewards

Daily Rewards

962k Downloads

Is it Possible to Set Rewards to Loot Tables?

warrentode opened this issue ยท 4 comments

commented

My feature request/suggestion is exactly as stated in the title. I'm wondering if it's possible to set loot tables as the rewards to increase variance to the lists each month due to the way some of my custom mod loot conditions are set up to check for mod seasons, which don't necessarily coincide with calendar dates. It would be nice to have the daily rewards seamlessly fit in with the in-server events going on without needing to edit files weekly.

commented

Thanks for the feedback.
To understand your request more in detail I have some follow up questions.

1.) If I understand correctly, you want to define a loot table name instead of an item for the single day.
But the loot table item should be updated daily (or real time), so it should not be pre-calculated at the beginning of each month.

If this is true, it would mean that you can't have any preview function for the upcoming days, because the condition could be changed at any time, correct ?

Furthermore I assume that all players are getting the same loot or does the loot depends on the player stats, so that each player could get a different loot with the same loot table name ?

Technically something like this is doable, but depending on your answers there is no preview functionality for upcoming rewards and the user would only be able to get a single item from the loot table, not multiple.

  1. Could you please share an example loot table resource file for this, so that I could check the loot conditions more in detail.
commented

Sure thing. We're running the Serene Seasons mod, so our loot tables have custom season condition checks for the loot bags to drop. The default in the mod is 8 game days per sub season, but you can extend that for however long you'd like it to be. So a basic loot table for something like this could potentially look something like this:

{ "type": "minecraft:chest", "pools": [ { "bonus_rolls": 1.0, "entries": [ { "type": "item", "conditions": [ { "condition": "todecoins:spring_condition" } ], "name": "lootbags:loot_bag", "functions": [ { "function": "minecraft:set_nbt", "tag": "{Type: \"COMMON\", Loot: \"lootbags:easter_bag\", Color: 16766720, Name: \"Easter Bag\"}" } ] }, { "type": "item", "conditions": [ { "condition": "todecoins:summer_condition" } ], "name": "lootbags:loot_bag", "functions": [ { "function": "minecraft:set_nbt", "tag": "{Type: \"COMMON\", Loot: \"lootbags:beach_bag\", Color: 16766720, Name: \"Beach Bag\"}" } ] }, { "type": "item", "conditions": [ { "condition": "todecoins:autumn_condition" } ], "name": "lootbags:loot_bag", "functions": [ { "function": "minecraft:set_nbt", "tag": "{Type: \"COMMON\", Loot: \"lootbags:beach_bag\", Color: 16766720, Name: \"Trick or Treat Bag\"}" } ] }, { "type": "item", "conditions": [ { "condition": "todecoins:winter_condition" } ], "name": "lootbags:loot_bag", "functions": [ { "function": "minecraft:set_nbt", "tag": "{Type: \"COMMON\", Loot: \"lootbags:beach_bag\", Color: 16766720, Name: \"Christmas Bag\"}" } ] } "rolls": 1.0 } ] }

The Resourceful Loot Bags mod lets you set the name and appearance of the bags to pretty much whatever you'd like, so they could be set to look all alike, just have different tables depending on season.

commented

Thank you for your feedback and for providing an example. I appreciate the effort.
However, implementing something similar to this presents a challenge. The current loot table conditions rely on having all necessary user information upfront for the LootParams.Builder to work effectively.

While I've successfully integrated similar mechanisms in other mods, this particular case poses a greater complexity. The conditions are subject to change dynamically, requiring periodic queries to the LootParams.Builder to ensure the accurate selection of loot. This dynamic nature complicates the implementation process, making it harder to achieve seamless functionality.

commented

I understand. Thank you for your time and investigating the matter.