# Loot, tags and advancements

NTM additions to vanilla loot and advancement data.

These use vanilla datapack formats with the NTM additions described below. The [Minecraft Wiki data pack reference](https://minecraft.wiki/w/Data_pack) covers the base formats.

## Loot tables

NTM supplies block, entity and structure loot tables. Use the [Minecraft Wiki loot-table reference](https://minecraft.wiki/w/Loot_table) for the base JSON. A higher-priority file with the same resource ID replaces the complete lower-priority table.

### Scaled rolls

The `hbm:config_scaled` number provider scales its input by the world's loot amount factor:

```json
{"type": "hbm:config_scaled", "value": 2}
```

| Field | Meaning and default |
| - | - |
| `type` | `hbm:config_scaled`. |
| `value` | Vanilla number provider: a constant or a provider object. |

The result is:

$$
\max\!\left(1,\left\lfloor\mathrm{value}\cdot\mathrm{amount\_factor}\right\rfloor\right)
$$

`amount_factor` is a field of the [`loot` world settings](https://movblock.mov/ntm-next/wiki/game-settings/world_config.md#loot), read each time the provider rolls. [until NTM 1.0.2: `value` is sampled as a float, so a `minecraft:uniform` value lies in $[\mathrm{min}, \mathrm{max})$ before scaling.][since NTM 1.0.2: `value` is sampled as an integer, so a `minecraft:uniform` value lies in $[\mathrm{min}, \mathrm{max}]$ before scaling.] The provider may appear as a pool's `rolls` value. The rest of the pool uses vanilla formats and functions.

> **since NTM 1.0.2**
>
> ### Entity enchantment levels
>
> [`hbm:entity_enchantment_level`](https://movblock.mov/ntm-next/wiki/loot-number-providers/entity_enchantment_level.md) reads an enchantment level from an entity selected from the loot context, such as the attacker's Looting level.

> **since NTM 1.0.1**
>
> ### Container fill policy
>
> | Field | Meaning and default |
> | - | - |
> | `hbm:random_slots` (Optional) | Top-level loot-table field. When true, container filling uses the policy below; default false. |
>
> When a container unpacks a table with `hbm:random_slots: true`:
>
> - Each rolled stack keeps its rolled count and goes to a uniformly random slot, replacing that slot's contents, including earlier rolls.
> - A stack larger than its maximum stack size is split into single items, each placed in a random slot.
>
> > **since NTM 1.0.3**
> >
> > Zero-count stacks also write to a random slot, clearing its contents. A `minecraft:empty` entry emits no stack and makes no slot write.
>
> Only the table named by the container is checked; nested `minecraft:loot_table` entries ignore their own flag. Drops and `/loot` draw the table normally.
>
> Example: `data/example/loot_table/chest.json`.
>
> ```json
> {
>   "type": "minecraft:chest",
>   "hbm:random_slots": true,
>   "pools": [{
>     "rolls": 1,
>     "entries": [{"type": "minecraft:item", "name": "minecraft:iron_ingot"}],
>     "functions": [{"function": "minecraft:set_count", "count": 16}]
>   }]
> }
> ```

### NTM chest tables

NTM structures and features store a roll-table ID in each container. A roll table draws one content table.[since NTM 1.0.1:  Every shipped chest table sets `hbm:random_slots` to `true`.]

| Table ID | Contents |
| - | - |
| `hbm:chests/<pool>` | Content table: one weighted draw, `rolls` 1. Overriding it changes every container drawing that pool. |
| `hbm:chests/<pool>_<min>_<max>` | Draws `hbm:chests/<pool>` a uniform $[\mathrm{min}, \mathrm{max}]$ times; a constant count when equal. |
| `hbm:chests/component/<pool>_<min>_<max>` | The same count wrapped in `hbm:config_scaled`. |
| `hbm:chests/component/unscaled/<pool>_<min>_<max>` | The same count without scaling. |

> **since NTM 1.0.3**
>
> ### Generated chest selection
>
> The 44 built-in content tables encode their weighted selection as nested `minecraft:alternatives` entries with `minecraft:value_check` conditions. To change odds in a copied table, update those selection conditions or replace the pool with a vanilla weighted entry list. Changing leaf `weight` fields alone leaves the generated branch selection unchanged.
>
> `hbm:chests/nuke_fuel` now yields `hbm:pile_rod_mk2_nu` in place of `hbm:pile_rod_uranium`, and `hbm:pile_rod_mk2_ra226be` in place of `hbm:pile_rod_source`. Their count ranges remain 2–5 and 1–2, with weights 3 and 2 respectively.

> **since NTM 1.0.1**
>
> `hbm:chests/vanilla/simple_dungeon` fills the library dungeon's chests with one draw of `minecraft:chests/simple_dungeon`.

### Vanilla chest additions

When loot tables load, NTM appends single-item entries to the first pool of five vanilla chest tables. A replacement table receives them only when it has at least the listed number of pools and first-pool entries; otherwise it is left unchanged.

| Table | Minimum pools / first-pool entries | Added entries (weight) |
| - | - | - |
| `minecraft:chests/village/village_weaponsmith` | 2 / 20 | `hbm:armor_polish` (3), `hbm:bathwater` (1) |
| `minecraft:chests/abandoned_mineshaft` | 3 / 6 | `hbm:bathwater` (1), `hbm:serum` (5), `hbm:no9` (5), `hbm:key_red_cracked` (5) |
| `minecraft:chests/simple_dungeon` | 3 / 12 | `hbm:heart_piece` (1), `hbm:scrumpy` (1), `hbm:key_red_cracked` (5) |
| `minecraft:chests/desert_pyramid` | 3 / 16 | `hbm:heart_piece` (1), `hbm:scrumpy` (1) |
| `minecraft:chests/jungle_temple` | 2 / 13 | `hbm:heart_piece` (1) |

`minecraft:chests/spawn_bonus_chest` always receives one extra pool: 10 rolls of `hbm:no9` (weight 7) against an empty entry (weight 64).

## Tags

Use the [Minecraft Wiki tag reference](https://minecraft.wiki/w/Tag) for tag paths, `values`, and `replace`. An NTM recipe ingredient refers to an item tag as `#example:ingredients`; other NTM fields may expect a bare tag ID. Follow the shape documented for that field.

To remove entries contributed by another tag file, use the field for your loader. The generated `minecraft:trimmable_armor` tag removes NTM items this way:

> **Fabric**
>
> `fabric:remove` is an array of item IDs. See the [Fabric tag-removal example](https://docs.fabricmc.net/develop/items/custom-tools).

> **NeoForge**
>
> `remove` is an array of item IDs. See the [NeoForge tag reference](https://docs.neoforged.net/docs/resources/server/tags/).

NTM uses tags for recipe inputs, fluid equivalence, biome scopes, damage behavior and other membership policies. Some consumers snapshot tag membership at world load.

### Membership tags

NTM code reads these tags. Paths are under `data/<namespace>/tags/<directory>/`.

| Tag | Directory | Behavior |
| - | - | - |
| `hbm:coal_fuels` (since NTM 1.0.1) | `item` | Coal fuel class: +25% burn time in the Firebox, Heating Oven and Iron Furnace. Solid fuels, rocket fuel, coke and briquettes keep their own classes. |
| `hbm:faraday_armor` (since NTM 1.0.1) | `item` | Marks armor pieces for Faraday protection. All four slots must hold eligible pieces; positive installed cladding resistance also qualifies a piece. |
| `hbm:no_container_nesting` (since NTM 1.0.1) | `item` | Refuses listed items in NTM storage and cargo paths that enforce container-item eligibility. |
| `hbm:mining_laser_worthless` | `item` | Drops the Mining Laser deletes while a Scrap Destroyer Upgrade is installed. |
| `hbm:tool_repair/<item>`, `hbm:armor_repair/<material>` | `item` | Anvil repair materials for NTM tools and armor. `<item>` is the original repair item's path; `<material>` is the armor material. |
| `c:dyes/<color>` | `item` | Color applied when the item dyes a pylon or connector, Deco Light Emitter or Firework Battery. A `minecraft:dye` component takes precedence. |
| `c:ores`[since NTM 1.0.1: , `c:raw_materials`], `minecraft:logs`, `hbm:any_tar` | `item` | Steel Furnace bonus per smelted item, first match in this order: 25% for ores[since NTM 1.0.1:  and raw materials], 50% for logs, 50% for tar. Each full 100% adds one more result. |
| `hbm:framed_mesh`, `hbm:framed_unbobbed` | `item` | NTM renderers that display item stacks, such as pedestals, presses and conveyor items, draw `hbm:framed_mesh` members with their ground model; `hbm:framed_unbobbed` members omit the bob offset. |
| `hbm:depth_rock` | `block` | The Large Mining Drill stops drilling while a member is in its bore. |
| `c:ores` | `block` | Blocks the Large Mining Drill mines as veins when vein mining is enabled and the installed drill bit supports it. |
| `hbm:ancient_tomb_material` | `block` | Blocks kept in the ancient tomb's cladding volume; other non-air blocks there become tomb concrete. |
| `hbm:meteorite_replaceable` | `block` | Non-replaceable blocks a deflected meteor's crater may overwrite. |
| `hbm:fbi_breakable` | `block` | Blocks FBI Agents break during raids. |
| `hbm:pile/flux_absorber` | `block` | Stops graphite-pile neutron flux. |
| `hbm:pile/flux_attenuator` | `block` | Multiplies passing graphite-pile neutron flux by 0.25. |
| `hbm:radiation_immune` (since NTM 1.0.1) | `entity_type` | Exempts entity types from radiation and neutron contamination. |
| `hbm:endermen_evade` (since NTM 1.0.4) | `damage_type` | Non-projectile damage types an enderman teleports away from instead of taking. |
| `hbm:endermen_cannot_evade` (since NTM 1.0.4) | `damage_type` | Projectile damage types an enderman takes instead of teleporting away. |
| `c:bosses` | `entity_type` | Thermal sights outline members in orange. |
| `c:no_default_monsters` | `worldgen/biome` | Biomes excluded from NTM's added mob spawns. |

Item-hazard bindings target item tags such as `hbm:hazard/<name>`; see [Item hazards](https://movblock.mov/ntm-next/wiki/hazards-and-radiation/item-hazards.md). Fluid `shares` name fluid tags; see the [Fluid Trait Reference](https://movblock.mov/ntm-next/wiki/fluid-traits.md).

> **since NTM 1.0.1**
>
> NTM's `c:<family>/<name>` item tags join their parent `c:<family>` tag for the families `dusts`, `dyed`, `dyes`, `gems`, `ingots`, `nuggets`, `ores`, `raw_materials` and `storage_blocks`. NTM ore and storage blocks are also listed in `c:ores/<name>` and `c:storage_blocks/<name>` block tags, which join the `c:ores` and `c:storage_blocks` block tags.

## Advancements and NTM criteria

The enclosing advancement fields follow the [Minecraft Wiki advancement reference](https://minecraft.wiki/w/Advancements). Every trigger accepts the optional vanilla `player` predicate. An `item` field is an optional vanilla item predicate applied to the event stack.

| Trigger | Event | Additional fields |
| - | - | - |
| `hbm:radiation` | Radiation sickness at 200 to below 400 RAD (`fatal` false), or death from at least 1000 RAD (`fatal` true) | Optional `level`: bounds on the player's RAD; optional boolean `fatal` |
| `hbm:digamma` | Player digamma set to a positive value | Optional `level`: bounds on digamma, `[0, 1000]`; optional `fatal`; these events report `false` |
| `hbm:detonation` | NTM detonation | Required `kinds`: list of detonation kinds |
| `hbm:smoked` | Player finished smoking an item | `item` |
| `hbm:room_opened` | Player opened a Strange Stone with a Red Key or Cracked Key | None |
| `hbm:particle_produced` | Particle Detector produced a digamma particle within 100 blocks horizontally and 50 vertically | `item` |
| `hbm:item_dissolved` | Dropped item dissolved in Sulfuric Acid within 10 blocks | `item` |
| `hbm:item_picked_up` | Item entity entered the player's inventory | `item` |
| `hbm:item_crafted` | Player took a stack from an NTM output slot, or crafted at an NTM anvil (first listed output) | `item` |
| `hbm:orbit` | Soyuz payload or satellite reached orbit; every player in the dimension | `item`: payload or satellite chip |
| `hbm:satellite_action` | Orbiting satellite executed its command; every player in the dimension | `item`: satellite chip |
| `hbm:boss_killed` | NTM boss died within its credit radius | Required `kind` |
| `hbm:bled_out` | 8 Inch Blade Autoinjector reduced the player's maximum health to 2 | None |

| Detonation kind | Event | Credited players |
| - | - | - |
| `nuke` | Nuclear explosion | Every player in the dimension, each tick |
| `rbmk` | RBMK meltdown | Within 50 blocks |
| `zirnox` | ZIRNOX explosion | Within 100 blocks |
| `watz` | Watz meltdown | Within 50 blocks |
| `refinery` | Refinery destroyed directly by a napalm bomblet | Within 100 blocks |
| `fluid_tank` | Tank holding a flammable fluid destroyed directly by a napalm bomblet | Within 100 blocks |
| `digamma_spear` | Digamma spear impact | Every player in the dimension |
| `nuclear_creeper` | Nuclear creeper death | Within 50 blocks |
| `soyuz_exhaust` | Soyuz launch exhaust | Each player hit |

| Boss kind | Boss | Credit radius |
| - | - | - |
| `maskman` | Mask Man | 100 |
| `meltdown` | Meltdown Elemental leader | 50 |
| `worm` | Balls-O-Tron Prime | 200 |
| `ufo` | Martian Invasion Ship | 200 |

A minimal advancement for taking paper from an NTM output slot is:

```json
{
  "criteria": {
    "make_paper": {
      "trigger": "hbm:item_crafted",
      "conditions": {"item": {"items": "minecraft:paper"}}
    }
  }
}
```

NTM furnace output slots also fire `minecraft:recipe_crafted` for the smelting recipes used.

Bobmazon offers are gated by `hbm:blastfurnace`, `hbm:assembly`, `hbm:chemplant`, `hbm:desh`, `hbm:technetium` and `hbm:hidden`. Overriding one changes when its offers unlock; a missing gate advancement keeps them locked.

## Damage types

`data/<namespace>/damage_type/<path>.json` uses the vanilla damage-type schema described in the [Minecraft Wiki data pack reference](https://minecraft.wiki/w/Data_pack). For example, a shipped type contains:

```json
{"exhaustion": 0.0, "message_id": "pc", "scaling": "never"}
```

The resource ID identifies the damage type. `message_id` selects its death-message family; translated strings are client language resources. Damage tags control properties such as bypass behavior.

Damage-type registry contents load with the world.

## Jukebox songs

`data/<namespace>/jukebox_song/<path>.json` uses the vanilla song schema described in the [Minecraft Wiki data pack reference](https://minecraft.wiki/w/Data_pack):

```json
{
  "sound_event": "hbm:music.transmission",
  "description": {"translate": "jukebox_song.hbm.glass"},
  "length_in_seconds": 62.229,
  "comparator_output": 15
}
```

This is the shipped `hbm:glass` song record; NTM also ships `hbm:lc`, `hbm:ss` and `hbm:vc`. The song registry loads with the world. The item refers to the song through its vanilla jukebox-playable component.
