Minecraft Version: 1.8.x Requires: Forge 1.8 - 11.14.4.1563 or higher Forge Version Info:
Confirmed to run on the following Forge versions: 1.8 - 11.14.4.1563 1.8.8 - 11.15.0.1655 (compatible with Optifine!) 1.8.9 - 11.15.1.1722 1.8.9 - 11.15.1.1764
This very simple mod makes Mushroom Stew and Rabbit Stew stackable to 16.
Enjoy the stew!
Installation:
Installing Forge:
Go to minecraftforge and find version 1.8-11.14.4.1563 or 1.8.8-11.15.0.1655, or later (1.8.x only).
Download the installer.
Run the installer and install the client.
Run Minecraft once after installing Forge (this creates the 'mods' folder, among other things)
Installing the mod:
Download the mod file.
Open your .minecraft directory and place the mod file in the 'mods' folder.
Done!
Client/Server Info:
This mod will work on a client (SP) and on a server (MP). Any client connecting to a server using this mod must have the mod installed in order to connect.
I won't be making any further versions of this mod for publication. The same goes for the other mods I've published.
However, I would be willing to share how I've made these mods work with anyone who is interested in making thier own version of them (send me a private message or ask in the corresponding thread).
The Stackable Stews mod is simple enough that I can write instructions on how to make it right here.
Making a Stackable Stews Mod:
First, you need to get yourself set up with a basic Forge modding environment for the Minecraft version you want to mod.
I followed MrCrayfish's tutuorial for 1.8 on YouTube. Search for: Minecraft 1.8: Modding Tutorial - Episode 1 - Getting Started!
Later versions of minecraft will likely be similar, but you may want to look up a tutorial specific to your version.
Once you've got that set up (a fair bit of work and learning if you've never done it before), you can start building the mod.
If you've done any Minecraft modding before, this should be a breeze.
This sets the stack size for the specified item to whatever stewStackSize is. So replace stewStackSize with whatever you want the stack size to be (no greater than 64).
If I was to release an updated version of the Stackable Stews mod, I would make them stack to 64. I played a bit with a stack size of 16 and it was still barely worth carrying them around. 64 puts them more on par with other foods.
If you want to change the stack size of other items as well, you can add additional lines like the ones above, replacing the item's variable name with the item you want to change. A full list of the correct item variable names can be found in the Items class in the forge source library.
But... be aware that some items may behave oddly if you adjust thier stack size. This is the case with stews. They are intended to be single-use items that are replaced with an empty bowl after use, so when one is used it will replace the entire stack with an empty bowl regardless of how many are in the stack. Not what we want!
So... we need to use a forge hook to bypass this behaviour and make it only replace the stack with an empty bowl when the stack is empty (it's actually reasonably simple to do this).
Bypassing The Default Stew Stack Behaviour Using a Forge Hook:
Jabelar kindly posted a detailed wirteup on Event Handling here. Check it out for an overview of forge hooks if you're not familiar.
Then create a new class called PlayerUseItemHandler (or whatever you want to call it, so long as it matches the name in the registration method above) and put the following code into that class:
@SubscribeEvent
public void onUseFinish(PlayerUseItemEvent.Finish event)
{
ItemStack itemstack = event.item;
EntityPlayer player = event.entityPlayer;
if(itemstack.getItem() == Items.mushroom_stew || itemstack.getItem() == Items.rabbit_stew)
{
if (!player.capabilities.isCreativeMode)
{
if (itemstack.stackSize <= 0)
{
event.result = new ItemStack(Items.bowl);
return;
}
player.inventory.addItemStackToInventory(new ItemStack(Items.bowl));
}
event.result = itemstack;
}
}
This tells Minecraft to only replace the stack with an empty bowl if the stack size is <= 0. Otherwise, it places an empty bowl in an empty slot in your inventory instead.
If you want to make this work with other types of stews, you need to add another condition in the first if statement for each type of stew you are adding. For instance: itemstack.getItem() == Items.beet_stew
Again, you will need to look up the correct variable name in the Items class.
This works like a charm in 1.8, but it may require some changes to work with other versions and with new types of stews (that's for you to test and figure out). If the new stews use the ItemSoup class everything should work fine.
I'm sure there are many other ways to put this code together that would work just as well, if not better. This is just one way to do it.
If you have any questions feel free to ask. However, know that I know nothing about how Minecraft 1.8 is different from any other version. I've only ever modded 1.8.
I hope someone uses this information to make a Stackable Stews mods for other versions of Minecraft. Stews are pretty much useless if they don't stack and it would be nice if everyone could have useful stews.
Minecraft Version: 1.8.x
Requires: Forge 1.8 - 11.14.4.1563 or higher
Forge Version Info:
1.8 - 11.14.4.1563
1.8.8 - 11.15.0.1655 (compatible with Optifine!)
1.8.9 - 11.15.1.1722
1.8.9 - 11.15.1.1764
Download Stackable Stews from CurseForge
Description:
This very simple mod makes Mushroom Stew and Rabbit Stew stackable to 16.
Enjoy the stew!
Installation:
Installing Forge:
Installing the mod:
Done!
This mod will work on a client (SP) and on a server (MP). Any client connecting to a server using this mod must have the mod installed in order to connect.
Thanks go out to:
Neale Gaming
MrCrayfish
BedrockMiner
Jabelar
Beetroot soup support!
Could you please update this and the potions mod to 1.10 along with beetroot?
I won't be making any further versions of this mod for publication. The same goes for the other mods I've published.
However, I would be willing to share how I've made these mods work with anyone who is interested in making thier own version of them (send me a private message or ask in the corresponding thread).
The Stackable Stews mod is simple enough that I can write instructions on how to make it right here.
Making a Stackable Stews Mod:
First, you need to get yourself set up with a basic Forge modding environment for the Minecraft version you want to mod.
I followed MrCrayfish's tutuorial for 1.8 on YouTube. Search for: Minecraft 1.8: Modding Tutorial - Episode 1 - Getting Started!
Later versions of minecraft will likely be similar, but you may want to look up a tutorial specific to your version.
Once you've got that set up (a fair bit of work and learning if you've never done it before), you can start building the mod.
If you've done any Minecraft modding before, this should be a breeze.
Adjusting The Stack Size:
Put the following code in your preInit method:
This sets the stack size for the specified item to whatever stewStackSize is. So replace stewStackSize with whatever you want the stack size to be (no greater than 64).
If I was to release an updated version of the Stackable Stews mod, I would make them stack to 64. I played a bit with a stack size of 16 and it was still barely worth carrying them around. 64 puts them more on par with other foods.
If you want to change the stack size of other items as well, you can add additional lines like the ones above, replacing the item's variable name with the item you want to change. A full list of the correct item variable names can be found in the Items class in the forge source library.
But... be aware that some items may behave oddly if you adjust thier stack size. This is the case with stews. They are intended to be single-use items that are replaced with an empty bowl after use, so when one is used it will replace the entire stack with an empty bowl regardless of how many are in the stack. Not what we want!
So... we need to use a forge hook to bypass this behaviour and make it only replace the stack with an empty bowl when the stack is empty (it's actually reasonably simple to do this).
Bypassing The Default Stew Stack Behaviour Using a Forge Hook:
Jabelar kindly posted a detailed wirteup on Event Handling here. Check it out for an overview of forge hooks if you're not familiar.
First, you'll need to register a new forge hook.
Put the following code in your init method:
Then create a new class called PlayerUseItemHandler (or whatever you want to call it, so long as it matches the name in the registration method above) and put the following code into that class:
This tells Minecraft to only replace the stack with an empty bowl if the stack size is <= 0. Otherwise, it places an empty bowl in an empty slot in your inventory instead.
If you want to make this work with other types of stews, you need to add another condition in the first if statement for each type of stew you are adding. For instance: itemstack.getItem() == Items.beet_stew
Again, you will need to look up the correct variable name in the Items class.
This works like a charm in 1.8, but it may require some changes to work with other versions and with new types of stews (that's for you to test and figure out). If the new stews use the ItemSoup class everything should work fine.
I'm sure there are many other ways to put this code together that would work just as well, if not better. This is just one way to do it.
If you have any questions feel free to ask. However, know that I know nothing about how Minecraft 1.8 is different from any other version. I've only ever modded 1.8.
I hope someone uses this information to make a Stackable Stews mods for other versions of Minecraft. Stews are pretty much useless if they don't stack and it would be nice if everyone could have useful stews.