Creating new advancements with the /advancement command

🎙️ tryashtar · 8 points · Posted at 13:32:06 on May 5, 2017 · (Permalink)


TL;DR

/advancement add <name> <JSON> creates an advancement in memory if run automatically, and writes a file if run by a player through chat.

Introduction

Advancements are a powerful new way to think about progression, and recently they've become a trendy command tool as well. It's for good reason, because they are quite effective. However, advancements as they now stand are static. You can only add them in a file outside the game, and you need server access to do so. This severely limits their potential.

Scope of Tools

Consider the following tools:

  • Command blocks

  • Loot tables

  • Structures

Each of these is regularly used in mapmaking. Command blocks can be placed and edited by any server operator, and they can move or change each other as the game runs. Conversely, loot tables cannot be changed in-game. You need to own the server, and the only way to utilize a loot table is to reference the physical file that contains it.

Structure blocks are different from each. While they can load and save structures from hard files, they can also do the same entirely in-game. A redstone-powered structure block will save its structure into memory, where it will be accessible but lost when the server is closed.

This is an excellent solution because it solves the potential issues of blowing up the owner's hard drive as well as the "inaccessibility" of needing server access to utilize them.

Advancements

Advancements are currently "loot table"-tier. The only way to create or modify them is from outside the game. A player on a server or someone who wants to set up commands quickly (like a one-click install) is out of luck. That's why I propose this solution:

/advancement add <name> <JSON>

This is a command that behaves similarly to structure blocks. When run from chat by a player, it writes an advancement file to the server for permanent use. When run through other means (such as a command block), it loads the advancement only into memory, to be used temporarily until the server closes.

This way, we solve the issue of those who either can't or won't access the server files being unable to utilize advancements, and could add some powerful behavior as well!