Data Pack Conventions

These are conventions created by various members of the community that are officially endorsed by The Data Pack Center.

 

Namespace Convention

The Namespace Convention dictates that your namespace should be used as much as possible.


Correct Namespace Usage

The namespace should be used in as many places possible (/tag... /scoreboard and NBT to name a few). In tags you should always use your namespace, for example instead of:

/tag @s add something

Please instead do:

/tag @s add <namespace>.something

Scoreboards are another situation where you should always use your namespace, for example instead of:

/scoreboard objectives add dummy dummy

Please instead do:

/scoreboard objectives add <namespace>.dummy

 

Global Tags Convention

Global Tags, are tags (i.e. /tag) used to dictate how data packs should interact with entities found in the world. Consideration of global tags generally applies only to data packs that are modifying an entity randomly or modifying all entities in a given world.


Ignore Tags

The purpose of these tag is to prevent other data packs from messing with entities that are important to your data pack's functionality.

global.ignore
Do not delete or modify the NBT tags of this entity whatsoever. Do not remove this entity whatsoever (i.e. /kill).

global.ignore.pos

Do not modify the position/location of this entity whatsoever (i.e. /teleport).

 

Unified Installed Data Pack View

To standardise messages for the installation of data packs, this system was created.


Root Advancement (1/3)

Inorder to ensure this convention works, this root advancement file should be created and placed in the same location in all conforming data packs.

<data pack directory>/data/global/advancements/root.json
Code:
json
{
  "display": {
    "title": "Installed Datapacks",
    "description": "",
    "icon": {
      "item": "minecraft:knowledge_book"
    },
    "background": "minecraft:textures/block/black_concrete_powder.png",
    "show_toast": false,
    "announce_to_chat": false
  },
  "criteria": {
    "trigger": {
      "trigger": "minecraft:tick"
    }
  }
}

Data Pack Creator Advancement (2/3)

This advancement will display your Minecraft head and be the parent advancement to all your data pack advancements. Simply go to Player Head Generator and with your Minecraft username generate an Advancement Result, replace <playerhead> with this Advancement Result. Don't forget to place this advancement in the same directory, but instead use your data packs namespace as the file name.

<data pack directory>/data/global/advancements/<namespace>.json
Code:
json
{
  "display": {
    "title": "<creator name>",
    "description": "",
    <player head>
    "background": "minecraft:textures/block/black_concrete_powder.png",
    "show_toast": false,
    "announce_to_chat": false
  },
  "parent": "global:root",
  "criteria": {
    "trigger": {
      "trigger": "minecraft:tick"
    }
  }
}

Individual Data Pack Advancement (3/3)

This advancement will represent every one of your data packs in the view, customise the name, description, and item to match your pack.

<data pack directory>/data/<namespace>/advancements/<data pack name>.json
Code:
json
{
  "display": {
    "title": "<data pack name>",
    "description": "data pack description",
    "icon": {
      "item": "<item>"
    },
    "background": "minecraft:textures/block/black_concrete_powder.png",
    "show_toast": false,
    "announce_to_chat": false
  },
  "parent": "global:<namespace>",
  "criteria": {
    "trigger": {
      "trigger": "minecraft:tick"
    }
  }
}

 

Example of this convention in action:

  • Published
    Aug 10, 2019
  • Page views
    562
Top