NBT Data - mehboss/CustomRecipes GitHub Wiki
Using NBT Data with the 'Custom-Tags' Section
This guide explains how to use the Custom-Tags section to apply NBT data to custom items. Below are examples of how to use Custom-Tags to set various properties such as spawner IDs, attribute modifiers, and leather armor colors.
Example: Set Mobs to an Empty Spawner
Custom-Tags:
- path:
- SpawnerID
value: Zombie
This configuration sets the SpawnerID to spawn a Zombie.
Example: Add Attribute Modifier (Attack Damage)
Custom-Tags:
- path:
- AttributeModifiers
value:
- Name: CustomAttackDamage
AttributeName: generic.attackDamage
Amount: 100.0
Operation: 0
Slot: mainhand
This configuration applies a custom attribute modifier that increases attack damage by 100.0 when the item is held in the main hand.
Example: Set Leather Armor Color
Custom-Tags:
- path:
- display
- color
value: 16711680
This configuration sets the leather armor color to red using the RGB value 16711680 (hex: #FF0000).
Example: Set Potion Types
Custom-Tags:
- path:
- potion
value: STRENGTH
extended: true
upgraded: false
This configuration sets the potion type to a strength potion.
Example: Set Enchanted Book Enchantments
Custom-Tags:
- path:
- Enchantments
value:
sharpness: 5
efficiency: 4
This configuration results in an enchanted book with both sharpess 5 and efficiency 4.
Key Notes
NBT Paths: The path field defines the specific NBT path for the property being set. Each segment of the path should be listed as an array item.
Value Format: The value field specifies the value to assign at the specified NBT path. For nested structures, use arrays and key-value pairs as needed.