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.

drok0920

Forge Modder
  • Joined

  • Last visited

Everything posted by drok0920

  1. Hello, I have finally gotten a custom json recipe to work for my mod. However i still cant figure out how to change the nbt of the result based on the ingredients used. For example i have a custom nbt tag on the items being used in the recipe and i need to average those values and determine the result based on that. I hope this made sense. Any help would be appreciated.
  2. Hello, A while back I asked about registering an IRecipe. I was told that it is better to use a custom recipe type and was pointed to this post. I have taken a look into it but i am very confused by it. I don't know how i can get it to work the way i need it to. I need the result to not only be based off of what is in the json file but also the nbt of the items used in the recipe. As i said i have no idea how to accomplish this and would appreciate any help.
  3. So would this be correct: { "display": { "icon": { "item": "minecraft:stick" }, "title": "Sticks and Stones", "description": "Find your first basic materials scattered around your world." }, "parent": "poverhaul:stoneage/sticks_and_stones", "criteria": { "rock": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "poverhaul:rock" }, { "type": "poverhaul:quality", "quality": 1 } ] } } } } Edit: I got a chance to test it and it works great. Thank you for all your help!
  4. So i think i have gotten it to work but would this be how i use the predicate: { "display": { "icon": { "item": "minecraft:stone" }, "title": "Stone Age", "description": "Hunter - Gatherers" }, "criteria": { "tick": { "trigger": "modid:predicateregistryname" { "item": "poverhaul:rock", "quality": 1 } } } } Assuming that my predicate class is the fallowing: package net.drok.poverhaul.predicate; import javax.annotation.Nullable; import com.google.gson.JsonObject; import net.drok.poverhaul.ModRegistry; import net.drok.poverhaul.item.ItemRock; import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.JsonUtils; public class ItemQualityPredicate extends ItemPredicate { private final Item item; private final Integer quality; public ItemQualityPredicate(JsonObject jsonObject) { this(JsonUtils.getItem(jsonObject, "item"), JsonUtils.getInt(jsonObject, "quality")); } public ItemQualityPredicate(@Nullable Item i, int q) { this.item = i; this.quality = q; } @Override public boolean test(ItemStack stack) { if(this.item != null && stack.getItem() == this.item) { ItemRock rock = (ItemRock) ModRegistry.rock; int q = rock.getQuality(stack); if(q >= this.quality) { return true; } } else if(stack.getItem() == this.item) { ItemRock rock = (ItemRock) ModRegistry.rock; int q = rock.getQuality(stack); if(q >= this.quality) { return true; } } return false; } }
  5. How do i use the register method? It asks for a function what should i give it?
  6. Not trying to be pushy but i still haven't fixed the issue. How do i register the predicate?
  7. There is no register method in ItemPredicate either.
  8. Eclipse is saying that ItemPredicates is not a class so i am unable to register it. Is it called something else now?
  9. What is an item predicate and how do i use one.
  10. Can you explain a bit more? Im confused.
  11. Well i was hoping to have that as one requirement and another requirement if possible. But if this is the only way to do it other than making a custom trigger or something then i will just split the advancement in half.
  12. Hello again, I have finally gotten my advancements to work but now i need a functionality that im not sure exists. I have an item that has an integer stored in its nbt and i would like my advancement to trigger when it is above a certain value. Under some circumstances i could just list every number above the number i want but since the number can range from 0 to 100 that would not be reasonable. So my question is how can i trigger the advancement when said value is greater than a certain amount.
  13. Thank you for the help. The reason i have to use an IRecipe is because i need to set the NBT of the output based on the input
  14. Hello, After rebuilding my workspace to version 1.12-14.21.1.2443 to fix a previous issue of mine, I have found that i can no longer use GameRegistry#register to register my IRecipes. What is used to register them now?
  15. Yes that fixed it i just had to use the setupDecompWorkspace command and then the eclipse command.
  16. Im going with i found the problem as there is no method called loadAdvancements in ForgeHooks. Why is this and how can i fix it. Do i just rebuild my work space?
  17. This is really weird. I put the error back in to see if i would get it and i dont. I refreshed the project in eclipse and created a new world just in case. Are you sure that it auto loads them from the assets? This is my log maybe i am missing something: I have no idea why its not loading them at all. Is my forge version bugged? My build.gradle version is 1.12-14.21.1.2443
  18. Can you show me your error log because i have added a description and they are still not loading and i dont see any errors almost as if they are not being seen at all.
  19. Ok well i have my two advancements in the advancements folder and they do not get loaded and i do not see an error in the console. I have attached the two files. rocks.json breath.json EDIT: I removed the stray comma and i still dont have any advancements added to the game.
  20. Ok thank you i will change that now. But how do I create a new tab? Will it auto create it and if so how do i name it or set the icon. Also is it possible to use sub folders for organization?
  21. Thank you so much for your help but i have one last question. I have put my advancement in a sub folder of advancements and it isnt loading. There is no error so i would assume it only loads from the advancements folder and not its sub folders. If this is the case how can i put my advancements in separate or custom tabs? Edit after some experimentation even advancements located in advancements and not a subfolder still dont load. No error is logged. Here is my advancement: { "display": { "icon": { "item": "poverhaul:rock" }, "title": "Leave No Stone Unturned" }, "parent": "", "criteria": { "rock": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "poverhaul:rock" } ] } } } }
  22. I dont know exactly but maybe keep track of all connected machines and wires then everytime one is updated/changed use A* pathfinding to find the path from every producer to every consumer. Its just an idea i dont know how efficient it would be or if its even possible. For example every set of connected machines would be stored as a network and everytime the network changes you would recalculate the paths. I would assume you would want to do it asynchronously as to prevent lag with large networks.
  23. One last question. Where would i find the WorldServer instance.
  24. Ok i forgot that Y is up not Z but how would i use TRSRTransformations.

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.