Blacksmith icon

Blacksmith -----

Adds Blacksmith and Scrapper traits to Citizens NPCs



Adding the blacksmith trait
To make an NPC into a Blacksmith, select the NPC using
Code (Text):
/npc select
, then add the trait using
Code (Text):
/trait add Blacksmith


To make an NPC into a Scrapper, select the NPC using
Code (Text):
/npc select
, then add the trait using
Code (Text):
/trait add Scrapper


Commands
Code (Text):

| Command           | Arguments                     | Description                                                                                  |
|-------------------|-------------------------------|----------------------------------------------------------------------------------------------|
| /blacksmith       | \<option> \[new-value]        | Changes a configuration option for the selected blacksmith (use Citizens' /npc select first) |
| /blacksmithConfig | \<reload/option> \[new-value] | Changes a default/global blacksmith configuration value                                      |
| /scrapper         | \<option> \[new-value]        | Changes a configuration option for the selected scrapper (use Citizens' /npc select first)   |
| /scrapperConfig   | \<reload/option> \[new-value] | Changes a default/global scrapper configuration value                                        |
| /preset           | \<preset>\[:filter]           | Displays all materials included in the given preset, after applying the filter if set        |
 
For /blacksmith, /blacksmithConfig, /scrapper and /scrapperConfig, if a new value isn't specified, a description of the
configuration option, and the current value, is displayed instead.

For /blacksmith or /scrapper, using -1 or null as the value will clear a custom value, making the NPC use the default
value set in the config instead. Additionally, every value overridden for an NPC will display a marker (default: \[NPC])
when displaying the current value.

Note: basePrice, pricePerDurabilityPoint and enchantmentCost can be set like: `/blacksmithconfig option 4` or
like `/blacksmithconfig option material/enchantment 4` depending on whether you are setting the default or an override
for a specific material/enchantment. For /blacksmithconfig <basePrice/pricePerDurabilityPoint/enchantmentCost> <
material/enchantment>, using -1 or null as the value will clear the cost for the specified material/enchantment, using
the default one instead.

basePrice and pricePerDurabilityPoint support using a wildcard "*" to set the price for multiple groups of materials at
once. `/blacksmithconfig basePrice golden* 43` would set the price of any material starting with "GOLDEN" to 43. You can
also set `netherite*: 34` directly in the config file to set the price of all netherite materials to 34.

Presets and filters:

Presets are a nice way to make specialized blacksmiths / scrappers by specifying categories of materials, instead of
manually listing every material manually. They can only be used for the `reforgeAbleItems` and `salvageAbleItems`
options.


Note: All of these can be used when specifying reforge-able and salvage-able items, such as
"preset:weapon-smith:bow,preset:armor_smith:gold,PRESET:TOOL_SMITH,shield"

The format of reforge-able items requires each preset/material to be separated by a comma. If specifying a preset
instead of a material, start by typing "preset:". Then you can type BLACKSMITH, WEAPON_SMITH, ARMOR_SMITH or TOOL_SMITH.
If you want, you can add another colon and one of the filters supported by the preset.
For example: "preset:WEAPON_SMITH:BOW" to make the blacksmith only repair bows and crossbows. You can use the same
preset several times with different filters. For example: "
Code (Text):
preset:ARMOR_SMITH:DIAMOND,preset:ARMOR_SMITH:NETHERITE
"
would allow the blacksmith to repair all diamond and netherite armor.

Presets and filters can also be negated by applying a "-" character in front of the material name. For example,
"-SHIELD" would make shields unrepairable, even if included in a listed preset. "preset:WEAPON_SMITH,-SHIELD"
would allow the blacksmith to repair any weapon included in the WEAPON_SMITH preset except shields.
"preset:BLACKSMITH,-ELYTRA"would allow the blacksmith to repair any repairable item, except elytra. You can also negate
entire presets or filters. For example: "preset:blacksmith,-preset:armor-smith:diamond" would allow a blacksmith to
repair all items, except diamond armor.

All currently supported presets, and available filters for each preset:

Code (Text):

- BLACKSMITH (WEAPON_SMITH + ARMOR_SMITH + TOOL_SMITH)
    - GOLD (all gold armor, tools and weapons)
    - IRON (all iron armor, tools and weapons)
    - DIAMOND (all diamond armor, tools and weapons)
    - NETHERITE (all netherite armor, tools and weapons)
- WEAPON_SMITH: (RANGED + SWORD + SHIELD)
    - BOW (bows and crossbows)
    - SWORD (swords)
    - RANGED (bows, crossbows and tridents)
- ARMOR_SMITH: (HELMET + BOOTS + LEGGINGS + CHESTPLATE + ELYTRA)
    - LEATHER (all pieces of leather armor)
    - IRON (all pieces of iron armor)
    - CHAINMAIL (all pieces of chainmail armor)
    - GOLD (all pieces of gold armor)
    - DIAMOND (all pieces of diamond armor)
    - NETHERITE (all pieces of netherite armor)
    - HELMET (all helmets)
    - BOOTS (all boots)
    - LEGGINGS (all leggings)
    - CHESTPLATE (all chest-plates)
- TOOL_SMITH: (PICKAXE + AXE + HOE + SHOVEL + MISC)
    - WOOD (all wood tools)
    - STONE (all stone tools)
    - IRON (all iron tools)
    - GOLD (all gold tools)
    - DIAMOND (all diamond tools)
    - NETHERITE (all netherite tools)
    - PICKAXE (all pickaxes)
    - AXE (all axes)
    - HOE (all hoes)
    - SHOVEL (all shovels)
    - MISC (FISHING_ROD + SHEARS + FLINT_AND_STEEL)
 
Permissions
Code (Text):

| Permission node  | Description                                                                            |
|------------------|----------------------------------------------------------------------------------------|
| blacksmith.admin | Allows overall blacksmith and scrapper configuration.                                  |
| blacksmith.edit  | Allows changing settings for the selected blacksmith or scrapper NPC.                  |
| blacksmith.use   | Allows the player to repair items using blacksmiths and salvage items using scrappers. |
 
Configuration options

Plugin Options
Code (Text):

| Key      | Value type | Description                                                                                  |
|----------|------------|----------------------------------------------------------------------------------------------|
| language | string     | The language used for this plugin. Only "en" is supported, unless you add a custom language. |
 
Blacksmith global-only options
Code (Text):

| Key                       | Value type              | Default        | Description                                                                                                                                                                                                                                                                                                                                                            |
|---------------------------|-------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| basePrice                 | positive decimal number | default: 10.0  | The base price which has to be paid regardless of the durability remaining for an item. Setting this without specifying a material sets the basePrice for any item the basePrice has not been set for. You can use for example "netherite*: 10" to set the value for any material beginning with "netherite".                                                          |
| pricePerDurabilityPoint   | positive decimal number | default: 0.005 | The price added for each durability point present/missing (depends on whether natural cost is set to true or false). Setting this without specifying a material sets the pricePerDurabilityPoint for any item the pricePerDurabilityPoint has not been set for. You can use for example "netherite*: 10" to set the value for any material beginning with "netherite". |
| enchantmentCost           | positive decimal number | default: 5     | The added cost for each level of an enchantment present on the item. The cost can be set for specific enchantments. Not specifying an enchantment sets the value for all enchantments without a set value.                                                                                                                                                             |
| useNaturalCost            | true/false              | true           | If true, each missing durability will add to the cost (price = basePrice + missingDurability * pricePerDurabilityPoint + enchantmentCost). If false, durability will be used to calculate the cost instead of missingDurability (this was the behavior before natural cost was added). |
| showExactTime             | true/false              | false          | If true, blacksmiths will display exact time remaining in minutes and seconds, instead of vague expressions. |
| chippedAnvilReforgingCost | positive decimal number | 10.0           | The price for reforging a chipped anvil (slightly damaged). No other costs apply! |
| damagedAnvilReforgingCost | positive decimal number | 20.0           | The price for reforging a damaged anvil (very damaged). No other costs apply! |
 
Blacksmith per-npc (with default values set in config.yml)

Configuration values

Code (Text):

| Key                            | Value type                              | Default                               | Description                                                                                                                                                                                                                                                                                                                                        |
|--------------------------------|-----------------------------------------|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| dropItem                       | true/false                              | true                                  | Whether the blacksmith should drop the repaired item on the ground (instead of putting it into the player's inventory). |
| failReforgeChance              | 0-100                                   | 10                                    | The chance of the blacksmith failing to repair an item (further damaging it, or just repairing it a bit), and either removing or downgrading all enchantments (if failReforgeRemovesEnchantments is true). |
| failReforgeRemovesEnchantments | true/false                              | false                                 | Whether a failed reforge should remove or downgrade all enchantments on the item. |
| extraEnchantmentChance         | 0-100                                   | 5                                     | The chance of the blacksmith adding an enchantment to an item. |
| maxEnchantments                | 0-10                                    | 3                                     | The maximum number of different enchantments a blacksmith can add. |
| maxReforgeWaitTimeSeconds      | 0-3600                                  | 30                                    | The maximum number of seconds a player needs to wait for an item to be repaired. |
| minReforgeWaitTimeSeconds      | 0-3600                                  | 5                                     | The minimum number of seconds a player needs to wait for an item to be repaired. |
| reforgeCoolDownSeconds         | 0-3600                                  | 60                                    | The cool-down, in seconds, a player has to wait between each time they use one specific blacksmith. |
| reforgeAbleItems               | DIAMOND_LEGGINGS,GOLD-pickaxe,bow, etc. | [ ]                                   | Specifies which items this blacksmith is able to reforge. If set to "" or null, all normally repairable items can be repaired. If set to a list of items, only the items specified can be repaired. Some presets have been included for ease of use. Use a preset by specifying "preset:sword-smith" instead of a material such as "gold-pickaxe". |
| blacksmithTitle                | text string                             | blacksmith                            | The title displayed as part of the message explaining that a blacksmith doesn't recognize a player's held item  |
| enchantmentBlockList           | string list                             | binding_curse,mending,vanishing_curse | A string list of all enchantments a blacksmith should not be allowed to add to items.  |
| reforgeAnvils                  | true/false                              | false                                 | Whether to allow the blacksmith to reforge anvils. If enabled, chipped and damaged anvils will be replaced with a normal anvil.                                                                                                                                                                                                                    |
 
Messages
Code (Text):

| Message Key              | Default                                                                       | Explanation                                                                                                      |
|--------------------------|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| busyPlayerMessage        | &cI'm busy at the moment. Come back later!                                    | The message displayed when the blacksmith is serving another player.                                             |
| busyReforgeMessage       | &cI'm working on it. Be patient! I'll finish {time}!                          | The message displayed when the blacksmith is busy reforging an item.                                             |
| coolDownUnexpiredMessage | &cYou've already had your chance! Give me a break! I'll be ready {time}!      | The message displayed when the player has to wait for the cool-down to expire before using the blacksmith again. |
| costMessage              | &eIt will cost &a{cost}&e to reforge that &a{item}&e! Click again to reforge! | The message displayed when telling a player about the cost of repairing an item.                                 |
| failReforgeMessage       | &cWhoops! Didn't mean to do that! Maybe next time?                            | The message displayed when a blacksmith fails to reforge an item.                                                |
| insufficientFundsMessage | &cYou don't have enough money to reforge that item!                           | The message displayed when a player is unable to pay for reforging an item.                                      |
| invalidItemMessage       | &cI'm sorry, but I'm a/an {title}, I don't know how to reforge that!          | The message displayed when a blacksmith is presented an item which it cannot repair.                             |
| itemChangedMessage       | &cThat's not the item you wanted to reforge before!                           | The message displayed when a player changes their item after being shown the repair cost.                        |
| startReforgeMessage      | &eOk, let's see what I can do...                                              | The message displayed when a blacksmith starts reforging an item.                                                |
| successMessage           | There you go! All better!                                                     | The message displayed when a blacksmith successfully repairs an item.                                            |
| notDamagedMessage        | &cThat item is not in need of repair                                          | The message displayed if a player tries to reforge an item with full durability.                                 |
| noItemMessage | Please present the item you want to reforge | The message displayed when a blacksmith is clicked with an empty hand |
 
Scrapper global-only options
Code (Text):

| Key                   | Value type                                                 | Default                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|-----------------------|------------------------------------------------------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| salvagePrice          | positive decimal number                                    | 0                                                             | The cost of using a scrapper to salvage an item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| armorTrimSalvagePrice | positive decimal number                                    | 5                                                             | The cost of using a scrapper to remove armor trim from an item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| netheriteSalvagePrice | positive decimal number                                    | 15                                                            | The cost of using a scrapper to remove netherite from an item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| showExactTime         | true/false                                                 | false                                                         | If true, scrappers will display exact time remaining in minutes and seconds, instead of vague expressions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| giveExperience        | true/false                                                 | true                                                          | If true, each enchantment level on the salvaged item will give one EXP level as salvage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| trashSalvage          | TARGET_MATERIAL:IGNORED_MATERIAL\[,\*_TARGET2:\*_IGNORED2] | `"*_SHOVEL;*_PICKAXE;*_AXE;*_HOE;*_SWORD;SHIELD;*_BOW:STICK"` | The items that should be deferred when calculating partial salvage. Because receiving just the sticks when salvaging a diamond pickaxe is kind of sad, this allows specifying for example: `*_SHOVEL;*_PICKAXE;*_AXE;*_HOE;*_SWORD;SHIELD;*_BOW:STICK` (the default) for deferring sticks in salvage for shovels, pickaxes, axes, hoes and swords. A `:` character splits selected items and the trash salvage. Different item specifications are split by a `;` character. Use `,` to split separate trash salvages when using commands, like: `SHIELD:STICK,BOW_STRING`. |
 
Scrapper per-npc (with default values set in config.yml)

Configuration values
Code (Text):

| Key                       | Value type                              | Default  | Description                                                                                                                                                                                                                                                                                                                                      |
|---------------------------|-----------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| dropItem                  | true/false                              | true     | Whether the scrapper should drop the repaired item on the ground (instead of putting it into the player's inventory).|
| failSalvageChance         | 0-100                                   | 0        | The chance of the scrapper failing to salvage an item, either further damaging the item, partly repairing the item or causing some items to disappear.|
| salvageAbleItems          | DIAMOND_LEGGINGS,GOLD-pickaxe,bow, etc. | []       | Specifies which items this scrapper is able to salvage. If set to "" or null, all normally repairable items can be salvaged. If set to a list of items, only the items specified can be salvaged. Some presets have been included for ease of use. Use a preset by specifying "preset:sword-smith" instead of a material such as "gold-pickaxe". |
| maxSalvageWaitTimeSeconds | 0-3600                                  | 5        | The maximum number of seconds a player needs to wait for an item to be salvaged.|
| minSalvageWaitTimeSeconds | 0-3600                                  | 30       | The minimum number of seconds a player needs to wait for an item to be salvaged.|
| salvageCoolDownSeconds    | 0-3600                                  | 60       | The cool-down, in seconds, a player has to wait between each time they use one specific scrapper.|
| scrapperTitle             | text string                             | scrapper | The title displayed as part of the message explaining that a scrapper doesn't recognize a player's held item.|
| extendedSalvageEnabled    | true/false                              | false    | Whether to enable the extended salvage behavior for this scrapper. As long as it is allowed by salvageAbleItems and it can be crafted in a crafting table, it can be salvaged. This includes things like four planks salvaged into wood.                                                                                                         |
| salvageEnchanted          | true/false                              | false    | Whether the scrapper is able to salvage enchanted items. This is disabled by default as it's very easy to accidentally salvage heavily enchanted items if one is not careful.                                                                                                                                                                    |
| salvageArmorTrims         | true/false                              | true     | Whether the scrapper is able to salvage armor trims from items.                                                                                                                                                                                                                                                                                  |
| salvageNetherite          | true/false                              | true     | Whether the scrapper is able to salvage netherite items into diamond items.                                                                                                                                                                                                                                                                      |
 
Messages

Code (Text):

| Message Key                     | Default                                                                                 | Explanation                                                                                                                                                                                                         |
|---------------------------------|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| busyPlayerMessage               | &cI'm busy at the moment. Come back later!                                              | The message displayed when the scrapper is serving another player.                                                                                                                                                  |
| busySalvageMessage              | &cI'm working on it. Be patient! I'll finish {time}!                                    | The message displayed when the scrapper is busy salvaging an item.                                                                                                                                                  |
| coolDownUnexpiredMessage        | &cYou've already had your chance! Give me a break! I'll be ready {time}!                | The message displayed when the player has to wait for the cool-down to expire before using the scrapper again.                                                                                                      |
| invalidItemMessage              | &cI'm sorry, but I'm a/an {title}, I don't know how to salvage that!                    | The message displayed when a scrapper is presented an item which it cannot salvage.                                                                                                                                 |
| tooDamagedForSalvageMessage     | &cThat item is too damaged to be salvaged into anything useful                          | The message displayed when a scrapper is presented with an item too damaged to produce salvage.                                                                                                                     |
| successSalvagedMessage          | There you go!                                                                           | The message displayed when a scrapper successfully repairs an item.                                                                                                                                                 |
| failSalvageMessage              | &cWhoops! The item broke! Maybe next time?                                              | The message displayed when a scrapper fails to salvage an item.                                                                                                                                                     |
| failExtendedSalvageMessage      | &cWhoops! I was unable to extract much, if any, salvage! Maybe next time?               | The message displayed when a scrapper fails to salvage an item without durability (only relevant is extended salvage is enabled).                                                                                   |
| itemChangedMessage              | &cThat's not the item you wanted to salvage before!                                     | The message displayed when a player changes their item after being shown the salvage cost.                                                                                                                          |
| startSalvageMessage             | &eOk, let's see what I can do...                                                        | The message displayed when a scrapper starts salvaging an item.                                                                                                                                                     |
| insufficientFundsMessage        | &cYou don't have enough money to salvage an item!                                       | The message displayed when a player is unable to pay for salvaging an item.                                                                                                                                         |
| costMessage                     | &eIt will cost &a{cost}&e to salvage that &a{item}&e! {yield} &eClick again to salvage! | The message displayed when telling a player about the cost of salvaging an item.                                                                                                                                    |
| costMessageArmorTrim            | &eIt will cost &a{cost}&e to salvage that &a{item}&e's armor trim!                      | The message displayed when telling a player about the cost of salvaging an item's armor trim.                                                                                                                       |
| costMessageNetherite            | &eIt will cost &a{cost}&e to salvage that &a{item}&e into diamond!                      | The message displayed when telling a player about the cost of salvaging a netherite item into a diamond item.                                                                                                       |
| fullSalvageMessage              | &aI should be able to extract all components from that pristine item.&r                 | The message displayed as part of costMessage's yield placeholder if all components will be returned.                                                                                                                |
| partialSalvageMessage           | &cI cannot extract all components from that damaged item.&r                             | The message displayed as part of costMessage's yield placeholder if only some components will be returned.                                                                                                          |
| cannotSalvageEnchantedMessage   | &cI'm sorry, but I'm unable to salvage enchanted items!                                 | The message displayed when telling a player that the scrapper cannot salvage enchanted items.                                                                                                                       |
| cannotSalvageArmorTrimMessage   | &cI'm sorry, but I'm unable to salvage armor trims!                                     | The message displayed when telling a player that the scrapper cannot salvage items with armor trim.                                                                                                                 |
| armorTrimSalvageNotFoundMessage | &cI'm sorry, but I don't know how to salvage that armor trim!                           | The message displayed when telling a player that the scrapper cannot find the correct items to return as armor trim salvage. This will happen if more armor trim materials are added, or the Spigot API is changed. |
| cannotSalvageNetheriteMessage   | &cI'm sorry, but I'm unable to salvage netherite items!                                 | The message displayed when telling a player that the scrapper cannot salvage netherite items.                                                                                                                       |
| noItemMessage | Please present the item you want to reforge | The message displayed when a blacksmith is clicked with an empty hand |
 
Language customization

All strings, even time units, are customizable. If you place a strings.yml file in the plugin folder, it will take
priority over built-in languages. If you want to change strings, look at Blacksmith/src/main/resources/strings.yml for
the proper keys. All strings have the format: ENUM: "Displayed string". The enum must be identical as it defines which
string you have changed. All strings belonging to a language are beneath the language code and indented with two spaces.

The easiest way to add a new language is to copy an existing language and paste it into your custom strings.yml and
change strings as necessary. If you don't include all strings, the remaining will use the built-in English translation.
Remember to change the language code to whichever you use for your custom language.

The interval messages are unique in that if several values are separated by comma (option1,option2,option3), a random
message will be chosen each time it's displayed.
Resource Information
Author:
----------
Total Downloads: 483
First Release: Oct 26, 2022
Last Update: Aug 7, 2024
Category: ---------------
All-Time Rating:
3 ratings
Find more info at git.knarcraft.net...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings