AnvilCalc

v1.0.0
com.anvilcalc/anvilcalc Checked 4 days ago Published 1 month ago

Cheapest 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…

ParameterTypeDescription
item *object
sacrifice *object
editionstringMinecraft edition; defaults to 'java'
newNamestringDesired 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…
versionstringGame 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…

ParameterTypeDescription
sourceItem *object
targetItem *object
availableSourcesarrayThe 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…
editionstringMinecraft edition; defaults to 'java'
inventoryOnlyboolean"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/…
objectivestringWhat 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,…
versionstringGame version, e.g. '1.21.4'; defaults to the latest supported version for the chosen edition