Problem with foods IMPORTANT!

Started by supersamisega on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Problem with foods IMPORTANT!

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!

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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!

Joined Aug 2013
Points:

User statistics:

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

setAlwaysEdible()

Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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

Joined Aug 2013
Points:

User statistics:

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

Is it in the constructor?

Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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 

Joined Aug 2013
Points:

User statistics:

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

Tried "block.setAlwaysEdible();" ?

Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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

 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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);
}

Joined Sep 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • 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

Joined Aug 2013
Points:

User statistics:

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

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

Joined Sep 2015
Points:

User statistics:

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

@#7 It works! Thank you!