Too Many Attributes
» Entity actions » Custom status effects

Custom status effects

A data pack can add its own status effects. Each one is a real status effect, so /effect and Origins' apply_effect, clear_effect and status_effect accept its id. While an entity has the effect, it holds the effect's powers. They're removed when the effect ends: it runs out, milk, /effect clear, or death.

Put each effect in data/<namespace>/effects/<name>.json. Its id is <namespace>:<name>.

FieldTypeDefaultDescription
typeStringrequiredbeneficial, harmful or neutral. Sets the color of its name on potion tooltips.
powersArray of power ids[]The powers an entity holds while it has the effect.
r, g, bFloat0The particle color, each from 0 to 1.
nameStringsee belowThe name shown in the inventory and on potions. A translation key, or plain text. Left out: the translation key effect.<namespace>.<name>.
iconIdentifiersee belowThe icon, as a sprite id. Left out: the effect's own id.
loading_priorityInteger0When several packs have the same effect file, the one with the highest priority is used.
  • Icons and names come from a resource pack. For an effect mypack:frost, put the icon at assets/mypack/textures/mob_effect/frost.png (18×18) and the name in a lang file as effect.mypack.frost. Every player needs the resource pack. Without it, the icon is the missing texture and the name is its translation key.
  • Power sources: the powers are granted under the source too-many-attributes:effect/<namespace>/<name>. /power remove with that source takes them off, but the effect gives them back only when it's applied again.
  • Changing the effect files: add, remove or change effect files and run /reload. Entities with an effect that was removed lose it, along with its powers. Changes to an effect's powers apply to everyone who has it.
  • Saving: entities and potions save custom effects by id, so changing the set of effect files never turns one effect into another. A saved effect whose file was removed is dropped when it loads.
  • An effect file can't reuse the id of an effect that already exists, like minecraft:speed.
  • Potions in commands: vanilla potion NBT names effects by number. Name a custom effect by id instead: /give @p potion{CustomPotionEffects:[{"too-many-attributes:effect":"mypack:frostbitten",Duration:600}]}.
  • Every player needs TMA installed, which is already the case.
  • From Overgrown's Apoli: the fields match. Overgrown saves custom effects by number only, so changing the set of effect files there needs the effects cleared first. TMA doesn't need that. Overgrown's config/apoli-effects.json switch isn't in TMA.

Example: "Frostbitten". data/mypack/effects/frostbitten.json, a harmful effect that holds two powers.

json
{
  "type": "harmful",
  "powers": [
    "mypack:frostbitten_slowness",
    "mypack:frostbitten_freeze_vision"
  ],
  "r": 0.55,
  "g": 0.85,
  "b": 1.0,
  "name": "Frostbitten"
}

Give it with /effect give @p mypack:frostbitten 30, or from a power:

json
{
  "type": "origins:apply_effect",
  "effect": {
    "effect": "mypack:frostbitten",
    "duration": 200
  }
}