Home Data format
Data format
Cancel

Data format

⚠️This page is Work in Progress! ⚠️ If you’re looking for developmental help or want to shape the roadmap, you can join us on Discord:

Patterns, Parts, and Materials

Patterns, Parts, and Materials are all data-registered files, under data/<namespace>/irons_jewelry/<dir> for your namespace and the respective pattern, part, and material directories.

Patterns

Patterns are the blueprint for a complete piece of jewelry. Patterns can be unlocked by the player by default, or not. Unlocking a pattern requires learning from an Artisan Scroll item, which generate as loot and as villager trades. In order for patterns you create to drop in loot or trades, you must add your pattern to the respective pattern tags. Some of those tags include:

Patterns are composed of part ingredients (part definitions combined with material costs) and determine the bonus a worn piece of this jewelry will provide. This is where the generic buffs are assigned, such as “this ring provides an attribute”.

  •  PatternDefinition :
    •  descriptionId : String denoting language file entry
    •  type : ResourceLocation pointing to a registered JewelryType
    •  unlockedByDefault : (Optional) (Default: true) Whether this pattern is always available in the jewelcrafting station, or must be unlocked before it can be crafted
    •  qualityMultiplier : (Optional) (Default: 1.0) Multiplies overall quality of the buffs received from a completed item of this pattern
    •  partForQuality : (Optional) ResourceLocation used to specify which part of the pattern will determine the overall quality. If absent, the base quality is 1.0
    •  parts : Array of PartIngredient
      •  PartIngredient : PartIngredient object
        •  id : ResourceLocation of PartDefinition
        •  materialCost : Count of items required to craft this part in the jewelcrafting station
        •  drawOrder : Sort order for drawing this sprite. Lower numbers are drawn first (appear at the bottom)
        •  bonuses : (Optional) Array of Bonus
          •  Bonus : Object holding data to construct a buff for this jewelry piece when worn
            •  bonusType : ResourceLocation used for BonusType registry
            •  qualityMultiplier : Multiplies overall quality of the buff received from this bonus
            •  cooldown : (Optional) QualityScalar providing a cooldown in ticks. Not all bonuses utilize cooldowns.
            •  parameterType : (Optional) Tuple<ParameterType<T>,T>. If present, overrides the bonus parameter that would have been selected from the material this part is made out of.

Part Definitions

Part Definitions are the definitions for the individual components that can be used to construct a piece of jewelry. These mostly hold rendering information, but also what materials are allowed to make this part.

  •  PartDefinition :
    •  descriptionId : String denoting language file entry
    •  paletteKey : ResourceLocation to a texture file that is the palette key for this part's texture
    •  allowedMaterialTypes : (Optional) List of strings
      •  String : A material must have at least one matching type in order to be allowed to be used to construct this part.
    •  baseTextureLocation : ResourceLocation to a texture file of this part's texture

Material Definitions

Material Definitions associate ingredient items with a material that can be used in jewelcrafting. Defined here are the specific bonus parameters the material awards, as well as rendering information. A material can host multiple parameter entries, which are used as input for the overall pattern’s bonus. For example, if a ring pattern grants an attribute bonus, the material of the ring provides the specific attribute.

  •  MaterialDefinition :
    •  descriptionId : String denoting language file entry
    •  ingredient : Ingredient for what items are used to create this material
    •  allowedMaterialTypes : List of strings
      •  String : A material must have at least one matching tr in order to be allowed to be used to construct this part.
    •  paletteLocation : ResourceLocation pointing to the palette texture file for this material
    •  quality : Quality value associated with this material.
    •  bonusParameters : Map<ParameterType<T>,T>
      •  ResourceLocation : Points to the ParameterType entry
        •  Bonus Parameter Value : Definition of a Parameter Type's value

Quality Scalars

Throughout many other schemas, you will see Quality Scalars. This is a number provider that scales based on the quality of a piece of jewelry. It can scale positively or negatively, such as a buff duration or cooldown time. The sampled number has the formula: base + (q - 1) * scalar for some input quality q.

  •  QualityScalar : A provider of a double that scales based on an input quality.
    •  base : Initial amount
    •  scalar : Amount that increases with respect to the bonus's quality
    •  min : (Optional: default 0.0) Minimum magnitude for the scalar's quantity when sampled
    •  max : (Optional) Maximum magnitude for the scalar's quantity when sampled

Registered Types

Jewelry Types

Jewelry Types provide the association between a pattern and an item. Custom jewelry types can be registered through code.

  • irons_jewelry:ring
  • irons_jewelry:necklace

Bonus Types

Bonus types are registered behaviors that execute on an input bonus parameter. Custom bonus types can be made through code.

  • irons_jewelry:piglin_neutral_bonus
    • Utilizes irons_jewelry:empty parameter type
    • Makes piglins neutral to the wearer
  • irons_jewelry:attribute_bonus
    • Utilizes Attribute parameter type
    • Provides an attribute modifier to the wearer
  • irons_jewelry:effect_on_hit_bonus
    • Utilizes Positive Effect parameter type
    • Applies a mob effect to wearer when the wearer hits an entity
  • irons_jewelry:on_projectile_hit_bonus
    • Utilizes Action parameter type
    • Executes an action when the wearer hits an entity with a projectile
  • irons_jewelry:on_attack_bonus
    • Utilizes Action parameter type
    • Executes an action when the wearer attacks an entity directly
  • irons_jewelry:effect_immunity_bonus
  • irons_jewelry:on_shield_block_bonus
    • Utilizes Action parameter type
    • Executes an action when the wearer blocks an attack with a shield
  • irons_jewelry:on_take_damage_bonus
    • Utilizes Action parameter type
    • Executes an action when the wearer takes damage

Bonus Parameter Types

Bonus Parameter Types are a registered type object associated with a data class. This data class is used as context for the behavior of a bonus type. The instances of these data objects live on the material definition, which are picked based on the material a jewelry is made out of.

Bonus Parameter Values

Attribute Instance

  •  AttributeInstance : Object holding the information to build an attribute modifier for a piece of jewelry
    •  attribute : ResourceLocation pointing to an Attribute
    •  amount : Value given by this attribute
    •  operation : add_value | add_multiplied_base | add_multiplied_total

Effect Parameter

  •  EffectParameter : Object providing a MobEffect for the bonus to utilize
    •  effect : ResourceLocation pointing to a MobEffect

Action Runnable

  •  ActionRunnable : Object holding the information to run an action to the bonus's specifications
    •  applyToSelf : Whether the action should target the wearer, or the causal entity
    •  action : Action object
      •  type : ResourceLocation pointing to a registered action
      •  Action : Definition of any registered action schema

Actions

Action are special buffs that, when triggered, actually do something. Custom Actions can be registered through code. The following actions exist by default:

  • irons_jewelry:knockback (See Knockback schema)
  • irons_jewelry:ignite (See Ignite schema)
  • irons_jewelry:apply_effect (See Apply Effect schema)
  • irons_jewelry:apply_damage (See Apply Damage schema)
  • irons_jewelry:apply_freeze (See Apply Freeze schema)
  • irons_jewelry:heal (See Heal schema)
  • irons_jewelry:explode (See Explode schema)
  • irons_jewelry:create_items (See Create Items schema)

Action Schemas

Knockback

  •  KnockbackAction : Root Object Desc
    •  strength : QualityScalar representing the strength of the knockback. Negative values pull entities inwards.

Ignite

  •  IgniteAction : Root Object Desc
    •  tickDuration : QualityScalar representing the duration of the ignition in ticks

Apply Effect

  •  ApplyEffectAction : Root Object Desc
    •  duration : QualityScalar of the effect's duration
    •  amplifier : QualityScalar of the effect's amplifier
    •  effect : ResourceLocation pointing to an object of type MOB_EFFECT

Apply Damage

  •  ApplyDamageAction : Root Object Desc
    •  damageType : ResourceLocation of a DamageType
    •  amount : QualityScalar of the amount of damage done
    •  maximum : (Optional) Damage value cap
    •  sound : (Optional) ResourceLocation of a SoundEvent. If present, the sound is played when damage occurs.

Apply Freeze

  •  ApplyFreezeAction : Root Object Desc
    •  amount : QualityScalar representing the freeze amount
    •  instaFreeze : (Optional) Whether the freeze effect is instant; defaults to false

Heal

  •  HealAction : Root Object Desc
    •  amount : QualityScalar representing the amount of healing

Explode

  •  ExplodeAction : Root Object Desc
    •  affect_self : (Optional: default true) Whether the wearer should be affected by the knockback and/or damage of the explosion
    •  attribute_to_user : (Optional: default false) Whether the wearer should set as the owner/causing entity of the explosion
    •  translation : Description ID of the name of this explosion, used in the tooltip
    •  damage_type : (Optional) ResourceLocation pointing to a DamageType. If present, the explosion will deal damage of this type
    •  knockback_multiplier : (Optional) QualityScalar that will multiply the received knockback of affected entities
    •  immune_blocks : (Optional) Holder set of ResourceLocation that point to blocks which will not be affected by terrain damage, if this explosion does terrain damage
    •  offset : (Optional) Vec3 to offset the origin point of the explosion
    •  radius : QualityScalar of the radius of the explosion. This affects damage
    •  create_fire : (Optional: default false) Whether the explosion should light the area on fire
    •  block_interaction : none | block | mob | tnt | trigger
    •  small_particle : ResourceLocation pointing to a ParticleType to be played on explosion
    •  large_particle : ResourceLocation pointing to a ParticleType to be played on explosion
    •  sound : ResourceLocation pointing to a SoundEvent to be played on explosion

Create Items

  •  CreateItemsAction : Root Object Desc
    •  chance : (Optional) QualityScalar representing the chance to create items
    •  item : ResourceLocation pointing to an object of type ITEM
    •  sound : (Optional) ResourceLocation pointing to an object of type SOUND_EVENT
    •  minCount : QualityScalar representing the minimum count of items to create
    •  maxCount : QualityScalar representing the maximum count of items to create
Contents