This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Function Repair
Phoenix Nemo edited this page Sep 19, 2016
·
3 revisions
Consume specific material and experience to regain durability.
/nu repair add [item] [material] [fullRepairCostAmount] [expCostPerConsume] [enchantCostPerLv] [repairTimesLimit]
Add a repairable item. Note [item]
can be something like WOOD_AXE
and all wooden axes will be applied to this rule, no matter name, lore, enchantments or NBT tags. [material]
can be something like WOOD
and ignores any attribute as well.
-
[fullRepairCostAmount]
is the amount of material needed to fully repair an item with no enchantments. -
[expCostPerConsume]
is the amount of exp to consume on each material consume. -
[enchantCostPerLv]
is the modifier to increase repair cost based on enchantment level summary. -
[repairTimesLimit]
is the limitation of time that an item can be repaired using this plugin. A NBT tag will be written in item to implement limitation per specific item.
/nu repair info
Hold the item to be repaired and type this command will print information about repairing.
/nu repair hand
Consume one material to repair.
/nu repair full
Repair item to full durability, or consume max possible materials/exp to regain max durability.
-
nu.addrepair
- Add a repairable item, defaults to op. -
nu.repair
- Repair an item, access to repair information.
File repair.yml
is controlled in-game, please use command to add/edit, DO NOT modify this file directly unless you know what you are doing.
IRON_SWORD:
material: IRON_INGOT
fullRepairCost: 2
expCost: 2
enchantCostPerLv: 0.3
repairLimit: 0
DIAMOND_SWORD:
material: DIAMOND
fullRepairCost: 2
expCost: 2
enchantCostPerLv: 0.4
repairLimit: 3
- This configuration content is an example. Default should be an empty file.
E.g., set diamond sword to be repairable. Command:
/nu repair add DIAMOND_SWORD DIAMOND 2 2 0.5 0
Explanation:
- To fully repair an diamond sword with no enchantment require 2 diamonds, every diamond consumption cost 2 points of exp. Enchantment cost modifier is
0.5
and no repair time limitation applied so no NBT will be written to item. - If the diamond sword (vanilla durability 1561) is enchanted with
sharpness III
anddurability I
, then enchantment summary is1 + 3 = 4
so each diamond consumption getsfloor(1561 / (2 + 2 * 0.5)) = 520
durability regain, and costsfloor(2 + 0.5 * 4) = 4
points of exp.
- Hold the item to be repaired in main hand
- Command
/nu repair info
to get repair information - Hold required material in off hand
- Command
/nu repair hand
execute 1 repair and consumes 1 material, or/nu repair full
to execute a full repair, costs all material and exp needed. If material/exp is insufficient, on any of the requirements fails the repair will stop so you will get max possible durability regain.