Chest Hooks - 1.7.10
Chest hooks allow your custom items to spawn inside naturally generated chests, such as the ones in dungeons, mines, strongholds and even the bonus chest.
To add an item to a chest, simply type the following inside your init method:
ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(youtItem), 2, 5, 20));
ChestGenHooks is the superclass for the available gen areas.
At new WeightedrandomChestContent(new ItemStack(yourItem), par1, par2, par3));
par1 is the minimum that will spawn and par2 is the maximum.
par3 is the rarity, but how it's scaled is a little strange. To understand a reference of it, the number "1" is the rarity of a golden apple (the better kind) while 100 is the rarity of an iron ingot.
To add an item to a chest, simply type the following inside your init method:
ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(youtItem), 2, 5, 20));
ChestGenHooks is the superclass for the available gen areas.
At new WeightedrandomChestContent(new ItemStack(yourItem), par1, par2, par3));
par1 is the minimum that will spawn and par2 is the maximum.
par3 is the rarity, but how it's scaled is a little strange. To understand a reference of it, the number "1" is the rarity of a golden apple (the better kind) while 100 is the rarity of an iron ingot.