Started by
supersamisega
on
Topic category: Help with Minecraft modding (Java Edition)
When i make a food and test it on my test world, you have to be hungery to eat it.
Can there PLEASE be a option to set the food as a enchanted golden apple that you DONT have to be hungry for?
This will really help my mod.
Can you fix that please? Thanks!
I dont think there is a option that you can eat is if you doesnt hungry!
setAlwaysEdible()
@#2 Help!
C:\Pylo\MCreator159\forge\build\sources\java\mod\mcreator\mcreator_tppotion.java:115: error: cannot find symbol
setAlwaysEdible();
^
symbol: method setAlwaysEdible()
location: class mcreator_tppotion
1 error
Is it in the constructor?
@#3 I tried to insert it here:
static{block = (Item)(new BlockCustomFood(0, 0.3F, false));block = ((BlockCustomFood)block).setUnlocalizedName("Tppotion").setTextureName("potion")
.setPotionEffect(PotionHelper.redstoneEffect).setCreativeTab(mcreator_storymodetab.tab);block.setMaxStackSize(1);
Item.itemRegistry.addObject(430, "Tppotion", block);
}
but it didn't work
I tried to create new public thing:
public mcreator_tppotion setAlwaysEdible() { this.alwaysEdible = true; return this; }
didn't work either
Tried "block.setAlwaysEdible();" ?
@#4 Yes, I tried that. Then it returned this error:
C:\Pylo\MCreator159\forge\build\sources\java\mod\mcreator\mcreator_tppotion.java:115: error: cannot find symbolblock.setAlwaysEdible();
^
symbol: method setAlwaysEdible()
location: variable block of type Item
1 error
And this one?
static{
block = (Item)(new BlockCustomFood(0, 0.3F, false));block = ((BlockCustomFood)block).setUnlocalizedName("Tppotion").setTextureName("potion")
.setPotionEffect(PotionHelper.redstoneEffect).setCreativeTab(mcreator_storymodetab.tab).setAlwaysEdible();block.setMaxStackSize(1);
Item.itemRegistry.addObject(430, "Tppotion", block);
}
@#5 Umm this is exactly the same string I have in my source code. I tried to insert setAlwaysEdible(), .setAlwaysEdible() and block.setAlwaysEdible() into this string
Here is the full source code of this class: http://pastebin.com/Eh3G60WA
So put it after "super(par2, par3, par4);"
@#7 It works! Thank you!