BlackSpigot

Guide MythicMobs first mob: a friendly guide with an interaction message

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

BlackSpigot Guides

Guest
Build a small, observable behavior
This exercise creates a named pig that sends a message when you interact with it. It uses a vanilla entity so you can verify MythicMobs before involving models, resource packs or combat skills. Use a development server, confirm MythicMobs enables cleanly, and check your installed version’s supported Minecraft releases.

1. Add a mob file
Create plugins/MythicMobs/Mobs/workshop-guide.yml. Paste the following, preserving indentation and using spaces:
YAML:
WorkshopGuide:
  Type: PIG
  Display: 'Workshop Guide'
  Health: 30
  Skills:
  - message{m="Hello! This is your first custom mob."} @trigger ~onInteract
WorkshopGuide is the internal ID you will use in commands. Display is the visible name. Type chooses the vanilla base entity, and Health supplies its starting maximum health. Keep the internal ID unique across all mob files; a second definition with the same ID makes diagnosis confusing.

The mob configuration reference explains the file structure. Avoid adding a large downloaded configuration at this stage: your first success should be small enough to inspect completely.

2. Load and spawn
Run /mm reload and inspect the console for errors. Use /mm mobs list to look for WorkshopGuide, then /mm mobs spawn WorkshopGuide 1 in a safe area. Use a fresh spawn after editing; changing a file does not mean every existing entity has been recreated. See the command reference if your account cannot run these commands.

If the mob does not appear in the list, fix the load error first. Check the file extension, folder, spelling and indentation. YAML commonly fails because of a tab or an unquoted colon in a value. Preserve a working copy and add one field at a time.

3. Read the skill line
The mechanic is message; m contains the text. @trigger chooses the player who caused the interaction, and ~onInteract decides when the line runs. The pig is the skill caster, but it is not the recipient of this message. A message mechanic needs a player target, so replacing @trigger with @self here would not achieve the same result. The message mechanic documentation describes its target and message field.

4. Verify with two players
Interact once and confirm the text appears for you. Have a second player interact and confirm it appears for that player. Repeated interactions in this first version deliberately repeat the message. Check that unrelated pigs do not respond. Change the text, reload and create a fresh test spawn to confirm the updated definition.

If interactions are cancelled by protection or another plugin, reproduce in an allowed development area and inspect that conflict before changing a working message mechanic. Avoid testing by mass spawning mobs on a busy server. Remove your test entities through the tools you normally use and keep the configuration for the next lesson.

Next step
Move the message into a named metaskill and add a cooldown using the companion guide. Once the plain interaction works, attach a Model Engine model as a separate change. This order makes it clear whether a problem comes from the mob behavior or the client-side visuals.

This is a documented configuration exercise. The interaction and multiplayer checks above are not claimed as completed runtime tests.
 
Top