BlackSpigot

Guide MythicMobs metaskills: reuse a greeting and test a per-mob cooldown

  • Thread starter Thread starter BlackSpigot Guides
  • Start date Start date
B

BlackSpigot Guides

Guest
Why split the skill?
Start with the working WorkshopGuide pig from the first-mob guide. Moving its greeting into a named metaskill gives multiple mob definitions one place to share behavior. This example also makes a cooldown visible without using damage, timers or a complicated encounter.

1. Create the named skill
Create plugins/MythicMobs/Skills/workshop-skills.yml and add:
YAML:
WorkshopGreeting:
  Cooldown: 5
  Skills:
  - message{m="Welcome to the workshop. Try one small project first."} @trigger
Cooldown is in seconds. This metaskill’s cooldown belongs to the caster, so two players interacting with the same pig share its five-second waiting period. It is not a per-player rate limit. The metaskill reference documents the named skill structure and cooldown semantics.

2. Call it from the mob
In WorkshopGuide’s Skills list, replace the original direct message line with:
YAML:
- skill{s=WorkshopGreeting} @self ~onInteract
Do not keep both lines unless you intentionally want both messages. The mob calls the named skill when a player interacts. The message inside the skill explicitly targets @trigger, the player responsible for that interaction. It does not rely on the mob itself being a valid message recipient.

Reload MythicMobs and inspect the console. Spawn a new WorkshopGuide. Keep case and spelling identical: WorkshopGreeting in the skill call must match the skill’s top-level key. A valid YAML file can still contain an incorrect skill name, so successful text parsing is only the first check.

3. Run a reproducible cooldown test
Interact once: expect the greeting. Immediately interact again: expect no second greeting. Wait at least five seconds, then interact: expect it again. Repeat with two players on the same mob; the second player should encounter the same active cooldown. Spawn a second guide and test it independently. This distinguishes a caster cooldown from a global or per-player rule.

Write down what you actually observe, including plugin versions. If the greeting appears twice, look for both the old direct message and the new skill call, duplicate triggers, or another plugin producing similar text. If it never appears, first return to the direct-message example to establish that interaction works, then reintroduce the skill call.

4. Reuse it carefully
You can call WorkshopGreeting from another test mob’s onInteract trigger. Keep the message player-targeted. If you later call the same skill from a trigger without a player, @trigger may no longer identify a suitable message recipient; redesign the targeting for that trigger instead of assuming it is universal.

Add visual feedback only after this behavior is stable. A Model Engine state can be placed in a separate skill line targeting the modeled mob, while the message targets the interacting player. Cooldown and animation duration are different settings. Avoid adding a repeating timer just to implement a greeting: the interaction trigger already gives you a precise event.

A useful help report
Share the minimal mob definition, the named skill, the exact action sequence and the first relevant error, with sensitive details removed. Include whether one or two mobs were used. Those details make cooldown problems much easier to reproduce than a screenshot saying “it does not work.”

Configuration is based on the official mechanic contracts; the timed and multiplayer steps require a running server and are not claimed as completed here.
 
Top