Jump to content

[1.7.10] Setting Stack Size over 64


American2050

Recommended Posts

Would it be possible to set a stack size for an item above 64 and make it work without problems?

 

As for now I can actually pick over 64 of my custom item (Middle click in creative mode) but when I place them in my inventory the stack created is only 64 and the remaining ones are still in my hand... (In survival the stack in inventory stops at 64 and it starts a new one.

 

I guess I have to overwrite something else that I'm missing, but not sure.

 

private static int maxStack = 80;

public ItemOre()
{
	super();
	this.setMaxStackSize(maxStack);
	this.setCreativeTab(ModCreativeTab.BD_Misc);

}

@Override
    public Item setMaxStackSize(int stackSize)
    {
        this.maxStack = stackSize;
        return this;
    }

    /**
     * Returns the maximum size of the stack for a specific item.
     */
@Override
    @Deprecated
    public int getItemStackLimit()
    {
        return this.maxStack;
    }

 

Most likely I'm also including the getItemStackLimit but I guess that's actually not needed.

 

Link to comment
Share on other sites

not possible without serious hacking.

we already had this topic once here.

why do you need a stack size bigger then 64?

 

Really it's just for the LULZ (For fun) on some items in my mod I needed a number higher than 64. I thought it was something easy (well, not easy, but I saw it I believe on Tinkers Constructs Arrows I believe)

 

I will stick to 64 I guess, don't want to make things more complicate in my code, lol.

 

Thanks for the answer ;)

Link to comment
Share on other sites

Tinkers' Construct don't use the vanilla stack size system. They store their own stack size in the NBT of the

ItemStack

, and draw the stack size in the IItemRenderer they use, so you can do that if you want.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Tinkers' Construct don't use the vanilla stack size system. They store their own stack size in the NBT of the

ItemStack

, and draw the stack size in the IItemRenderer they use, so you can do that if you want.

 

Ohh ok, thanks for the tip. I'm not good with NBT but when I learn that I can give this a try.

 

Thanks once again.

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.