[Java] [Java] Let’s create a Minecraft Mod 1.14.4 [7. Add progress]

3 minute read

(This article is one of a series of commentary articles)

First article: Introduction Previous article: 6. Add recipe Next article: 8. Adding ore and ore

Add progress

Up to this point, I have touched on item relations widely and shallowly, but this time I will change the taste a little and add progress (advancements). advancement_Minecraft.png It’s like a so-called trophy with such a tree structure.

Adding progress is relatively easy and managed in 1.14.4 on a json basis.

\src\main\resources
   ├ assets
   └ data
      └ example_mod
         ├ advancements
         │ └ root.json
         ├ loot_tables
         └ recipes

Create a \src\main\resources\data\example_mod\advancements folder and place it in this folder. First, we need to make one progress, which is the root of the tree, so create it. Reference Details are detailed on this page, so please write while referring to this.

root.json


{
  "display": {
    "icon": {
      "item": "example_mod:example_ingot"
    },
    "title": {
      "translate": "advancements.root.title"
    },
    "description": {
      "translate": "advancements.root.description"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false,
    "background": "minecraft:textures/block/stone.png"
  },
  "criteria": {
    "get_example_ingot": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "example_mod:example_ingot"
          }
        ]
      }
    }
  }
}

This is an example of the progress achieved when getting the example_ingot. It will be repeated, but there is a sufficient explanation on the Reference page, so please check that for details. I will explain in part. frame is the frame of the progress tile. Let’s set an appropriate one from challenge, goal and task. The default task. show_toast announce_to_chat gives “true/false” for “whether to send a message to the upper right when achieving” and “whether to send a message to the chat field”. Default true. hidden is written as “whether tabs are not displayed until one is achieved”… but I am not sure because it is not displayed for some reason even if false is specified. Default false. criteria is a term that defines the progress criteria. Use any unique name as a tag name (get_example_ingot part), describe various triggers in trigger, and describe detailed conditions corresponding to the trigger in conditions.

About translate of title and description, add to lang file.

en_us.json


{
  "advancements.root.title": "Example Title",
  "advancements.root.description": "Example description."
}

ja_jp.json


{
  "advancements.root.title": "Example title",
  "advancements.root.description": "Description example."
}

Capture.PNG In this way I have added progress. ___ Let’s look at another example.

obtail_armor.json


{
  "parent": "example_mod:root",
  "display": {
    "icon": {
      "item": "example_mod:example_chestplate"
    },
    "title": {
      "translate": "advancements.obtain_armor.title"
    },
    "description": {
      "translate": "advancements.obtain_armor.description"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false
  },
  "criteria": {
    "example_helmet": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "example_mod:example_helmet"
          }
        ]
      }
    },
    "example_chestplate": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "example_mod:example_chestplate"
          }
        ]
      }
    },
    "example_leggings": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "example_mod:example_leggings"
          }
        ]
      }
    },
    "example_boots": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "example_mod:example_boots"
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "example_helmet",
      "example_chestplate",
      "example_leggings",
      "example_boots"
    ]
  ],
  "rewards": {
    "experience": 100
  }
}

Here is an example of the progress achieved by getting either armor. Of particular note is the increased number of parent elements that were not in the previous section. You can make it a child element by specifying the example_mod:root defined above. In addition, in the progress, the parent is not a prerequisite for the child (can be achieved in any order), but when the parent is achieved, it seems that all the children up to the child (that is, up to two steps) will be displayed (reverse When the child is achieved, the parent up to the root is displayed in the shortest path.) You can create multiple children for one parent. Other differences are that multiple elements of criteria are described and requirementsrewards is increasing. As in this example, multiple elements of criteria can be described, and in requirements, describe how to perform achievement judgment using them. [A,B] indicates A or B, and [A],[B] indicates A and B. You can set the reward for achieving the progress in reward. Although experience values are given here, you can open recipes, add items, and execute arbitrary functions. Capture.PNG I have acquired the experience value properly. ___ Progress is a good way to tell how your mods can be enjoyed, so make effective use of them.

Addition

Before version 1.12, there were different achievements, not progress, so be careful when searching for information.

Reference

Progress-Minecraft Japan Wiki [8/4 update]-At Wiki

Next article

8. Addition and production of ore