
Vocation Mod: Creating Interactive Messages
Vocation is a tool for modification and pack developers that allows adding text and voice-acted messages into the game with rich interaction capabilities.
Watch the Demonstration
This project was created during a single day stream and offers a convenient system for working with in-game notifications. The tutorial shown in the video is not included with the mod — it only serves as an example of capabilities.
Getting Started
Install Vocation on both server and client, run the game once to create the vocation_data folder next to the mods and config folders. Inside it, create a separate folder with any name for your data. If you need to add audio files, place them in the "audio" subfolder.
Create JSON files in the main folder — their number is unlimited, and each can contain multiple messages. Remember that JSON files must be identical on client and server, audio files are not required for the server.
Message Format
Each file represents a JSON array of objects:
[
{
"id": "(message identifier)",
"message": "(screen text)",
"narrator": "(character name above text)",
"time": "(display time in ticks)",
"voiceover": "(audio file from audio folder, optional)",
"requirements": "(list of message IDs that need to be viewed for this to appear, optional)",
"triggers": "(event triggers, optional)",
"actions": "(actions when message appears, optional)"
}
]
You can leave the message empty — then it won't show on screen but will still count as seen and trigger the specified actions.
Triggers
If triggers are not specified, use commands to show messages. Available trigger options:
"triggers": [
{
"trigger": "message_seen",
"key": "(ID of checked message)"
},
{
"trigger": "stat_above",
"key": "(statistic name)",
"value": "(minimum value)"
},
{
"trigger": "item_pickup",
"stack": "(item format)"
},
{
"trigger": "item_craft",
"stack": "(item format)"
},
{
"trigger": "mob_kill",
"key": "(mob name)"
}
]
Actions
After a trigger, various actions can be performed:
"actions": [
{
"action": "give_item",
"stack": "(item format)"
},
{
"action": "run_command",
"param": "(command with /)"
}
]
Item Format
Specify the item in the following structure:
"stack": {
"id": "(item ID, e.g. minecraft:log)",
"metadata": "(optional — metadata)",
"stackSize": "(stack size, optional)",
"nbt": "(JSON object with additional data, optional)"
}
Commands
The mod includes several useful commands for system management:
/vocation-review
— allows any player to replay the last viewed message (without actions)/vocation-reload
— reloads all configuration files (admins only)/vocation-clear <player>
— clears all Vocation data for specified player (command blocks and admins)/vocation-set-seen <player> <id> <true/false>
— manages message view status for player (command blocks and admins)/vocation-show <player> <id> [do-actions]
— shows specific message to specified player (command blocks and admins)/vocation-check <player> <id>
— checks if message has been viewed (used with comparators)