-
Recently Browsing
- No registered users viewing this page.
-
Posts
-
I made a custom fluid by following guide of Kaupenjoe on YT, but I'm unable to assign it property of waterlogging any non solid blocks, such as slabs, stairc, walls etc. as well as I can't find any sources or guides on how to do it. Here is link to my .github repository, any help is appreciated. https://github.com/AlexOja/Forge_Mod_1.19.2_nikorloss
-
By scientistknight1 · Posted
Can you post your ModBlocks class where you've registered the block, as well as which version of Minecraft you are using? -
By scientistknight1 · Posted
It looks like you're trying to pass the lemon juice item itself to the .food method in your first code snippet; that won't work. The parameter to the .food method needs to be a FoodProperties object, as the error says. The second way you're doing it there is much closer to how it should be. The problem there is that you're trying to access the LEMON_JUICE field of the vanilla FoodProperties class. This won't work because the vanilla food properties class does not have LEMON_JUICE information in it. You'll need to make your own ModFoods class, looking something like the vanilla Foods class. Here's an example: public class ModFoods { public static final FoodProperties LEMON_JUICE = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.25F) .effect(() -> new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 1500), 0.5f).build(); } Then, your completed item registration would be: public static final RegistryObject<Item> LEMON_JUICE = ITEMS.register("lemon_juice", () -> new Item(new Item.Properties().food(ModFoods.LEMON_JUICE))); Notice that I changed the FoodProperties to ModFoods, since that's the class where you'd be storing the food data. -
By drawingmeebo · Posted
For some reason it did not produce a crash log so here is the loading log. Version: 1.20.1 Forge - 47.2.0 https://paste.ee/p/MkmQt#s=0 -
By DroidCrafter23 · Posted
I have corrected the code as you have written it, though there have been errors present in the ModItems class when I have registered the item. (These have been present before but I forgot to mention them 🤦♂️). public static final RegistryObject<Item> LEMON_JUICE = ITEMS.register("lemon_juice", () -> new Item(new Item.Properties().food(ModItems.LEMON_JUICE))); The first error occurs with the ModItems.LEMON_JUICE, the message is as follows: 'food(net.minecraft.world.food.FoodProperties)' in 'net.minecraft.world.item.Item.Properties' cannot be applied to '(net.minecraftforge.registries.RegistryObject<net.minecraft.world.item.Item>)' public static final RegistryObject<Item> LEMON_JUICE = ITEMS.register("lemon_juice", () -> new Item(new Item.Properties().food(FoodProperties.LEMON_JUICE))); The second error occurs with the FoodProperties.LEMON_JUICE, saying: Cannot resolve symbol 'LEMON_JUICE' This should be all that is left to do to finally fix all these errors that has been going on for two weeks now surprisingly.
-
-
Topics
Recommended Posts
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.