NBT Tag ‐ CustomData - DerFrZocker/Custom-Ore-Generator GitHub Wiki

NBT Tag Custom Data

The NBT_TAG custom data allows you to apply NBT (Named Binary Tag) data to a generated block. This is a powerful feature for customizing blocks with complex data, such as container contents, mob spawners, or command block data.

  • Name: NBT_TAG
  • Type: String (JSON format)
  • Applicable Materials: Any block that can store NBT data (e.g., CHEST, FURNACE, SPAWNER, COMMAND_BLOCK).

Usage

To set the NBT_TAG custom data, you provide a string containing valid JSON representing the NBT data. The structure of the JSON should mirror the NBT structure you wish to apply.

Important: Understanding Minecraft's NBT format is crucial for effectively using this custom data. Incorrect NBT data can lead to unexpected behavior or errors.

Example

To create a chest with a diamond in the first slot:

/oregen set customdata my_diamond_chest NBT_TAG "{Items:[{Slot:0b,id:\"minecraft:diamond\",Count:1b}]}"

To create a spawner that spawns zombies:

/oregen set customdata my_zombie_spawner NBT_TAG "{SpawnData:{id:\"minecraft:zombie\"},SpawnPotentials:[{Weight:1,Entity:{id:\"minecraft:zombie\"}}],Delay:20,MinSpawnDelay:200,MaxSpawnDelay:800,SpawnCount:4,MaxNearbyEntities:6,RequiredPlayerRange:16}"