Equipment
Creating equipment
Custom equipment (armor) can be registered via an EquipmentRegistry
:
@Init(stage = InitStage.PRE_PACK) // (1)!
object Equipment : EquipmentRegistry by ExampleAddon.registry {
val EXAMPLE = equipment("example") {
humanoid { // (2)!
layer { // (3)!
texture("example") // (4)!
emissivityMap("example_emissivity_map") // (5)!
dyeable(Color.WHITE) // (8)!
}
}
humanoidLeggings {
layer {
texture("example") // (6)!
emissivityMap("example_emissivity_map") // (7)!
}
}
}
}
- Nova will load this class during addon initialization, causing your armor to be registered.
- The type of equipment. You can also create equipment for horses, dogs, and more.
- You can layer multiple textures on top of each other. This layering is flat, there is no three-dimensional effect like for the player skin.
- The path to the texture. This resolves the file under
textures/entity/equipment/humanoid/example.png
- (optional) The path to the emissivity map. This resolves the file under
textures/entity/equipment/humanoid/example_emissivity_map.png
Black pixels are interpreted as not emissive, white pixels are interpreted as fully emissive. - The path to the texture. This resolves the file under
textures/entity/equipment/humanoid/example.png
- (optional) The path to the emissivity map. This resolves the file under
textures/entity/equipment/humanoid/example_emissivity_map.png
Black pixels are interpreted as not emissive, white pixels are interpreted as fully emissive. - (optional) Makes this layer dyeable and uses
Color.WHITE
if no dye is applied. Dyeable items also require theDyeable
item behavior.
After creating the armor, you can apply it to items using the Equippable
behavior:
Animated equipment
You can also create animated armor:
Equipment.kt
val EXAMPLE = animatedEquipment("example") {
humanoid {
layer {
texture(5, InterpolationMode.NONE, "frame_1", "frame_2", "frame_3") // (1)!
}
}
/* ... */
}
- Creates a non-interpolated animation that switches through the three defined frames every 5 ticks. Note that interpolation is achieved by pre-generating all interpolated frames, which may drastically increase resource pack size.
Compatibility with client-side rendering mods
Emissive textures are implemented via a core shader and are not compatible with shader mods.