Gear Parts - SilentChaos512/Silent-Gear GitHub Wiki
Valid Versions
This format is valid for Minecraft 1.14.4 and 1.15.2 only.
For Minecraft 1.16.1 and up, see the page on materials: https://github.com/SilentChaos512/Silent-Gear/wiki/Materials
Introduction
Gear parts are items which as used to construct Silent Gear tools, weapons, and armor. There are a few different types of parts. The most notable are mains, which are used to craft tool heads and are typically the sole part used to craft armor. Other types include rods, grips, bindings, bowstrings, and tip upgrades. See the part types page (under Related Pages below) for a complete list.
Specification
This is an outline of the JSON format. Many items are described in greater detail below.
type
(string) - Part type (serializer)stats
(array) - Stat modifiers- (object)
name
(string) - Stat namevalue
(float) - Modifier valueop
(string, optional, defaults to AVG) - Modifier operator (AVG, ADD, MUL1, MUL2, MAX)
- (object)
traits
(array) - Traits- (object)
name
(string) - Trait IDlevel
(int) - Trait levelconditions
(array, optional) - Conditions for trait to apply to gear items
- (object)
crafting_items
(object)normal
orcustom_tipped_upgrade
oruncraftable
(object)small
(object, optional)
name
(object or string)text
ortranslate
name_prefix
(object or string)text
ortranslate
textures
(object, variable number of properties) - Display propertiesall
or any gear type (object)lite_texture
(string)- low_contrast or high_contrast
highlight
(boolean) - Applies a "shine" layer on top of "high_contrast" main partstexture_domain
(string)texture_suffix
(string)armor_texture
(string) - Prefix of armor texture path. Defaults to the value oftexture_suffix
. Can be left out in most cases.normal_color
(string)broken_color
(string) - Defaults to the value ofnormal_color
fallback_color
(string) - Defaults to the value ofbroken_color
armor_color
(string) - Color of the worn armor model (separate from item color). Defaults to the value offallback_color
. Can be left out in most cases.
availability
tier
(int)gear_blacklist
(array) - Gear types this part is not allowed to craftvisible
(boolean) - If false, the part may be hidden from players in some cases
Related Pages
Stat and Traits
Parts have a set of stat modifiers and traits. When a tool, weapon, or armor item (collectively called "gear items") is crafted, its stats and traits are based on the stats and traits of all the parts it was made with, including upgrades that were added later on. Stats and traits are "recalculated" occasionally, typically when the item is modified or damaged past a certain point. Other events may trigger recalculations as well.
In the JSON files, stat modifiers are in the
stats
array, and traits are in thetraits
array. These arrays may contain any number of objects, or may be left empty.
Crafting Items (Materials)
Parts are associated with certain items, sometimes called their crafting items, or materials. Most parts are defined with a "normal" and possibly a "small" crafting item, but only the normal one is currently used. Crafting items consist of an ingredient (same as in recipes) or an array of ingredients.
In the JSON files, crafting items are specified inside the
crafting_items
object. Thenormal
object inside this one is required, while thesmall
object is not.
Custom Tipped Upgrades
If you are trying to add new tipped upgrades, but don't have an item to use for them, you can use custom tipped upgrades. You cannot use the same item for multiple parts after all. For these, the crafting items should consist of an empty custom_tipped_upgrade
object. The item is inferred, so nothing you add to this object will change anything.
"crafting_items": {
"custom_tipped_upgrade": {}
}
Note you will also need to add a recipe for the upgrade item. The type of recipe is up to you, anything that allows NBT to be set on the result will work. You must set PartID
in the NBT to your tipped upgrade's part ID.
"result": {
"item": "silentgear:custom_tipped_upgrade",
"nbt": {
"PartID": "your_namespace:tip/your_part_name"
}
}
Uncraftable Parts
If you want a part to be unobtainable through crafting, just add an empty uncraftable
object as shown below. Uncraftable parts will still exist, and can be added to gear with commands or loot tables. But no items will be associated with the part.
"crafting_items": {
"uncraftable": {}
}
Name
The name
object controls... the name of the part. This is currently handled the same way as vanilla handles text (like in advancements). An object with a single text
property is usually the best option for data pack custom parts. Mods should use translate
.
"name": {
"text": "This Is My Name!"
}
Old Name Format
For custom parts, you will want to set it to not translate ("translate": false
) the name and type in the name as you want it to appear. Mods should preferably translate names, so enter a key from your lang file and set translate
to true
.
"name": {
"translate": false,
"name": "This Is My Name!"
}
Name Prefix
You can attach a prefix to the name of items that use a particular part with a name_prefix
object. For example, rough rods will attach a "Crude" prefix to the item name. This feature should be used sparingly. Available in version 1.3.10+. The JSON format is the same as name
.
Textures (Display Properties)
The appearance of parts are controlled in the JSON files as well. Parts can optionally have their own unique textures. A few "generic" textures are included for custom parts to make use of.
In Minecraft 1.14+, the object is called textures
. In 1.12.2, it is called display
. This object can contain a variable number of objects which let you set different properties per gear type. An all
object should be included in all part files. This will apply to an gear item without more specific settings. Another commonly used object is armor
which will override for all armor types. You can also have objects for specific gear types, though this is rarely needed.
Notes on Models
(1.12.2) Silent Gear uses dynamic, multi-layer models for rendering tools. These models are considerably slower than normal vanilla models due to their complexity, but are reasonably well-optimized for what they are. Performance is at least on par with similar mods. Still, having a large number (as in many dozens or even hundreds) of tools (or tool heads in 1.12.2) on-screen will hit FPS pretty hard.
(1.14+) At time of writing (version 1.3.2), Forge is still missing a chunk of its model system. Tools are using simpler "lite models" which do not render all parts and cannot use custom textures. I am aware of this and there is nothing I can do until Forge finishes their update. On the plus side, these models are probably much easier on your FPS! When/if the old system is implemented again, there will be a config to use lite models instead.
SIDE NOTE: Honestly, the lite models are pretty good as they are now. Most tools "look right" with the 1.3.2 update. The major downside being that the models are limited to just five layers, and adding new layers and texture options grows the model JSON files exponentially...
Lite Textures
1.14+ is currently missing the older, more powerful model system. The simpler models (called "lite models") have a very limited set of textures. The texture can be changed using the lite_texture
property, but only for mains and rods right now. The options are low_contrast
and high_contrast
. The highlight
property (mains only) will apply a semi-transparent "shine" layer on top of most tools. Brightly-colored parts made from gems or ingots typically use high contrast with highlight, while duller materials like wood or stone use low contrast without highlight.
These are the supported textures by part type:
- main: low_contrast, high_contrast (plus "highlight")
- rod: low_contrast, high_contrast
- grip: low_contrast
- tip: high_contrast
- bowstring: low_contrast
Picking Textures (Old System)
Silent Gear separates texture paths into two parts, domain and suffix (this is because the actual path to the texture is more complex, but the gear and part type determine the rest). The domain will typically be silentgear
. A few textures are included specifically for custom parts. These are gray-scale textures which you can apply a color to. The generic_hc
are "high contrast" textures which tend to make shiny-looking items. generic_lc
is "low contrast" and looks duller. iron
is also suitable for custom parts, and lands somewhere between the "hc" and "lc" textures.
Available textures:
- main: generic_hc, generic_lc, or iron
- rod: generic_hc, generic_lc, or iron
- tip: iron
- grip: wool
- binding: generic
Colors
There are four color properties: normal_color
, broken_color
, fallback_color
, and armor_color
. Typically, you will only need the normal color. The broken color defaults to normal, and fallback defaults to broken. The broken color is used when the item is broken. Fallback is used when lite models are being used. Armor color affects the armor model's color, not the item.
Colors can be either hex codes (with optional leading '#'), or CSS color names (case-insensitive, no spaces or symbols, just letters). Examples: "#8B4513" or "saddlebrown".
An Example
An example textures object, containing both properties for the old model system and lite models.
"textures": {
"all": {
"lite_texture": "high_contrast",
"highlight": true,
"texture_domain": "silentgear",
"texture_suffix": "generic_hc",
"normal_color": "red",
"broken_color": "#FF0000"
}
}
Adding Parts
Silent Gear allows users to add additional parts using JSON files. These parts can reference any item, tag (1.13+), or ore dictionary entry (1.12.2) from any mod. You can fully customize their stats and traits as well. The file format and the location the files need to be differ between Minecraft 1.14+ and 1.12.2, so make sure to read the correct section!
Examples:
Silent Gear's builtin parts are found here: 1.15.x | 1.14.x | 1.12.2
Silent's Gems' part files are found here: 1.15.x | 1.14.x | 1.12.2
Minecraft 1.14.x and Higher
Parts can be added with data packs. This means adding additional part could be as simple as downloading a ZIP file and placing it in your world's data pack folder. Of course, you can also create and distribute these files yourself.
To create new parts, place the JSON files in data/*/silentgear_parts
, where *
is the namespace of your data pack. Choose a unique namespace to prevent accidentally overriding other parts. You can further organize your files into folder if you like. Silent Gear has a folder for each part type, as you can see here.
If your goal is to override existing parts, place the files in the same path in your data pack as the original file. For example, to override iron mains, you would place your modified file at data/silentgear/silentgear_parts/main/iron.json
.
Parts are intended to sync with clients when connecting to a server. When hosting a dedicated server, simply add the data pack to the server. Clients should download any relevant information when connecting. If clients receive an error message when attempting to join, something may have gone wrong with this process.
Minecraft 1.12.2
Parts are added in the config folder. All part files should be placed in config/silentchaos512/silentgear/materials
. Files should be named type_name.json
, where type
is the part type and name
is a unique name to identify the part.
In order for clients to see parts correctly, the client must have an exact copy of the part files on the server. No data is sent from the server to the client.