Posted August 12, 20187 yr How to set a container item? My item is called bowl_and_pestle. I want it to stay in the crafting table like buckets. Sorry for bad english. Thanks for the help ? I am a beginner developer so please don't write hard code. Thanks Edited August 12, 20187 yr by chrizz
August 12, 20187 yr A container item is what happens when you remove contents from an item and leave its container. e.g.: Bucket of Milk (has container Bucket) Bowl of Stew (has container Bowl) So your mortar and pestle would have a container item of mortar and pestle. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 12, 20187 yr Author 14 minutes ago, Draco18s said: A container item is what happens when you remove contents from an item and leave its container. e.g.: Bucket of Milk (has container Bucket) Bowl of Stew (has container Bowl) So your mortar and pestle would have a container item of mortar and pestle. Yeah but I don't know the code...
August 12, 20187 yr Author For now i've done that but it not work. package com.c_h_r_i_z_.bakerymod.items; import com.c_h_r_i_z_.bakerymod.items.base.ItemBase; import net.minecraft.item.ItemStack; public class ItemBowlAndPestle extends ItemBase { public ItemBowlAndPestle(String name) { super(name); setMaxStackSize(1); setNoRepair(); setMaxDamage(40); } @Override public ItemStack getContainerItem(ItemStack itemstack) { ItemStack stack = itemstack.copy(); stack.attemptDamageItem(1, itemRand, null); return stack; } @Override public boolean hasContainerItem(ItemStack stack) { return true; } }
August 12, 20187 yr 42 minutes ago, chrizz said: it not work. Huh, I wonder how one might solve this problem you have here. It not working is a big one. If only we new what not working meant. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 12, 20187 yr 29 minutes ago, chrizz said: Someone send the correct code please I really need that. No. We will never write your code for you. What are you trying to achieve? Have you looked at Item#setContainerItem https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/mods-discussion/1403810-how-to-return-buckets-after-crafting About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
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.