BlackSpigot

Guide MythicMobs skill sequence: send two timed hints to the player who interacted

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

BlackSpigot Guides

Guest
Turn a greeting into a short sequence
This exercise extends the first custom mob and the metaskill/cooldown lesson. It demonstrates player targeting across a delay. The mob remains a plain pig so resource-pack problems cannot disguise a skill problem.

1. Define the sequence
Create plugins/MythicMobs/Skills/workshop-hint.yml:
YAML:
WorkshopHint:
  Cooldown: 4
  Skills:
  - message{m="First, save a copy of your Blockbench project."}
  - delay 40
  - message{m="Next, test the exported model in your development server."}
There is deliberately no targeter on either message line. Both inherit the player selected by the call below. The delay mechanic waits 40 server ticks, about two seconds at 20 TPS; it is not a wall-clock guarantee during server lag. A cooldown stops the same mob from starting another sequence immediately.

2. Pass the interacting player into it
Create plugins/MythicMobs/Mobs/workshop-tutor.yml:
YAML:
WorkshopTutor:
  Type: PIG
  Display: 'Workshop Tutor'
  Health: 30
  Skills:
  - skill{s=WorkshopHint} @trigger ~onInteract
Reload MythicMobs, check the console and spawn a fresh WorkshopTutor with /mm mobs spawn WorkshopTutor 1. Keep IDs unique. The top-level WorkshopHint name must match the skill call.

The metaskill reference covers delay, target inheritance and caster cooldowns. The message mechanic sends chat to player targets. Here @trigger supplies the interacting player. Replacing it with @self would pass the pig, so the messages would no longer have the intended recipient.

3. Verify who receives each line
  • Player A interacts once: A should receive the first hint, then the second after the delay.
  • Player B stands nearby without interacting: B should receive neither hint.
  • Interact repeatedly during the four-second cooldown: the same mob should not start overlapping sequences.
  • After the cooldown, let B interact: both hints should go to B.
  • Spawn another tutor and test it separately. Cooldown is per caster, not a global player limit.
Also test a player disconnecting before the second line. Inspect the console; do not assume every delayed action has a valid online player forever. If you later replace a message with an inventory or economy action, validate that action's target and permissions separately.

4. Add one improvement at a time
Change the hint text and verify a fresh spawn. Then, if you attach a Model Engine model, target visual animation mechanics at the modeled mob while keeping dialogue player-targeted. Do not replace inherited player targets with the model entity just to make an animation work. Use a separate mechanic line with its own explicit target.

When debugging, reduce the sequence to one message. Verify the interaction trigger and recipient, add the delay, then restore the second message. Include the two YAML files and the exact two-player test in a help post. YAML parsing alone cannot verify runtime targeting; these acceptance checks belong on your running development server.
 
Top