Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

crischu

Members
  • Joined

  • Last visited

  1. I just want to add NBT data to the item stacks and it would help keep the abstraction I have going on in my code to have a method where I can place an itemstack instantiation method. It would also work to override a method that creates the default NBT data of the item if there is such a thing.
  2. Item.onCreated gets called only when the item is crafted. Is there a similar method that gets called when the item instance is created, so that it gets called when a mob drops it or you grab the item on creative, etc? If not, how would one go about achieving the same goal through other methods?
  3. Great, that worked! But the result of the crafting is minecraft:air instead of the IRecipe.getCraftingResult return.
  4. This is the code https://github.com/crisdesivo/Elemental_Chaos, a lot of stuff is unused, I'm just trying stuff to see what works and what doesn't. The recipe I'm interested in is in com.example.elementalchaos.elementalItems.recipes.RechargeRecipe.java, the registration code is in RegistryHandler, the JSON is com.example.elementalchaos.elementalItems.recipes.recharge.json, and the serializer is defined at com/example/elementalchaos/elementalItems/recipes/ModRecipes.java
  5. That's the same id as my recipe so that's not working for me, it's an invalid recipe type.
  6. So how should the JSON look like then? Mine looked like: { "type": recipeid } where recipe id is the one specified in IRecipe.getId. And removing the type raises "com.google.gson.JsonSyntaxException: Missing type, expected to find a string"
  7. I tried, but it is not recognizing my recipe type, I get "Invalid or unsupported recipe type" error message. How do I point to my recipe from the json if the recipe type I used is just IRecipeType.CRAFTING?
  8. Thank you. And once I defined my recipe class how do I register it in the game?
  9. I can't seem to find any examples of this, I'm guessing the ingredient list now goes in the "match" function of IRecipe, but most of the methods I wouldn't know how to complete, namely IRecipe.getId, IRecipe.getSerializer, IRecipe.getType, and the methods of IRecipeSerializer. I think I'd need to see a minimal working example of these classes implemented.
  10. The method I'm using to add recipes is creating json files as recommended. However this method doesn't seem ideal for working with "dynamic" recipes (meaning recipes that depends on the ingredients). How would you register recipes in a way that lets you access the ingredients' information and edit the result appropriately? Edit: There is probably a guide somewhere for this, but can't find it for this version. If anyone can provide a link that would be more than enough. Thanks!
  11. I guess I's impossible then, thanks for your help.
  12. Interesting, what's the method to overwrite? I didn't find much documentation about how to check events, for example, how does one check if the event is water freezing versus for example a player placing an ice block on a water source? or an ice block generating on a water source in other way?
  13. crischu joined the community
  14. I'd like to add a chance of a block spawning every time a water source turns into ice. I check but there is no event to listen to this in the current version. Does anyone know if this would be possible?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.