Origins: Powerful Powers
» Entity actions » Action on chat

Action on chat

origins-powerful-powers:action_on_chatpower type

Runs actions when a chat message contains certain text. It can react to messages the holder sends (spoken spells, trigger words), messages the holder receives from other players, or both.

FieldTypeDefaultDescription
substringsArray of StringsrequiredThe text to look for. Each one can be anywhere in the message.
matchString"any"any: one substring is enough. all: every substring must be in the message.
orderedBooleanfalseWith match: all: the substrings must appear in the order listed, without overlapping.
case_sensitiveBooleantrueWhen false, matching ignores case.
directionString"both"outgoing: messages the holder sends. incoming: messages other players send while the holder is online. both: either.
hide_messageBooleanfalseHides a matching outgoing message from chat.
entity_actionEntity actionoptionalRuns on the holder, once per matching message.
bientity_actionBi-entity actionoptionalActor: the holder. Target: for an outgoing message, each other online player (once each). For an incoming one, the sender.
bientity_conditionBi-entity conditionoptionalFilters bientity_action per target, with the same actor and target. entity_action ignores it.

It also accepts Origins' usual condition. The power ignores chat while it's false.

  • Only chat messages count. /say, /me, /msg, /tell and command blocks are ignored.
  • The text is what the player typed, before server formatting.
  • Several powers can match the same message, and they all run. If any matching outgoing power hides the message, it's hidden.
  • A hidden message runs no incoming powers.
  • Your own message is only outgoing for you, so direction: both runs once per message.
  • "Incoming" means any other player's chat message, from anywhere in the world.

Example: "Word of fire". Saying "ignis" (in any capitalisation) sets every player within 10 blocks on fire. The word is hidden from chat.

json
{
  "type": "origins-powerful-powers:action_on_chat",
  "substrings": [
    "ignis"
  ],
  "case_sensitive": false,
  "direction": "outgoing",
  "hide_message": true,
  "bientity_condition": {
    "type": "origins:distance",
    "comparison": "<=",
    "compare_to": 10
  },
  "bientity_action": {
    "type": "origins:target_action",
    "action": {
      "type": "origins:set_on_fire",
      "duration": 5
    }
  }
}

Example: "Eavesdropper". When anyone says both "where" and "base", in that order, you get a glowing hint on them.

json
{
  "type": "origins-powerful-powers:action_on_chat",
  "substrings": [
    "where",
    "base"
  ],
  "match": "all",
  "ordered": true,
  "case_sensitive": false,
  "direction": "incoming",
  "bientity_action": {
    "type": "origins:target_action",
    "action": {
      "type": "origins:apply_effect",
      "effect": {
        "effect": "minecraft:glowing",
        "duration": 200
      }
    }
  }
}