[Java] Let's create a mod for Minecraft 1.14.4 [7. Add progress]

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

First article: Introduction Previous article: 6. Add Recipes Next article: 8. Addition and generation of ore

Add progress

So far, I've touched on item-related items broadly and shallowly, but now I'll change my mind a little and add advancements. advancement_Minecraft.png It's like a so-called trophy with a tree structure like this.

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

\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 of all, we need one progress that is the root of the tree, so we will make this. Reference Since it is detailed on the page, let's 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 you get ʻexample_ingot. Again, the [Reference](https://w.atwiki.jp/minecraft/pages/1548.html#id_6d2dca49) page has a sufficient explanation, so please check that for details. I will explain a part of it. frameis the frame specification for the progress tile. Let's set an appropriate one from three, challenge, goal, and task. Default task. show_toast ʻannounce_to_chat gives true / false for" whether to send a message in the upper right corner when achieved "and" whether to send a message in the chat field ", respectively. Default true. hidden is written as" Whether to display the tab until one is achieved "..., but even if false is specified, it is ** not displayed for some reason **, so I'm not sure. Default false. criteria is a term that defines the conditions for progress. Use an arbitrary unique name as the tag name (get_example_ingot part), describe various triggers in trigger, and describe detailed conditions corresponding to the triggers in conditions.

Add the title and description translate to the 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": "An example description."
}

キャプチャ.PNG You can add progress like this.


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
  }
}

An example of the progress achieved by obtaining one of the armor. Of particular note is the increase in the elements of parent that were not mentioned in the previous section. You can make it a child element by specifying ʻexample_mod: rootdefined earlier here. In progress, the parent is not a prerequisite for the child (achievable in any order), but when the parent is achieved, everything up to the child's child (that is, up to 2 steps ahead) will be displayed (reverse) If you achieve a child in, the parent to the root will be displayed by the shortest route). Also, one parent can have multiple children. The other difference is that there are multiplecriteria elements and there are more requirements rewards. As in this example, multiple elements of criteria can be described, and requirementsdescribes how to make an achievement judgment using these.[A, B]indicates A or B, and[A], [B]indicates A and B. You can set a reward for achieving progress inreward`. Experience points are given here, but recipes can be released, items can be given, and arbitrary functions can be executed. キャプチャ.PNG I have acquired experience points properly.


Progress is a good way to tell how you can enjoy your mods, so make good use of them.

Postscript

Before 1.12, there was a difference in achievements rather than progress, so be careful not to confuse them when looking for information.

reference

Progress --Minecraft Japan Wiki [8/4 update] --at wiki

Next article

8. Addition and generation of ore

Recommended Posts

[Java] Let's create a mod for Minecraft 1.14.4 [7. Add progress]
[Java] Let's create a mod for Minecraft 1.14.4 [4. Add tools]
[Java] Let's create a mod for Minecraft 1.14.4 [5. Add armor]
[Java] Let's create a mod for Minecraft 1.14.4 [6. Add recipe]
[Java] Let's create a mod for Minecraft 1.16.1 [Add item]
[Java] Let's create a mod for Minecraft 1.14.4 [1. Add items]
[Java] Let's create a mod for Minecraft 1.14.4 [2. Add block]
[Java] Let's create a mod for Minecraft 1.16.1 [Add block]
[Java] Let's create a mod for Minecraft 1.14.4 [3. Add creative tab]
[Java] Let's create a mod for Minecraft 1.14.4 [Introduction]
[Java] Let's create a mod for Minecraft 1.16.1 [Introduction]
[Java] Let's create a mod for Minecraft 1.14.4 [99. Mod output]
[Java] Let's create a mod for Minecraft 1.16.1 [Add and generate trees]
[Java] Let's create a mod for Minecraft 1.14.4 [9. Add and generate trees]
[Java] Let's create a mod for Minecraft 1.14.4 [8. Add and generate ore]
[Java] Let's create a mod for Minecraft 1.14.4 [0. Basic file]
[Java] Let's create a mod for Minecraft 1.14.4 [Extra edition]
[Java] Let's create a mod for Minecraft 1.16.1 [Basic file]
Let's create a Java development environment (updating)
Let's create a timed process with Java Timer! !!
Let's create a super-simple web framework in Java
[Java] Create a filter
[Java basics] Let's make a triangle with a for statement
Create a java method [Memo] [java11]
[Java] Create a temporary file
How to create a lightweight container image for Java apps
[Java twig] Create a parser combinator for recursive descent parsing 2
Create a MOB using the Minecraft Java Mythicmobs plugin | Preparation 1
Let's create a TODO application in Java 4 Implementation of posting function
How to sign a Minecraft MOD
Let's create a TODO application in Java 6 Implementation of search function
Let's create a TODO application in Java 8 Implementation of editing function
Create a Java project using Eclipse
[Java] How to create a folder
Let's create a TODO application in Java 1 Brief explanation of MVC
Let's create a TODO application in Java 5 Switch the display of TODO
Create a fluentd server for testing
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
[Java twig] Create a parser combinator for recursive descent parsing (also memoize)
Let's go with Watson Assistant (formerly Conversation) ⑤ Create a chatbot with Watson + Java + Slack
Create a java web application development environment with docker for mac part2
[Java] Create and apply a slide master
How to create a Maven repository for 2020
Create a TODO app in Java 7 Create Header
[Rails] Let's create a super simple Rails API
[Java] Let's make a DB access library!
Let's make a calculator application with Java ~ Create a display area in the window
Java (add2)
Java (add)
Let's create a versatile file storage (?) Operation library by abstracting file storage / acquisition in Java
[Azure] I tried to create a Java application for free-Web App creation- [Beginner]
I made a Diff tool for Java files
How to create a database for H2 Database anywhere
A story about Java 11 support for Web services
Create a CSR with extended information in Java
Create a simple bulletin board with Java + MySQL
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Create a Lambda Container Image based on Java 15
[Java] Create something like a product search API
Let's create a RESTful email sending service + client
Try to create a bulletin board in Java