> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# My First Effect

> Give your mob personality: greetings, reactions and a dramatic death.

Your mob from [My First Mob](https://entities.lodemc.net/my-first-mob.md) exists, but it's silent. In this tutorial you'll give it personality: it will greet players, complain when hit, and go out with a bang. Along the way you'll learn the one line format that all of LodeEntities' effects are built on.

## The idea

An effect is a small action your mob performs when something happens. Every effect is one line with up to three parts:

```text theme={null}
narrate "Hello!"   +onInteract   @trigger
```

Read it like a sentence: **what** happens (`narrate "Hello!"`), **when** it happens (`+onInteract`, when someone right-clicks the mob), and **who** it happens to (`@trigger`, whoever caused it: here, the person who clicked).

If you've written MythicMobs skills, this is the same language: the mechanics, targeters and conditions you know work here under the same names.

That's the whole format. Everything else is learning more whats, whens and whos.

## 1. Make it greet

Open your mob's file and add an `effects:` list:

```yaml theme={null}
toast:
  model: toast
  base: zombie
  display: "&6Sir Toast"
  health: 40
  effects:
  - narrate "&7Sir Toast greets you!" +onInteract @trigger
```

Save, `/le reload`, spawn a fresh one and right-click it. It talks!

> Changes never apply to mobs that are already in the world. After every reload, spawn a new one to see the difference.

## 2. Make it react

Add two more lines:

```yaml theme={null}
  effects:
  - narrate "&7Sir Toast greets you!" +onInteract @trigger
  - narrate "&cOw! How dare you!"     +onHurt     @trigger
  - lightning                         +onDeath    @self
```

Three different **whens**: right-click, taking damage, dying. And two different **whos**: the messages go to `@trigger` (whoever caused it), the lightning strikes `@self` (the mob's own position).

Reload, spawn, and go pick a fight with Sir Toast.

## 3. Make it fight back

Messages are nice, actions are better. Give him thorns:

```yaml theme={null}
  - damage{amount=2} +onHurt @trigger
```

New things here: `damage` is a mechanic that takes an option, and options go in curly braces right after the name: `{amount=2}`. That's 2 damage, one heart, to whoever hits him.

One more, a poison bite when he attacks:

```yaml theme={null}
  - potion{type=poison;duration=5s;level=1} +onAttack @trigger
```

Multiple options are separated by `;`. And notice `duration=5s`: times can be written naturally, `5s`, `2m`, or plain numbers for ticks.

## The full mob

```yaml theme={null}
toast:
  model: toast
  base: zombie
  display: "&6Sir Toast"
  health: 40
  effects:
  - narrate "&7Sir Toast greets you!"       +onInteract @trigger
  - narrate "&cOw! How dare you!"           +onHurt     @trigger
  - damage{amount=2}                        +onHurt     @trigger
  - potion{type=poison;duration=5s;level=1} +onAttack   @trigger
  - lightning                               +onDeath    @self
```

A mob that greets, retaliates, poisons and dies dramatically. Five lines.

## What you've learned

* Every effect is **mechanic + trigger + targeter**: what, when, who.
* Mechanics take options in `{key=value;key=value}` blocks.
* Times can be written as `5s`, `2m` or ticks.
* Reload, then spawn fresh: existing mobs keep their old behavior.

## Where to go next

You now know enough to explore the whole Effects section:

* [How Effects Work](https://entities.lodemc.net/overview.md) formalizes what you just learned.
* [Triggers](https://entities.lodemc.net/triggers.md) and [Targeters](https://entities.lodemc.net/targeters.md) list every when and who.
* [All Mechanics](https://entities.lodemc.net/mechanics.md) is the full catalog of whats, and [Conditions](https://entities.lodemc.net/conditions.md) every if.
* If a line doesn't do anything, [`/le debug`](debug) tells you which part of it is wrong.
* And when you're feeling brave: [Building a Boss](https://entities.lodemc.net/building-a-boss.md) turns these same ingredients into a two-phase raid boss.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.