Posted May 13, 20187 yr Hi all, I've been reading up on adding advancements in 1.12 and it seems like recommended practices have shifted quite a bit since the first Forge releases. I'm specifically looking for advancements triggered by custom triggers in code, plus maybe some inventory-based ones for a few cases. Is there a good tutorial or model with the clean way of doing this now? Thanks http://www.millenaire.org/img/dynamicsig.png[/img]
May 13, 20187 yr While you can create complex trigger criteria using the JSON, I found it easier to create the criteria in code and cause a simple trigger. To me this is more flexible and bypasses a lot of the hassle of JSON. If you're interested you can look at my tutorial: http://jabelarminecraft.blogspot.com/p/minecraft-modding-advancements.html Check out my tutorials here: http://jabelarminecraft.blogspot.com/
May 13, 20187 yr Author I had actually checked your tutorial, one of the first thing I do for new features I just didn't know if it was up to date to changes in Forge, like that merge of Moar Advancements (if it changes anything to it). I was indeed looking for something code-based, I'm not a big fan of overly complicated JSON triggers. And if I can use this occasion for a small bit of feedback on your very useful tutorials, could you add the date at which a tutorial was written? It's often really useful to know if it's recent or not. http://www.millenaire.org/img/dynamicsig.png[/img]
May 13, 20187 yr Advancement triggers are pretty simple. Thttps://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/api/advancement/FoundOreTrigger.javahat looks like a lot, but its 90% the same across all triggers. You pretty much start with the test() function and work backwards until all the errors are gone. 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.
May 14, 20187 yr Author 20 hours ago, jabelar said: While you can create complex trigger criteria using the JSON, I found it easier to create the criteria in code and cause a simple trigger. To me this is more flexible and bypasses a lot of the hassle of JSON. If you're interested you can look at my tutorial: http://jabelarminecraft.blogspot.com/p/minecraft-modding-advancements.html Hi jalebar, I was going through your tutorial again because your generic trigger mechanism would be perfect for my needs, but the code you posted in your tutorial is broken, it even has syntax errors (maybe encoding issues), for example: private final Set> listeners = Sets.>newHashSet(); I could fix quite a lot of them with a bit of guesswork but not all. Would it be possible for you to post the actual class? Thanks! http://www.millenaire.org/img/dynamicsig.png[/img]
May 14, 20187 yr Author Never mind, I should have tried first, got the class via a google search. http://www.millenaire.org/img/dynamicsig.png[/img]
May 14, 20187 yr 6 hours ago, Kinniken said: Hi jalebar, I was going through your tutorial again because your generic trigger mechanism would be perfect for my needs, but the code you posted in your tutorial is broken, it even has syntax errors (maybe encoding issues), for example: private final Set> listeners = Sets.>newHashSet(); I could fix quite a lot of them with a bit of guesswork but not all. Would it be possible for you to post the actual class? Thanks! Where exactly are you seeing these errors? When I look at it in my browser the code doesn't have the encoding issues you're showing, plus I have all the imports in the code so you shouldn't have to guess at any class. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
May 15, 20187 yr Author On this page: http://jabelarminecraft.blogspot.fr/p/minecraft-modding-custom-triggers-aka.html I'm using the latest version of Firefox. http://www.millenaire.org/img/dynamicsig.png[/img]
May 15, 20187 yr It's because the HTML conversion fucked up: <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> private final Set<icriteriontrigger .listener="" ustomtrigger.instance="">> listeners = Sets.<icriteriontrigger .listener="" ustomtrigger.instance="">>newHashSet();</icriteriontrigger></icriteriontrigger> </span> You can see what bits were there to start with, but which got converted to HTML tags instead. 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.
May 15, 20187 yr 1 hour ago, Draco18s said: It's because the HTML conversion fucked up: <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> private final Set<icriteriontrigger .listener="" ustomtrigger.instance="">> listeners = Sets.<icriteriontrigger .listener="" ustomtrigger.instance="">>newHashSet();</icriteriontrigger></icriteriontrigger> </span> You can see what bits were there to start with, but which got converted to HTML tags instead. Yeah, I'll need to look at that. Looks like the generic angle brackets are confusing it. Thanks for pointing it out. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.