
How to make lootr change chests/items/blocks for Cobblemon (or other mods) ?!
PassyFox opened this issue ยท 5 comments
At the moment lootr does everything in our world with the biggest world gen mods for exploration:
- Choice Theorem's Overhauled Village
- Towns and Towers
- Dungeons and Taverns
- all YUNG mods
It perfectly changes all the chests/items with their respected loot tables into lootr chests and even works perfectly with just respawning the loot after a set time.
Now the biggest modpack of the moment is off course Cobblemon. And here comes the problem, this mod introduces a different kind of chest called "Gilded chests". We would really love for a way to have these chests convert into lootr chests as well or even have them in a list that they won't convert.
My question is how does lootr know what chests/items to convert? Somewhere in the code you should have specified that the mods looks for "minecraft::chest" for example to convert it. Isn't it possible to have the code point to an variable, which you can set in the config file as to what blocks (or chests) needs to be changed into lootr chests? That way people can add chests/blocks/items from other mods if necessary by just adding the in game name, without having to change the loot tables, since these are provided for by the mod makers.
At the moment you have two lines of code pointing towards this solution in your config file under the "conversion" part, which states even elytra's and mineshaft (probably only means minecart chests) should be converted. it could look something like this (the bedrock block is an example off course):
"conversion": {
"convert_item": [
minecraft:elytra
],
"convert_container": [
minecraft:chest,
minecraft:chest_minecart,
cobblemon:gilded_chest,
cobblemon:gimmighoul_chest
],
"convert_block": [
minecraft:bedrock
]
}
i'm very curious if this might be a solution to the challenge of having containers or even other blocks from other mods to use the lootr system as well. As an extension you could also apply the conversion code to the textures if the need to be original/modded or changed into the lootr chest texture.
Thank you for taking the time to answer this question! The new updated version of the FAQ explains a lot.
Several suggestions though:
- Make your datapacks for BetterNether and BetterEnd available on Modrinth as well and not only on CurseForge (perhaps even on the same page as lootr as optional dependencies), im sure this will help the community and yourself with extra add revenue
- I'm no coder but willing to try and see if i can edit the files to make a version compatible with Cobblemon, but it might be much faster and more pleasant if you would gladly make a file for that mod so it stays in line with how you set everything up instead of a wild me possibly breaking things.
Again thank you for creating the mod and taking the time, it really helps our server members having fun exploring again and seeing chests filled with loot and even on return visits. Some are really thinking into the idea of inhabiting dungeons or villages for that matter.
I've moved away from using configuration for this purpose and instead use Minecraft's standard block tags system.
I realize now that it wasn't clearly explained in the FAQ, so I've updated it and it can now be found in a new section of the FAQ for "How do I add blocks for conversion?".
Let me know if the explanation there is sufficient.
I'm no coder but willing to try and see if i can edit the files to make a version compatible with Cobblemon, but it might be much faster and more pleasant if you would gladly make a file for that mod so it stays in line with how you set everything up instead of a wild me possibly breaking things.
Data packs are basically the standard way to modify anything these days, although I realize that there are a lot of KubeJS wrappers around these days. Learning data packs and becoming familiar with them would be a long-term useful skill, as it will likely remain the standard for Minecraft for as long as it is updated.
Indeed, the data pack itself wouldn't be significantly different from the example configuration suggestion you made, except that it would be separate files within a specific folder structure.
You can also test your data packs in a single player world: the /reload
command reloads data packs, which are generally stored in the datapacks
folder of the world (or the save, in single-player). I believe KubeJS also has functionality to automatically load data packs into each world from a default directory.
While I can look at making the data pack for you, I can't promise that I'd be able to do it any time soon as I'm working on a bunch of projects at once.
Thank you for taking the time to awnser. I would love for it if you could make the datapack. I don't need it anytime soon so whenever you find the time and will to have a look into is fine by me :)
I have made the datapack myself in the meantime, it was really easy, i just had to change the chest names in the chests file and everything was ok. thank you for the help in the mean time. i have included the file as well, if you like you can check it and redistribute it as seeing a lot of people might find it helpful :)