Karkic Posted March 24, 2021 Report Share Posted March 24, 2021 (edited) Hi I'm currently having trouble with understanding how to link a asset location. When I try to create an item stack of a modded item it returns Item Stack not found. A vanilla item works when called. modid is test public override WorldInteraction[] GetPlacedBlockInteractionHelp(IWorldAccessor world, BlockSelection selection, IPlayer forPlayer) { return new WorldInteraction[] { new WorldInteraction() { ActionLangCode = "Add Paperx8", MouseButton = EnumMouseButton.Right, HotKeyCodes = new string[] {"sprint", "sneak" }, Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("paper")), 8) }//item not found } }.Append(base.GetPlacedBlockInteractionHelp(world, selection, forPlayer)); } the item.json file is located assets/paper/itemtypes/paper.json { "code": "paper", "class": "PaperItem", "creativeinventory": { "general": [ "*" ] }, "texture": { "base": "item/paper" } } help would be apricated on how to create an asset location for any modded object. Edited March 24, 2021 by Karkic Link to comment Share on other sites More sharing options...
Spear and Fang Posted March 24, 2021 Report Share Posted March 24, 2021 (edited) Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("paper")), }//item not found If that line above works with vanilla items, then prefix paper with your modid + : (look in your modinfo.json for your modid) and see if that fixes it...i.e. Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("mymodid:paper")), }//item not found Edited March 24, 2021 by Spear and Fang 1 Link to comment Share on other sites More sharing options...
Karkic Posted March 24, 2021 Author Report Share Posted March 24, 2021 13 minutes ago, Spear and Fang said: Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("paper")), }//item not found If that line above works with vanilla items, then prefix paper with your modid: and see if that fixes it... Itemstacks = new ItemStack[] { new ItemStack(world.GetItem(new AssetLocation("mymodid:paper")), }//item not found thank you for helping me. the main issue was I didn't have the blocks/items under the correct folder in assets. Link to comment Share on other sites More sharing options...
Recommended Posts