Skip to content

In Game Trigger

MoSadie edited this page Sep 4, 2024 · 1 revision

As of v3.0 there is a brand new way to trigger effects, I call them Translation Triggers!

The mod will listen for incoming chat messages and trigger effects when it detects a specially formatted message. It will automatically hide the trigger message in chat as well. The way the message is formatted means it can easily be sent by a server or command block, but impossible for a normal player to send.

Like any other way of triggering effects, you will need to trust the world/server first before any effects work.

The formatting for the message is as follows:

Message Contents: Translatable message with the key com.mosadie.effectmc.trigger with the following JSON contents as the first "with" argument:

{
  "effectId": "<effectId>",
  "args": {
    "<key>": "<value>",
    //...
  }
}

An example of a /tellraw command that would trigger the Send Chat Message effect with the message Hello!:

/tellraw @p {"type":"translatable","translate":"com.mosadie.effectmc.trigger","fallback":"","with":["{\"effectId\":\"sendchat\",\"args\":{\"message\":\"Hello!\"}}"]}

To save you the hassle of formatting the json into a usable /tellraw command I have added a new in-game command to export triggered effects to the log file as a /tellraw command. Simply run /effectmc exporteffect then trigger the desired effect. You will find both the raw json format and a full /tellraw command in the log file.