Hello and welcome back to episode three in this tutorial series where i will be walking you through datapack creation in the last video we took a look at how to create custom recipes for your world in today’s video we will be covering advancements how they work and what you Can do with them but before that i need to talk about what an advancement is an advancement is an event that is triggered by completing specific tasks or meeting specific criteria in-game there are many criterias you can use to trigger these events and i’ll try to Explain each one but i may gloss over a few by mistake and you’ll probably want to do some testing on your own and all honestly i openly invite you to do so in my opinion there’s no better way to learn how to do these things than to Mess around and test it yourself so go for it the file format for an advancement is a lot longer than any of the recipe files we created in the last episode today i’m going to go through the file format and explain each individual part and then go over criterias requirements and rewards So let’s get to it in the examples we’re going to be doing today we will be starting by creating a new page in the advancements menu by creating our root advancement followed by creating an advancement linked to the root then creating an advancement linked to an already existing minecraft advancement And then creating an advancement that doesn’t display at all for our player the last type of advancement is really important in some cases for datapack creators but we’ll get into that later for now let’s create our new advancement route to start a new page let’s start Off by creating a new folder in our namespace folder called advancements inside of this advancements folder create a new folder and name it whatever you want this page to be for for example all of the end related advancements are in a folder called end and all another related advancements are in a folder Called nether in this case i’m going to name my folder test please note that this step is unnecessary but is recommended to keep everything organized especially if you plan on having more than one page created in the advancements menu inside of the folder go ahead and create a new json file and Name it root.json go ahead and open that on up and we can start creating it like all json files we’ll start off with our first set of curly brackets the first section of this file is the display section this section determines everything visible to the player for this advancement you start with the Keyword display followed by a colon and a set of curly brackets inside of these curly brackets we will add the keyword icon followed by a colon and another set of curly brackets inside of here we will include the keyword item followed by a colon and the item you want to represent This page an example of this is in the adventure tab in the vanilla minecraft advancements is minecraft colon map for our example i’m going to set my item to use a diamond x so i’m going to put minecraft colon diamond underscore x the icon also accepts nvt data to Further customize this item icon in this example i’m going to put a comma after minecraft colon diamond underscore axe and on the next line i will put nbt followed by a colon and a set of quotes to make a new string inside of the string i am going to Include a set of curly brackets followed by enchantments colon followed by a set of square brackets with curly brackets inside of them Inside of these curly brackets i will put lvl for level colon 1s with a lowercase s comma id colon and then enchantment backslash and then in quotes minecraft colon mending ending backslash ending quote this is going to do two things for our advancement page it will create the icon Used to label the page for our advancement and we’ll also set the icon used for the first advancement in that page and in this case the icon will be an enchanted diamond x next we can set up the title for this page after the curly brackets for the icon put a comma And on the next line use the keyword title followed by a colon and a set of curly brackets inside of these curly brackets put text followed by a colon and a string of text for what you want the title to be an example of this in the adventure page title is just Adventure in this example i’m going to call mine betrayal we can also set the formatting on this text with text formatting we can set the color using two different methods both start with the color keyword followed by a colon the first method has the colon followed by a string with the color name There are 17 valid color names you can use such as black dark underscore blue dark underscore green dark underscore aqua dark understory red dark underscore purple gold gray dark underscore gray blue green aqua red light underscore purple yellow white and reset the second method has the Colon followed by a string with a number symbol followed by the hexadecimal value of the color for example the hexadecimal value of the number sign ff000 is red we could also set the text to be bold by including the bold keyword followed by a colon and the word true we Can set the text to italic by including italic followed by a colon in the word true we could do the same for it underline and obfuscated which will make the text look like it’s glitching personally i’m going to leave mine as just bold underneath the title section we can set Up another section called description this is the text that will display with the advancement we can format this the same way we can format the title it takes a text for whatever the description says in this case i’m putting how could you do this we could also set other formatting Settings like the color which i’m going to be setting to blue and i’ll also set it to italics as well after description we can begin setting up the rest of our display settings the next thing we’re going to change is the frame type of this advancement the frame Is the shape of the advancement in the menu there are three frames we can use challenge which is used for the fancy spiked border goal which is used for the rounded border and task is used for the standard square border to set this up let’s add a comma after the description Section on the next line add in frame followed by colon and either challenge goal or task next we can set up the advancements to either display on the player screen or not when they achieve it most root advancements do not do this but if you would like the player to know They have unlocked a new page we can set it up with the following after the frame section add a comma and on the next line we’ll add show underscore toast followed by a colon and the word true and to announce it to the chat we’ll add a Comma after that with the new line underneath we’ll add announce underscore to underscore chat followed by a colon and the word true this will announce it to the chat when a player unlocks this advancement for root advancements this is usually false we can set whether or not to hide this Advancement until it’s unlocked this has no effect on the route advancement since they only show the page when they become unlocked however their children can use this to stay hidden until they are unlocked we can do this by using the hidden keyword followed by a colon and The word true this next part is only used by root advancement and doesn’t have any effect on the advancements that stem from this first one and that’s background background uses a texture from resources to determine what the background of the page is for example the background for the adventure page is minecraft colon Textures slash gui advancements slash backgrounds slash adventure.png we could actually use any texture in our resources to use as our background as long as we have the file location for example if we wanted our background to be another right blocks we can set our background to be minecraft colon Textures slash block slash netherrite underscore block.png this concludes the display portion of our advancement next we can begin to set up the criteria for how this advancement is earned we will use the keyword criteria followed by a colon and a set of curly brackets we can have as many Criteria as we want for our advancement however we must specify each one as its own criteria name inside of the curly brackets for criteria you’ll put the name of your criteria in my example i will name it killed underscore iron underscore golem but you can name it whatever you want This will be followed by a colon and a set of curly brackets inside of the curly brackets we need to specify the trigger event there are 45 trigger events and while i would love to explain them all in this episode i don’t think that would be practical so i’ll Save them for a future episode and just leave a link in the description for where to find the triggers and what their setup looks like i normally use the minecraft fandom wiki for the advancement json format to find the list of triggers in this case i’m going to use minecraft Colon player underscore killed underscore entity trigger so inside of my criteria killed underscore iron underscore golem i’ll put trigger followed by a colon and then the trigger minecraft colon player underscore killed underscore entity this trigger is only activated when a player kills an entity however we haven’t specified what entity Needs to be killed after we set the trigger we need to enter the keyword conditions followed by a colon and the set of curly brackets the player killed entity trigger takes three optional parameters entity or the entity being killed killing underscore blow what was used to kill the entity And the player or the player that killed the entity leaving one out means that anything works to match that part of the condition for example leaving entity blink means that this will work on any entity leaving killing underscore blow blank means this will work with any item Being used to kill the entity including your hand leaving player blank means that player doesn’t need to meet any specific traits stats or conditions when setting up the entity we will add the entity keyword to our conditions followed by a colon and a set of curly brackets Inside of these curly brackets we can set the type tag followed by a colon and a string representing the entity type in my example this is going to be minecraft colon iron underscore golem we can also set the nvt requirements using the keyword nbt followed by a Colon and a string with the nbt data i’ll be using the nbt keyword followed by a colon and in quotes and in curly brackets player created all one word capital p capital c followed by a colon and one lowercase b player created is an nbt value in the Iron golem used to determine if the iron golem was created by a player or not zero b represents false as in the iron golem was not created by a player one b would represent true as in the iron golem was created by a player we can Check for other tags as well such as any potion effects the entity has any equipment it wears or wields specific flags like if it’s on fire swimming or if it’s a baby we can check what biome it’s in what block it’s at the dimension the structure the fluid it’s swimming in The light level etc in this case for the killed underscore iron underscore golem condition i’m just going to use type and nbt for the killing underscore blow keyword we can choose what damage type killed the entity in this case the damage type we are going to use is Source underscore entity the reason we are using this is so we can check to see if the player is using a specific item to kill the iron golem after the entity section we can go ahead and put killing underscore blow underneath followed by a colon and a set Of curl brackets inside of those curly brackets we’ll enter our source underscore entity keyword followed by a colon and a set of curly brackets and inside of that we can include entity tags similar to the entity keyword from before in my example i’m going to use the nbt Tag followed by a colon and a string for the mbt data this is going to be in quotes and in curly brackets selected item all one word capital s capital i followed by a colon and another set of curly brackets inside of these curler brackets will be id Colon backslash and then in quotes minecraft colon netherright underscore block backslash and then end quotes and then the ending curly brackets followed by the end quotes again this will make it so that the item the player needs to have in their main hand needs to be another Right block for this condition to pass in this case i’m going to skip over the player keyword for this trigger the setup is exactly like entity and source underscore entity with tags to determine stats and traits about the player to pass the condition because i am skipping over the player Keyword though it means nothing about the player matters except what they use for the killing underscore blow if we want to set up more criteria we can do that by creating a new criteria name and setting its conditions in this case i’m going to make another one called killed underscore snow Underscore golem that will follow mostly the same setup except the type will be minecraft colon snow underscore golem and it will not use the nbt tag so for now we’ll go ahead and copy the killed underscore iron underscore golem and paste it into the killed underscore snow underscore golem i’ll change the type From iron golem to snow underscore golem and i’ll go ahead and remove that nbt tag next we can set up the requirements for this advancement requirements detail what conditions we need to earn the advancement after the criteria section we will add a new section using the requirements Keyword followed by a colon and a set of square brackets these brackets do have to be the square brackets and not the curly brackets for each requirement you will use another set of square brackets and list the condition name in quotes for example in quotes killed underscore iron underscore golem If you want this advancement to require both of the conditions to have passed you can do two sets of square brackets one with killed underscore iron underscore golem and the other with killed underscore snow under sword golem if you want those conditions to be interchangeable so you can kill the snow Golem or the iron golem you can put them in the same set of square brackets separated by a comma this makes it so only one of these conditions must pass for the requirement to be met lastly we can set up the rewards section there are four rewards You can set up in your rewards section recipes to unlock recipes in your crafting menu loot from a loot table experience or a function to call to set up the rewards section we’ll type in the keyword rewards followed by a colon and a set of curly brackets to add recipes we’ll Include the recipes keyword followed by a colon and a set of square brackets for each recipe you would like unlocked you will specify the namespace and file path to the recipe you will be unlocking for example minecraft colon bow will give you the recipe for the minecraft bow separate recipes to unlock with Commas if your recipe is a custom recipe in a different data pack you can use the namespace of that data pack instead of minecraft for example a recipe in this data pack would replace minecraft with testing underscore data pack to add loot tables to the reward you’ll include the Loot keyword followed by a colon and a set of square brackets for each loot table you want to get items from to give to the player you will specify the name space in the file path to the loot table you will be looting from for example minecraft colon entities creeper will Get loot from the creeper entity loot table separate loot tables to loot with commas if your loot table is a custom loot table in a different data pack you can use the namespace of that data pack instead of minecraft to add experience to the reward you’ll include the experience keyword followed By a colon and the number of experience to yield and finally to add a function to call for the reward you’ll include the function keyword followed by a colon and the function to run all functions will use the namespace of the function followed by a colon Followed by a file path to the function if you’re not sure how functions work don’t worry that’s going to be covered in the next episode and that’s how to create your own custom advancements these are super important to call functions when certain triggers and conditions are met and super important To add recipes to the player’s crafting menu to do some testing i’m going to remove all the rewards from our rewards section in minecraft i’m going to reload all the data packs by using the command reload you’ll notice that i already have the betrayal advancement page so i’m going To have to remove it from my advancements to do this i can use slash advancement revoke at a and in this case i’ll do everything to remove all my advancements let’s go ahead and test this by creating a snow golem and killing it with our nether right block As you can see i don’t have the new advancement page but when i kill a snow golem i get the new page for betrayal right now i do have a visual bug for that background but that is because i accidentally put an s at the end of block in our display So after correcting it should now display correctly when i reload let’s go ahead and reload and test it again we’ll go ahead and reload put on our snow golem and kill it with our another right block and if we check the advancement page now it has the correct background While this was unintended on my behalf it is important to note and an important teaching opportunity for me to explain that even the smallest typo can cause a big problem in your advancement what i’d like to do next is set up another advancement that connects to this root advancement what we’ll do is We’ll have our root advancement only work for the snow golem and then we make another advancement for the iron golem and connect them together in that advancement page so let’s go ahead and configure this root json advancement to only work with the snow golem and then we’ll create another one for the iron Golem afterwards i’ll go ahead and copy the root advancement and rename it to betrayal underscore iron underscore golem then we’ll go ahead and change everything in this new json file to reflect the change required for it to only work with an iron golem and lastly to make sure that this Advancement actually connects to the root advancement we can use the parent keyword followed by a colon in a string representing what advancement this advancement should be connected to in this case this advancement is connected to testing underscore data pack colon test slash root to represent the root json we’ve been creating in the Beginning now we can test this by summoning in our snow golem and killing it we can now see that we now have two advancements on this advancement page and the second one is still luck but once we kill this iron golem we created right here we will be rewarded our second advancement And the last thing i’d like to show today is how to add an advancement to an existing page connected to an existing advancement we’re going to connect this new advancement to the is it a plane advancement on the adventure tab this isn’t necessary but i recommend creating a new namespace titled minecraft the Reason i recommend this is so we know any advancement in here is going to be part of the default advancement pages let’s start off by creating a new folder in our namespace folder called advancements i’m also going to create a subfolder called adventure so i know this advancement is going into the Adventure page i’ll then create my json file for this advancement named spyglassunderscoreenderman.json my plan for this advancement is you will receive it when you look in an enderman with a spyclass with the title as no it’s just enderman to connect it to another advancement use the keyword Parent followed by a colon and a string detailing the path to the advancement you’re connecting it to in this case i’m trying to connect it to the is it a plane advancement in the adventure tab so my path will be minecraft colon adventure spyglass underscore dragon Afterwards i’ll set it up just like any other advancement back in minecraft after we reload we can see the advancement in our adventure tab connected to the is it a plane advancement and if we use the spyglass and spot the enderman we will receive the advancement and that concludes the advancement data Pack tutorial if you enjoyed and want to see more in this tutorial series don’t forget to subscribe and click that notification bell to get notified when i upload a video and if you’re not following already please consider following me on twitter instagram and supporting me on patreon all at curtis As a dig thank you all so much for watching and i hope to see you guys in the next episode have a good one Video Information
This video, titled ‘Custom Advancements – Minecraft Datapack Tutorial EP 3’, was uploaded by CurtisDoesADig on 2022-02-07 19:01:13. It has garnered 13402 views and 308 likes. The duration of the video is 00:18:56 or 1136 seconds.
EP 3 of my Minecraft Datapack Tutorial for how to create custom advancements in Minecraft!
This tutorial will cover creating new advancement menu pages, connecting advancements to other advancements, and yielding rewards for each advancement (Including Loot, Experience, Recipes in crafting menu, and calling functions)
DON’T FORGET to like and subscribe!
Advancement JSON format: https://minecraft.fandom.com/wiki/Advancement/JSON_format
Whole Playlist: https://www.youtube.com/playlist?list=PL01VhHmiNQ5oJ-0hoZvrJd2j9Ol7-Isim
Twitter: https://twitter.com/CurtisDoesADig Instagram: https://www.instagram.com/curtisdoesadig/ Patreon: https://www.patreon.com/CurtisDoesADig Enjoy or not the choice is yours!