Mob Abilities
A guide to adding mob abilities
You can assign any mob in minecraft a custom mob ability that is executed when certain actions occur with Soul Metal tools. Every mob trait just contains a list of mob trait data that all get executed at once. Any mob trait can have an infinite amount of any kind of mob trait data.

Trait Types

These are all the default mob traits found in Spirit. Required fields are marked with Required. Optional fields shown in the code block indicate thier default value
(Required fields do not have default values)
The "type" field is also required, modders can define thier own types here. Since it is a resourcelocation/identifier, the mod prefix is required.
Damage
Potion Effect
Knockback
Explosion
Fire
{
"type": "spirit:damage",
"additionalDamage": 2.0
}
  • Required:"additionalDamage": float
    Specifies how much additional damage is done when a soul metal
{
"type": "spirit:potion_effect",
"effects": [
{
"effect": "minecraft:jump_boost",
"duration": 0,
"amplifier": 0,
"ambient": false,
"visible": true,
"showIcon": true
}
]
}
  • Required:"effects": array of effect
    Specifies all effects that will be applied when the mob trait is applied. You can technically have multiple potion mob trait data listed in the same mob trait, but there is really no need to because of this.
    • Required: "effect": string
      Specifies which potion effect is applied, minecraft prefix is required.
    • "duration": integer
      Specifies how long the potion effect lasts in ticks
    • "amplifier": integer
      Specifies level of the potion effect. The amplifier is added to the default level of 1, so only change this if you want higher levels of potion effects
    • "ambient": boolean
      Honestly dont know what this does lmao
    • "visible": boolean
      Specifies whether or not potion particles are visible
    • "showIcon": boolean
      Specifies whether or not potion icon shows in player's inventory
{
"type": "spirit:knockback",
"knockback": 2
}
  • Required:"knockback": integer
    Specifies how many additional levels of knockback are applied when the item interacts with an entity. Essentially, it applies this level of knockback/punch ontop of already existing enchantments.
{
"type": "spirit:explosion",
"power": 2.0,
"interaction": "NONE"
}
  • Required:"power": float
    Specifies how much additional damage is done when a soul metal
  • "interaction": string
    Specifies how the explosion will interact with nearby blocks Possible values (must be written exactly as stated, as fully uppercase):
    • "NONE" No damage to nearby blocks
    • "BREAK" Breaks nearby blocks and drops them
    • "DESTROY" Breaks and destroys blocks and their drops
{
"type": "spirit:fire",
"burnTime": 7
}
  • "burnTime": int
    Specifies how long mobs burn for when hit with fire in seconds

Register Mob Trait

Mob traits can be specified for any mob by creating a new json file in your recipes folder.
An example of a mob trait:
{
"type": "spirit:mob_trait",
"entity": "minecraft:warden"
"traits": [
{
"type": "spirit:potion_effect",
"effects": [
{
"effect": "minecraft:darkness",
"duration": 150
},
{
"effect": "minecraft:slowness",
"duration": 100
}
]
},
{
"type": "spirit:knockback",
"knockback": 2
},
{
"type": "spirit:damage",
"additionalDamage": 2.5
},
{
...
}
]
}
  • Required:"entity": string
    Specifies the mob id of the mob that is required in the soul crystal to activate the specified effects
  • Required:"traits": array of traits
    Specifies all traits that are applied when a tool is used and the soul is consumed
Copy link
On this page
Trait Types
Register Mob Trait