KubeJS

KubeJS

69M Downloads

Get Reference to Existing LootTable as JSON

Dark-Arcana opened this issue ยท 2 comments

commented

The new feature additions for modifying loot tables of all varieties is really useful. However, the greatest draw back right now (for me at least) is that it only supports adding one entry to a loot table at a time. I currently have a ton of loot table entries in separate pools inside json files in the data folder. I want to be able to load one or more of these existing tables and add their pools directly to another existing table (ie chests/simple_dungeon or something like that) so that I'm only modifying the potential loot a player might find rather than being required to compeltely override it.

Is it possible to add a few more 'chest.loottable' event functions for this feature?

commented

That's pretty nifty. Wish I knew about it last year! Thanks.

commented

This is possible as you can get and modify the loot table json, however that is not very nice. You can also load specific json files with JsonIO.read('kubejs/data/rest_of/path_relative/to_.minecraft.json') if that is easier.

For more powerful loot modification the addon LootJS is very good, and I would definitely reccomend it over using KubeJS existing events if you want to do something even slightly complex.