Skip to main content
Your mob from My First Mob 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 NMEntities’ 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:
Read it like a sentence: what happens (narrate "Hello!"), when it happens (#onInteract, when someone right-clicks the mob), and who it happens to (@target, the person who clicked). 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:
Save, /nme 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:
Three different whens: right-click, taking damage, dying. And two different whos: the messages go to @target (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:
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:
Multiple options are separated by ;. And notice duration=5s: times can be written naturally, 5s, 2m, or plain numbers for ticks.

The full mob

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: