Problem with foods IMPORTANT!

Started by supersamisega on Fri, 04/01/2016 - 01:03

Topic category: Help with modding

Last seen on 02:50, 27. May 2020
Joined Oct 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Problem with foods IMPORTANT!
Fri, 04/01/2016 - 01:03

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!

Last seen on 19:18, 15. Apr 2016
Joined Mar 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
I dont think there is a
Fri, 04/01/2016 - 08:43

I dont think there is a option that you can eat is if you doesnt hungry!

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
setAlwaysEdible()
Fri, 04/01/2016 - 12:13

setAlwaysEdible()

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
RE:setAlwaysEdible()
Fri, 04/01/2016 - 19:28

@#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

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Is it in the constructor?
Fri, 04/01/2016 - 19:50

Is it in the constructor?

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
RE:Is it in the constructor?
Fri, 04/01/2016 - 20:04

@#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 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Tried "block.setAlwaysEdible(
Fri, 04/01/2016 - 20:11

Tried "block.setAlwaysEdible();" ?

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
RE:Tried "block.setAlwaysEdible(
Fri, 04/01/2016 - 20:20

@#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 symbol
block.setAlwaysEdible();
     ^
  symbol:   method setAlwaysEdible()
  location: variable block of type Item
1 error

 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
And this one?static{block =
Fri, 04/01/2016 - 20:55

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

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
RE:And this one?static{block =
Fri, 04/01/2016 - 21:31

@#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

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
So put it after "super(par2,
Fri, 04/01/2016 - 22:03

So put it after "super(par2, par3, par4);"

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
RE:So put it after "super(par2,
Sat, 04/02/2016 - 10:50

@#7 It works! Thank you!