Lootr For Developers
There is a loot table condition which can be consulted to determine how many times a loot table has been opened before. That condition is LootItemConditionType "lootr:loot_count". This allows you to adjust loot quality depending on the number of people who have previously opened a chest.
Simply put, it's possible to provide native support for Lootr in your mod. This is done via the LootrAPI package. You will need to:
- Provide a unique identifier for each container that is saved with that container
- Provide a loot table for that container
- Create a separate class which has a function that accepts this information and then calls the relevant
LootrAPIfunction. - In your block entity "open" code, determine if Lootr as a mod is loaded; if so, call the function in your separate class; if not, simply call the
supermethod or however you would otherwise handle this.