Useful Function Tags - TheBaruch4/DataUtils GitHub Wiki

Useful Function Tags (uft) adds various tags that allow you to make functions run in specific intervals, similarly to tagging a function with the #minecraft:tick tag.

The currently available tags are as follows:

ufti:0t ufti:1t ufti:2t ufti:3t ufti:4t ufti:5t ufti:6t ufti:7t ufti:8t ufti:9t ufti:10t ufti:11t ufti:12t ufti:13t ufti:14t ufti:15t ufti:16t ufti:17t ufti:18t ufti:19t ufti:20t

The number before the t indicates how many ticks should be in between ticks where functions under the tag are run.

How It Works

For example, tagging a function under the ufti:2t will wait 2 ticks between running those functions. The functions would be run on the following ticks within code blocks.

tick #1 tick #2 tick #3 tick #4 tick #5 tick #6 tick #7

Because of this, the ufti:19t tag will cause functions tagged with it to run every twentieth tick (every second).

Functions under the ufti:0t tag will be run every tick. It is effectively the same as tagging a function with the minecraft:tick tag.

How To Use It?

Please remember that you need to actually have Data Utils installed on your world for this to work. You're just deciding what functions you want to be run at certain times. The actual processing of everything is handled by the DataUtils data pack.

If you'd like, I can add your function into a special tag in the official data pack that will run it just as if you put it in your pack yourself, and won't interfere with other packs trying to use DataUtils uft. Just ask me on my discord server. You must be able to prove that you own/develop the data pack that uses the requested namespace and function.

If you'd like to tag the functions in your data pack, do one of the following:

Method 1:

This has files you can download to make this process easier. Simply download the latest zip and copy the ufti folder inside of it into the data folder of your data pack! You can then delete any/all of the tags that you don't need, or keep them if you feel like it!

The contents of each json file will be:

{
    "values": [
        "namespace:function"
    ]
}

Simply replace namespace:function with the namespace and function in your data pack that you want

If you add multiple functions to a single tag, remember to add commas after each line that isn't the final value

{
    "values": [
        "namespace:function",
        "namespace:function",
        "namespace:function"
    ]
}

Method 2: (For those who like to make things difficult)

  • Create a new namespace (folder within the data folder) in your data pack called ufti
    • Within that folder, create a folder called tags
    • Within that folder, create a folder called functions
    • The file structure should be data > ufti > tags > functions
  • Within the functions folder, create a json file for each tag you want to add
    • The name of the file should be xt.json
      • Replace the x with the delay you want
      • See "How It Works" for some info on this
    • The contents of this file should be as follows:
{
    "values": [
        "namespace:function"
    ]
}
  • Simply replace namespace:function with the namespace and function in your data pack that you want

If you add multiple functions to a single tag, remember to add commas after each line that isn't the final value

{
    "values": [
        "namespace:function",
        "namespace:function",
        "namespace:function"
    ]
}