> For the complete documentation index, see [llms.txt](https://animated-timer.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://animated-timer.gitbook.io/docs/customization/modification.md).

# Modification

This chapter focuses on the steps required to alter AT's souce code, e.g. for disabling specific features or implementing it into your project. If this is not what you want, consider checking out the [Advanced section](/docs/advanced/configuration.md) to learn more about changing the way AT works natively, without any changes.

Note: Changing AT's code without knowing what you are doing can seriously mess up your world and potentially break AT permanently! Please be advised to back up data that you care about before attempting any code modification.

## Default configuration

Changing the default values is useful if you plan to use this timer on multiple (new) worlds. This will ensure that wherever you use this modified data pack, AT will always default to the settings you defined. On initialization, AT will always load its default configuration values:

* Render type: **SAZ**
* Style type: **animated**
* Animation: **blue-pink**
* Bold: **true**
* Italic: **false**
* ...

These values are sprad over three files and can be easily modifed, if you know where to look:

<table><thead><tr><th width="494" align="center">Path from AT root directory</th><th align="center">Setting</th></tr></thead><tbody><tr><td align="center">/data/at-main/function/init.mcfunction</td><td align="center">Render &#x26; style type</td></tr><tr><td align="center">/data/at-misc/function/configuration/static.mcfunction</td><td align="center">Colors, bold &#x26; italic style</td></tr><tr><td align="center">/data/at-misc/function/configuration/animated.mcfunction</td><td align="center">Animation, speed, directon ...</td></tr></tbody></table>

Often times, AT's configuration settings are not stored as strings, but rather as scoreboard values in the *at\_s\_config* objective. This includes the following config attributes:

<table><thead><tr><th width="249" align="center">Setting in at_s_state</th><th align="center">Description &#x26; possible values</th></tr></thead><tbody><tr><td align="center">render</td><td align="center">Render type: 0=CAZ, 1=SAZ, 2=SNZ, 3=TAZ, 4=TNZ</td></tr><tr><td align="center">style</td><td align="center">Style type: 0=static, 1=animated</td></tr><tr><td align="center">static_bold1</td><td align="center">Primary bold: 0=false, 1=true</td></tr><tr><td align="center">static_bold2</td><td align="center">Secondary bold: 0=false, 1=true</td></tr><tr><td align="center">static_italic1</td><td align="center">Primary italic: 0=false, 1=true</td></tr><tr><td align="center">static_italic2</td><td align="center">Secondary italic: 0=false, 1=true</td></tr><tr><td align="center">animated_bold</td><td align="center">Animation bold: 0=false, 1=true</td></tr><tr><td align="center">animated_italic</td><td align="center">Animation italic: 0=false, 1=true</td></tr><tr><td align="center">animated_speed</td><td align="center">Animation speed: tick count</td></tr><tr><td align="center">animated_direction</td><td align="center">Animation direction: 0=left-to-right, 1=right-to-left</td></tr></tbody></table>

If you look at the .mcfunction files mentioned above, most of the settings should be self-explanatory, as AT's code uses lots of comments to describe what things do. If you are still having troubles, take a look at the following examples.

### Example 1: Default to statically pink

**Result of change:**

* Style type will always be static
* Pink color instead of white (default)
* Fully italic style, not bold

**Steps to reproduce:**

1. Open file: */data/at-main/function/init.mcfunction*
2. Set style type - change line below "# Style type" to:

`function at-misc:configuration/static`

3. Open file: */data/at-misc/function/configuration/static.mcfunction*
4. Set timer color primary & secondary - change lines below "# Colors" to:

`data modify storage animated-timer:data at.configuration.style.color1 set value "#ff55ff"`

`data modify storage animated-timer:data at.configuration.style.color2 set value "#ff55ff"`

5. Disable bold styles - change lines below "# Bold" to:

`scoreboard players set static_bold1 at_s_config 0`

`scoreboard players set static_bold2 at_s_config 0`

6. Enable italic styles - change lines below "# Italic" to:

`scoreboard players set static_italic1 at_s_config 1`

`scoreboard players set static_italic2 at_s_config 1`

### Example 2: Default to green-fade animation

**Result of change:**

* Default animation will always be green-fade

**Steps to reproduce:**

1. Open file: */data/at-misc/function/configuration/animated.mcfunction*
2. Set animation - change line below "# Animation" to:

`data modify storage animated-timer:data at.configuration.style.animation set value "green-fade"`

### Example 3: Default to white-aqua animation

**Result of change:**

* Render type will always be CAZ
* Default animation: white-aqua
* Animation speed: 3 ticks
* Left-to-right instead of right-to-left direction

**Steps to reproduce:**

1. Open file: */data/at-main/function/init.mcfunction*
2. *Set render type* - change line below "# Render type" to:

`scoreboard players set render at_s_config 0`

3. Open file: */data/at-misc/function/configuration/animated.mcfunction*
4. Set animation - change line below "# Animation" to:

`data modify storage animated-timer:data at.configuration.style.animation set value "white-aqua"`

5. Decrease animation speed - change line below "# Speed" to:

`scoreboard players set animated_speed at_s_config 3`

6. Swap animation direction - change line below "# Direction" to:

`scoreboard players set animated_direction at_s_config 0`

## Removing specific trigger scoreboards

Although you can easily remove all trigger scoreboards (see [Triggers](/docs/advanced/other-settings.md#triggers)), you may only want to remove some of them. This usually involves editing three files:

<table><thead><tr><th width="414" align="center">Path from AT root directory</th><th align="center">Purpose</th></tr></thead><tbody><tr><td align="center">/data/at-trig/function/add.mcfunction</td><td align="center">Create all trigger scoreboards</td></tr><tr><td align="center">/data/at-trig/function/remove.mcfunction</td><td align="center">Delete all trigger scoreboards</td></tr><tr><td align="center">/data/at-trig/function/dist.mcfunction</td><td align="center">Tick every trigger function</td></tr></tbody></table>

Before any code modification happens, be sure to disable all trigger scoreboards:

`/function at-tapi:set/trigger/disabled`

The following examples demonstrate how the removal can be accomplished. After that, reload your world to apply the code changes.

### Example 1: Remove "mode" trigger

**Steps to reproduce:**

1. Open file: */data/at-trig/function/add.mcfunction*
2. Search for line that contains "add mode trigger"
3. Comment it out:

`#scoreboard objectives add mode trigger`&#x20;

4. Open file: */data/at-trig/function/remove.mcfunction*
5. Search for line that contains "remove mode"
6. Comment it out:

`#scoreboard objectives remove mode`

7. Open file: */data/at-trig/function/dist.mcfunction*
8. Search for line that contains "/mode"
9. Comment it out:

`#function at-trig:conf/mode`

### Example 2: Remove animation-related triggers

**Steps to reproduce:**

1. Open file: */data/at-trig/function/add.mcfunction*
2. Comment out lines below "# Scoreboards / Trigger / anim" section:

`#scoreboard objectives add list-animations trigger`

`#scoreboard objectives add load-animation trigger`

3. Open file: */data/at-trig/function/remove.mcfunction*
4. Comment out lines below "# Scoreboards / Trigger / anim" section:

`#scoreboard objectives remove list-animations`

`#scoreboard objectives remove load-animation`

5. Open file: */data/at-trig/function/dist.mcfunction*
6. Comment out lines below "# Anim" section:

`#function at-trig:anim/list`

`#function at-trig:anim/load`

### Example 3: Remove profile-related triggers

**Steps to reproduce:**

1. Open file: */data/at-trig/function/add.mcfunction*
2. Comment out lines below "# Scoreboards / Trigger / prof" section:

`#scoreboard objectives add delete-profile trigger`

`#scoreboard objectives add list-profiles trigger`

`#scoreboard objectives add load-profile trigger`

`#scoreboard objectives add save-profile trigger`

`#scoreboard objectives add view-profile trigger`

3. Open file: */data/at-trig/function/remove.mcfunction*
4. Comment out lines below "# Scoreboards / Trigger / prof" section:

`#scoreboard objectives remove delete-profile`

`#scoreboard objectives remove list-profiles`

`#scoreboard objectives remove load-profile`

`#scoreboard objectives remove save-profile`

`#scoreboard objectives remove view-profile`

5. Open file: */data/at-trig/function/dist.mcfunction*
6. Comment out lines below "# Prof" section:

`#function at-trig:prof/delete`

`#function at-trig:prof/list`

`#function at-trig:prof/load`

`#function at-trig:prof/save`

`#function at-trig:prof/view`

## Custom animations

Before creating a custom animation, please take a look at the code in */data/at-misc/function/animation/load.mcfunction* as this is the place where all animations are stored. Each animation (including your new one) must follow this NBT path scheme:

*at.animations.\<animation-name>*

An animation generally consists of five NBT tags:

<table><thead><tr><th width="187" align="center">Name of NBT tag</th><th width="113" align="center">Type</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">id</td><td align="center">Integer</td><td align="center">Numeric ID; used for animation list command</td></tr><tr><td align="center">count</td><td align="center">Integer</td><td align="center">Number of steps (colors) per animation</td></tr><tr><td align="center">title_length</td><td align="center">Integer</td><td align="center">Length of animation title / name</td></tr><tr><td align="center">rotation_type</td><td align="center">Integer</td><td align="center">Determines how to print animation (list command)</td></tr><tr><td align="center">colors</td><td align="center">List</td><td align="center">Stores the HEX colors that make up the animation</td></tr></tbody></table>

The key is to find two (or more) colors that match and then generate a gradient between them. You can do this with an [external tool](https://colordesigner.io/gradient-generator).

Note: AT does not loop around automatically. Going just from color A to B isn’t sufficient - a full animation should look more like this: A > B > A.

The following example should serve as a guide on how to implement a new animation.

### Example 1: Animation white-black

**Steps to reproduce:**

1. Generate a gradient using the tool mentioned above (A > B; 20 colors are recommended)
2. Copy the colors and reverse them to get your animation (A > B > A; at least 40 in total)
3. Determine animation ID: unique, used for output of animation list command
4. Determine colors count: 40 if you use the recommended values
5. Determine length of title: 11 for "white-black"
6. Determine rotation type: 0 when following A > B > A pattern
7. Put HEX colors into colors list
8. Paste complete animation into animation load file (mentioned above):

`data modify storage animated-timer:data at.animations.white-black.id set value 100`

`data modify storage animated-timer:data at.animations.white-black.count set value 40`

`data modify storage animated-timer:data at.animations.white-black.title_length set value 11`

`data modify storage animated-timer:data at.animations.white-black.rotation_type set value 0`

`data modify storage animated-timer:data at.animations.white-black.colors set value ["#ffffff","#f0f0f0","#e1e1e1","#d2d2d2","#c3c3c3","#b5b5b5","#a7a7a7","#999999","#8b8b8b","#7e7e7e","#707070","#636363","#575757","#4a4a4a","#3e3e3e","#333333","#272727","#1d1d1d","#121212","#000000","#000000","#121212","#1d1d1d","#272727","#333333","#3e3e3e","#4a4a4a","#575757","#636363","#707070","#7e7e7e","#8b8b8b","#999999","#a7a7a7","#b5b5b5","#c3c3c3","#d2d2d2","#e1e1e1","#f0f0f0","#ffffff"]`

9. Reload your world to apply the changes
