Jump to content

[1.8] ChestGenHooks not working with mod items!


MacDue

Recommended Posts

 

I'm trying to add some mod item loot to a chest but the items never spawn correctly (it just spawns useless missing texture non-items)  in the chest. The items themselves are fine other than the ones that spawn in chests.

 

Here is what I mean:

3mQamAi.png

 

ChestGenHooks in public void load(FMLInitializationEvent event)

 ChestGenHooks chestcontents = ChestGenHooks.getInfo("RelicChest1"); // create registered ChestGenHooks
     chestcontents.addItem(new WeightedRandomChestContent(mystical_epicarno_mod.Epicnite, 3, 4, 6, 10)); // 4-6 cocoa beans
     chestcontents.addItem(new WeightedRandomChestContent(  Item.getItemFromBlock(mystical_epicarno_mod.RelicTNT), 1, 1, 6, 10)); // 4-6 cocoa beans

     chestcontents.addItem(new WeightedRandomChestContent(new ItemStack(mystical_epicarno_mod.Tack, 1, 15), 2, 5, 20)); // 2-3 black wool

  

     chestcontents.setMin(7); // inclusive
     chestcontents.setMax(9); // exclusive

 

ChestGen in WorldGenCode

  BlockPos blockpos2 = new BlockPos(i + 8, j + 2, k + 2);
        TileEntity tileeentity1 = world.getTileEntity(blockpos2);

        if (tileeentity1 instanceof TileEntityRelicChest)
        {

                WeightedRandomChestContent.generateChestContents(rand, ChestGenHooks.getItems("RelicChest1", rand), (TileEntityRelicChest)tileeentity1, ChestGenHooks.getCount("RelicChest1", rand));
           
        }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.