Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 

  • 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
	

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.

  • 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; <----------------------				
			    }
		}				
			

 

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.