Minecraft:Enchantment provider
More actions
Enchantment providers are used to source one or more enchantments for use in specific scenarios, such as mobs spawning with enchanted equipment.
Enchantment providers are stored as JSON files within a Minecraft:data pack in the Template:Cd folder.
JSON format
single
Always returns the same enchantment
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:Nbt: Template:Json ref/enchantment — the enchantment to return
- Template:NbtTemplate:Nbt: The level of the enchantment
enchantments_by_cost
Returns random enchantments from a list of possible enchantments, using a configured cost. SimilarTemplate:More info to the cost of an Minecraft:enchanting table.
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:Nbt: Template:Json ref/enchantment — set of all possible enchantments
- Template:NbtTemplate:Nbt: The cost to use to determine the enchantments
enchantments_by_cost_with_difficulty
Works the same way as Template:Cd but the cost is determined using the Minecraft:local difficulty of the area.
The effective cost is calculated by Template:Cd. Where:
- Template:Cd refers to a random number between Template:Cd and Template:Cd.
- Template:Cd is: Template:Cd clamped to a value between Template:Cd and Template:Cd.
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:Nbt: Template:Json ref/enchantment — set of all possible enchantments
- Template:Nbt: Minimum Template:Cd — The base cost at local difficulty below Template:Cd.
- Template:Nbt: Minimum Template:Cd —Factor of the uniform randomization range for local difficulty.
Usage
Enchantment providers are used by the game in specific cases listed below:
| Enchantment provider | Used for the enchantments of |
|---|---|
| Template:Cd | armor and weapons of a mob that spawns with enchanted equipment |
| Template:Cd | the enchanted Minecraft:crossbow of a spawned Minecraft:pillager |
| Template:Cd | the enchanted Minecraft:crossbow of a spawned Minecraft:pillager in waves 4 and 5 of a Minecraft:raid |
| Template:Cd | the enchanted Minecraft:crossbow of a spawned Minecraft:pillager in waves above 5 of a Minecraft:raid |
| Template:Cd | the enchanted Minecraft:axe of a spawned Minecraft:vindicator in waves 1 to 5 of a Minecraft:raid |
| Template:Cd | the enchanted Minecraft:axe of a spawned Minecraft:vindicator in waves above 5 of a Minecraft:raid |
| Template:Cd | the "fake tool" used in the loot tables of the block held by an Minecraft:enderman when killed. |
With villager trade rebalance
Template:Experimental Enchantment providers are used to determine the traded equipment depending on Minecraft:biome, Minecraft:profession, equipment (i.e. the item traded) and trading level. They follow the format Template:Cd.
Template:Navbox Java Edition technical
Minecraft:pt:Provedor de encantamento Minecraft:de:Verzauberungsanbieter Minecraft:fr:Fournisseur d'enchantement Minecraft:zh:魔咒提供器定义格式