Event's Lootbags

Event's Lootbags

32.2k Downloads

This is my first mod and I'm not really experienced in java so bugs may(probably will) occur. To report issues or help with the code, head over to the mod's github page.

Anyway, this mod uses Vanilla loot table system to create loot. It has 5 tiers of bags and a loot table corresponding to each bag. Right clicking on the bag spawns the items. Mod comes with predefined loot tables for each bag, borrowed from Vanilla's loot tables (don't sue me Mojang, pls) like end city loot for legendary bag, mineshaft chest for basic etc.. In order to change default loot you need to create a datapack(example is given in Creating Datapack segment).

Creating a loot table

Loot tables follow Minecraft's 1.19 json loot table formatting. I suggest using an online loot table generator like this one to make things easier. Then you save the table as tier_name_lootbag (replace tier_name with common, uncommon, rare, epic or legendary to correspond with the bag which loot you want to change, example common_lootbag.json). After creating the loot tables, you will need to add them via datapacks.

Creating a datapack for this mod

Creating a datapack also follows the Vanilla way of creating datapacks, so go into the world folder where you want to use this datapack, go in to the datapacks folder, create a new folder with the name of your pack, in that folder you need data folder and pack.mcmeta file, more info on that here, then create folders in data that go eventlootbags/loot_tables/eventslootbags and in that folder you can put your .json files. If you are lazy to do that, I have made an example datapack that you only have to extract and put it in your saves/worldname/datapacks, download link is on the read me section on Github.

Recipes for bags

I've decided not to add recipes for the bags so that a modpack author will have full freedom to make their own or add bags to mob drops. This can be done with datapacks or using KubeJS.