Skip to content

editor defense types

goflishMC edited this page Jun 28, 2025 · 3 revisions

🛡️ Editor: Defense Types

The Defense Types editor option allows you to assign resistances to specific types of incoming damage (e.g., Fire, Poison, Slashing). These defense types are user-defined and offer flexible customization.


📁 Where Defense Types Are Defined

Defense types are configured in:

plugins/Divinity/item_stats/defense.yml

➡️ For setup details, see: item_stats-defense

📄 Example (defense.yml)

slashing:
  priority: 100
  name: Slashing Defense
  format: ' &7Gives %value% %name%'
  block-damage-types:
  - slashing
  protection-factor: 0.7

⚙️ What the Editor Lets You Modify

In the Item Generator Editor:

  • Choose which defense types can roll
  • Set chance and range for each one
  • Enable level-scaling
  • Control flat-range and rounding
  • Set minimum and maximum number of defenses per item
  • Customize lore display order

📄 Example (Item Generator File)

defense-types:
  minimum: 1
  maximum: 2
  lore-format:
    - '%DEFENSE_POISON%'
    - '%DEFENSE_WATER%'
    - '%DEFENSE_WIND%'
    - ''
    - '%DEFENSE_SLASHING%'
    - '%DEFENSE_PIERCING%'
  list:
    poison:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    water:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    wind:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    slashing:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false
    piercing:
      chance: 0.0
      scale-by-level: 1.0
      min: 0
      max: 0
      flat-range: false
      round: false

🧾 Explanation of Fields

Field Description
minimum / maximum Number of defense types to roll.
chance % chance for each defense type to roll.
scale-by-level Multiplies the value by the item level.
flat-range If true, no randomness — uses fixed value.
round Rounds the result to whole number if true.
lore-format Controls display order in item lore.

🔧 Placeholders

%DEFENSE_{TYPE}%

Examples:

  • %DEFENSE_FIRE%
  • %DEFENSE_POISON%

🧪 Use Case

  • Create gear with elemental resistances
  • Balance PvE gear for specific encounters
  • Add unique mechanics like poison immunity

Return to: Item Generator Module

Clone this wiki locally