Jump to content

How to add food (1.10.2)


starkiller71002

Recommended Posts

I already have an item that is in the game, textured, and has a name. I would like to know how to make it a food item. Can somebody please help me?

Is there a way to turn an item I've already created into a food without completely redoing that item?

 

Console Log:

 

2016-12-07 20:35:47,276 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-12-07 20:35:47,278 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[20:35:47] [main/INFO] [GradleStart]: Extra: []

[20:35:47] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Samuel McClatchey/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --accessToken{REDACTED}, --version, 1.10.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[20:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[20:35:47] [main/INFO] [FML]: Forge Mod Loader version 12.18.3.2185 for Minecraft 1.10.2 loading

[20:35:47] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.8.0_112, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_112\jre

[20:35:47] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[20:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[20:35:47] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[20:35:47] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[20:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:35:47] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:35:47] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[20:35:48] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[20:35:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:35:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[20:35:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[20:35:48] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[20:35:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[20:35:48] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

2016-12-07 20:35:49,422 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-12-07 20:35:49,450 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-12-07 20:35:49,451 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[20:35:49] [Client thread/INFO]: Setting user: Player702

[20:35:52] [Client thread/WARN]: Skipping bad option: lastServer:

[20:35:52] [Client thread/INFO]: LWJGL Version: 2.9.4

[20:35:53] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----

// I just don't know what went wrong :(

 

Time: 12/7/16 8:35 PM

Description: Loading screen debug info

 

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 10 (amd64) version 10.0

Java Version: 1.8.0_112, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 6035341608 bytes (5755 MB) / 6372720640 bytes (6077 MB) up to 6372720640 bytes (6077 MB)

JVM Flags: 3 total; -Xincgc -Xmx6144M -Xms6144M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

Loaded coremods (and transformers):

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 372.90' Renderer: 'GeForce GTX 1080/PCIe/SSE2'

[20:35:53] [Client thread/INFO] [FML]: MinecraftForge v12.18.3.2185 Initialized

[20:35:53] [Client thread/INFO] [FML]: Replaced 231 ore recipes

[20:35:53] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[20:35:53] [Client thread/INFO] [FML]: Searching C:\Users\Samuel McClatchey\Desktop\From the Land\run\mods for mods

[20:35:54] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[20:35:55] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, ftl] at CLIENT

[20:35:55] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, ftl] at SERVER

[20:35:55] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:From the Land

[20:35:55] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[20:35:55] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations

[20:35:55] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[20:35:55] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[20:35:55] [Client thread/INFO] [FML]: Applying holder lookups

[20:35:55] [Client thread/INFO] [FML]: Holder lookups applied

[20:35:55] [Client thread/INFO] [FML]: Applying holder lookups

[20:35:55] [Client thread/INFO] [FML]: Holder lookups applied

[20:35:55] [Client thread/INFO] [FML]: Applying holder lookups

[20:35:55] [Client thread/INFO] [FML]: Holder lookups applied

[20:35:55] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[20:35:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

[20:35:55] [Client thread/INFO] [ftl]: Registered itemgooseberry

[20:35:55] [Client thread/INFO] [ftl]: Register render forgooseberry

[20:35:55] [Client thread/INFO] [FML]: Applying holder lookups

[20:35:55] [Client thread/INFO] [FML]: Holder lookups applied

[20:35:55] [Client thread/INFO] [FML]: Injecting itemstacks

[20:35:55] [Client thread/INFO] [FML]: Itemstack injection complete

[20:35:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: UP_TO_DATE Target: null

[20:35:57] [sound Library Loader/INFO]: Starting up SoundSystem...

[20:35:57] [Thread-8/INFO]: Initializing LWJGL OpenAL

[20:35:57] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[20:35:57] [Thread-8/INFO]: OpenAL initialized.

[20:35:58] [sound Library Loader/INFO]: Sound engine started

[20:36:00] [Client thread/INFO] [FML]: Max texture size: 16384

[20:36:00] [Client thread/INFO]: Created: 16x16 textures-atlas

[20:36:01] [Client thread/INFO] [ftl]: Initialize

[20:36:01] [Client thread/INFO] [FML]: Injecting itemstacks

[20:36:01] [Client thread/INFO] [FML]: Itemstack injection complete

[20:36:01] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[20:36:01] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:From the Land

[20:36:02] [Client thread/INFO]: SoundSystem shutting down...

[20:36:03] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[20:36:03] [sound Library Loader/INFO]: Starting up SoundSystem...

[20:36:03] [Thread-10/INFO]: Initializing LWJGL OpenAL

[20:36:03] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[20:36:03] [Thread-10/INFO]: OpenAL initialized.

[20:36:03] [sound Library Loader/INFO]: Sound engine started

[20:36:05] [Client thread/INFO] [FML]: Max texture size: 16384

[20:36:05] [Client thread/INFO]: Created: 512x512 textures-atlas

[20:36:05] [Client thread/WARN]: Skipping bad option: lastServer:

[20:36:06] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id

[20:36:08] [Client thread/INFO]: Stopping!

[20:36:08] [Client thread/INFO]: SoundSystem shutting down...

[20:36:08] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

Link to comment
Share on other sites

extend ItemFood

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

extend ItemFood

 

Well I'm new to java so I just added this to my ItemGooseberry, but it creates an error

 

public class ItemGoosberry extends ItemFood {

Learn Java then come back, we are not here to teach Java.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

You can also declare the ItemFood straight off without making a new class like so in preInit()

 

public static final Item GooseB = new ItemFood(1, 0.3F, false);

 

Registry.register(GooseB);

 

1 = heal amount

0.3F = saturation

false = if this food is something that wolves love

 

 

In fact I always create helper generic classes that I re-use for multiple objects rather than create 1 class per object. Also the wolves food thing is kinda silly. They could have done that using an enum or array or some other external data set/array. Simply check if food is listed there and return true. Is a bit overkill but ok. That's how is done that's how we have to do it.

 

 

If you don't know what preInit is then you need to read how to set up your mod and how proxies  work ;D good luck

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

Link to comment
Share on other sites

You can also declare the ItemFood straight off without making a new class like so in preInit()

 

public static final Item GooseB = new ItemFood(1, 0.3F, false);

 

Registry.register(GooseB);

 

1 = heal amount

0.3F = saturation

false = if this food is something that wolves love

 

 

In fact I always create helper generic classes that I re-use for multiple objects rather than create 1 class per object. Also the wolves food thing is kinda silly. They could have done that using an enum or array or some other external data set/array. Simply check if food is listed there and return true. Is a bit overkill but ok. That's how is done that's how we have to do it.

 

 

If you don't know what preInit is then you need to read how to set up your mod and how proxies  work ;D good luck

 

you mean food is a separate thing than items? I created the gooseberry as an item. I can't just add a line of code and import something to give it special effects to become a food?  :(

Link to comment
Share on other sites

Well, yes "food" as a concept is separate from items. You could make a block that feeds the player (in fact vanilla has it: cake). You can also make an edible item without extending ItemFood, but then you have to do all the code for the eating animation and so on by yourself. If you extend ItemFood you can reuse the code Mojang has already written.

 

:( darnet, I have to redo all of my code, and there is no tutorials on how to make food in 1.10.2

Link to comment
Share on other sites

You can also declare the ItemFood straight off without making a new class like so

 

public static final Item GooseB = new ItemFood(1, 0.3F, false);

 

Tada!

A working example.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Yeah making a new food is not that hard, everyone has said extend ItemFood or what have you, just like if I wanted to make a new sword. I can just extend itemSword, axe or pick itemTool? hoe itemHoe? just have to extend the correct base.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.