Started by
Yuranga0
on
Topic category: Help with Minecraft modding (Java Edition)
I need to when using the item on the cauldron, this item turns into another object, with a portion of the water in the boiler should be spent, as when you wash off the dye from leather armor.
How can this be implemented?
Don´t think you can do this on MCreator yet but here´s the code that removes color from the armor.
if (i > 0 && item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER && itemarmor.hasColor(itemstack) && !worldIn.isRemote)
{
itemarmor.removeColor(itemstack);
this.setWaterLevel(worldIn, pos, state, i - 1);
playerIn.addStat(StatList.ARMOR_CLEANED);
return true;
}
}
Yep, not doable without custom code. Cauldrons use a "level" block state which determines how much water is inside it (a number between 0 and 3). However, MCreator doesn't really support block states (yet), so you can't use procedure blocks alone. What you'd need to do is:
How?
It should be doable with procedures ("On item right-click on block") if you use custom code blocks. Tomorrow I'll try to see how it can be implemented. A sample code could be:
(keep in mind I can't test or recompile this right now, so it might not work!)
(small mistake on my side, but it shouldn't affect the code at all). You can replace the line
with this one, which is shorter and cleaner:
There is this tutorial from SomeoneElse :
https://mcreator.net/forum/54347/tutorial-how-use-cauldrons-procedures
Thanks for linking the tutorial! I made it specifically to answer this post, but forgot to link it here