Posted June 2, 20232 yr im updating mi briefcase item to 19.4 i t has two parts an item whit a menu and a block whit a menu that spawn when shift right click on the floor i wanna limit this to only one for slot that's max stack size = one seems to have not this value and items says its deprecated use another thing @Deprecated // Use ItemStack sensitive version. public final int getMaxStackSize() { return this.maxStackSize; } how do i set stack limits now
June 2, 20232 yr Author //@Override // Use ItemStack sensitive version. public static int getMaxStackSize() { return 1; } //Error display by intellij //getMaxStackSize()' cannot override 'getMaxStackSize()' in 'net.minecraft.world.item.Item'; overridden method is final
June 2, 20232 yr 1 hour ago, perromercenary00 said: seems to have not this value and items says its deprecated use another thing Is this for the SlotItemHandler? If so, then just add the one with the ItemStack param. Regardless though, I don't see that deprecation warning.
June 3, 20232 yr Author On 6/2/2023 at 8:00 AM, ChampionAsh5357 said: Is this for the SlotItemHandler? If so, then just add the one with the ItemStack param. Regardless though, I don't see that deprecation warning. no this is in the item class or in the block class in old version you set the limit of the stack size in the constructor Spoiler package mercenarymod.items.espadas; import mercenarymod.materialesMercenarios; import mercenarymod.Mercenary; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.Item; import net.minecraft.item.ItemAxe; import net.minecraftforge.fml.common.registry.GameRegistry; public class espada extends ItemSword { public espada( Item.ToolMaterial mat, String name ) { super(mat); setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerItem(this, name); setCreativeTab(Mercenary.herramientas); this.maxStackSize = 1; <---------------------- } }
June 5, 20232 yr On 6/3/2023 at 9:36 AM, perromercenary00 said: this.maxStackSize = 1; <---------------------- You're supposed to do this with the `stacksTo` item property.
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.