AnvilCalc
v1.0.0Cheapest Minecraft anvil combine order and exact XP cost for Java and Bedrock Edition.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
anvil_combine_cost Anvil combine cost
Simulates exactly one Minecraft anvil operation — combining `item` (the base, left slot) with `sacrifice` (the right slot), optionally renaming the result — with no search or planning: it's a direct simulation of that specific in-game anvil use, not a 'find the cheapest way to reach X' query. Returns the XP-level cost, feasibility, and the resulting enchantments. A sacrifice enchantment the base item cannot take (e.g. Efficiency from a book onto a sword) is ignored by the anvil: cost 0, `transferred: false`. For finding the cheapest multi-step path from a current state to a target enchantm…
| Parameter | Type | Description |
|---|---|---|
item * | object | |
sacrifice * | object | |
edition | string | Minecraft edition; defaults to 'java' |
newName | string | Desired custom name for the result. A rename is included only if this differs from item.name (use '' to clear an existing name) — cost is a flat +1 XP level, the actual text has no effect on cost. O… |
version | string | Game version, e.g. '1.21.4'; defaults to the latest supported version for the chosen edition |
anvil_migration_path Anvil migration path
Compute the cheapest Minecraft anvil combine path to migrate an item's existing enchantments (and prior-work penalty count) to a target enchantment set. sourceItem and targetItem must be the same item id (e.g. both 'diamond_sword') — a mismatch is a tool error, not a silent conversion. Inventory usage is set by two optional inputs: with no availableSources the inventory is not used ("Don't use": every needed book/item is assumed obtainable); with availableSources the plan may use them when they help and assumes the rest is obtainable ("May use"); with inventoryOnly: true, which is never impl…
| Parameter | Type | Description |
|---|---|---|
sourceItem * | object | |
targetItem * | object | |
availableSources | array | The books/items the player already owns, i.e. the inventory. Omit it or pass [] for "Don't use": no inventory is provided, so the plan assumes every needed book/item is obtainable (a fresh single-ench… |
edition | string | Minecraft edition; defaults to 'java' |
inventoryOnly | boolean | "Only use": only if you set this to true (it is never implied, not even when availableSources is non-empty). The plan then considers only the items in availableSources (respecting each one's quantity/… |
objective | string | What to optimise. 'min_xp' (default) finds the plan with the fewest total XP levels. 'min_prior_work' finds the plan whose FINISHED item has the lowest prior-work count (fewest anvil operations on it,… |
version | string | Game version, e.g. '1.21.4'; defaults to the latest supported version for the chosen edition |