Jump to content

DroidCrafter23

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by DroidCrafter23

  1. I have managed to implement your code after finally managing to sort out my error with exporting to .zip, though when the game launches, it will not allow me to proceed further and gives this error: Caused by: java.lang.IllegalArgumentException: Duplicate registration orange I have checked over my code and no errors or warnings are present that would affect my orange item. I am not sure what to do here. (It is only registered in the ModItems, as it should be).
  2. I am wanting to export my mod to a .zip file in IntelliJ version 2024.1 but cannot. I am not sure what to do, the only options available to me are "Files or selection to HTML" and "Project to eclipse." A possible theory I have is that IntelliJ believes that my mod is a HTML file, though I am not sure whether I could change that or not. There is nothing I have found online about the missing zip option for exporting a file, so I am confused. I export a backup of my mod every time I add/edit something important, though I don't think I can do this currently. (I have tried to export as HTML though I did not think it would work).
  3. I shall look into this soon, as I am currently quite busy. I just realised that I put in ModItems when I meant ModFoods, so that part would be correct, it is just my mistake...
  4. 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.
  5. I have done this now but have got the error: '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 HoneyBottleItem.Properties().stacksTo(1).food( (new FoodProperties.Builder()) .nutrition(3) .saturationMod(0.25F) .effect(() -> new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 1500), 0.01f ) .build() ) )); The code above is from the ModFoods class, the one below from the ModItems class. public static final RegistryObject<Item> LEMON_JUICE = ITEMS.register("lemon_juice", () -> new Item(new Item.Properties().food(ModFoods.LEMON_JUICE))); I shall keep going between them to try and figure out the cause. I am sorry if this is too much for you to help with, though I thank you greatly for your patience and all the effort you have put in to help me.
  6. I have been following these exact tutorials for quite a while, I must agree that they are amazing and easy to follow. I have registered the item in the ModFoods class, I tried to do it in ModItems (Where all the items should be registered) but got errors, I think I may need to revert this and figure it out from there. Once again, thank you for your help! ๐Ÿ‘ Just looking back, I have noticed in your code you added ITEMS.register, which I am guessing means that they are being registered in ModFoods, I shall go through the process of trial and error to figure this out.
  7. UPDATE: I have scanned again and have got two new errors, of which I am not sure about. Caused by: java.io.EOFException: SSL peer shut down incorrectly Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake I have looked at the scan, though I am not sure what exactly I am looking for. (IntelliJ recommended to find the stacktrace so I could link it if necessary).
  8. I have recently received support for my upcoming mod, which I have implemented but have received multiple errors giving the same output. I am not sure what to do as I have found out the meaning of java.lang.IllegalStateException and java.lang.ExceptionInInititializerError, though this has not helped me in the slightest! I have performed scans though I am still not sure... Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegisterEvent has been fired. (3x) Caused by: java.lang.ExceptionInInitializerError (2x)
  9. Thank you so, so much for your help! I have implemented the code from the example you gave me and it has been excepted, the only downside currently being that the game crashes on launch, saying: Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegisterEvent has been fired. (Three times) and Caused by: java.lang.ExceptionInInitializerError (Two times) With further scanning I have found this error: 2024-05-05T18:41:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] I am not exactly sure what to do with these errors but I am sure I can resolve them. Once again, thank you for your help! It is much appreciated. ๐Ÿ˜
  10. Are you playing with mods? This usually happens to me when certain mods clash. I would recommend looking through the game logs (found in the file of the modpack) to see what errors have occurred. I hope this helps!
  11. For the HoneyBottleItem class, would I just copy/paste my Lemon Juice item into the class or would I have to make other changes? Also, for what you first said, I have copied the "getEatingSound" and the "getDrinkingSound" from the class into my ModFoods class (I could link the whole class if that would help you understand more), though nothing seems to have been done. I also do not see a way to prevent particles from appearing when the item is drank. (Could you also post some examples if possible, that would be a great help to see where I went wrong). I am at a point where I am quite clueless as the tutorials on YouTube do not cover the area I am needing to go into. I do hope that this is not too much of a bother for you.
  12. I have been working on my mod for some time now and I am wanting to add a drink item, I am new to modding and am currently self teaching myself java as I follow tutorials. I am hoping that the code would not need a massive reworking. public static final FoodProperties LEMON_JUICE = new FoodProperties.Builder().nutrition(3) .saturationMod(0.25f).effect(() -> new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 1500),0.01f) .effect(() -> new MobEffectInstance(MobEffects.CONFUSION,200),1).build(); In game the lemon juice acts like a food, making eating audio and creating particles. For the audio I would like to use the honey drinking sound. How would I get this to work as I am wanting it to?
×
×
  • Create New...

Important Information

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