Skip to content

Events and Actions

Events are defined as interactions made by viewers against your channel through the stream, such as following or donating. On the other hand, Actions are sets of in-game reactions set up by the server administrator and fired by Events (i.e. an action for Follow events could be giving an item to a player and running a command).

Events

By default, all events types are commented out in the configuration files. To use them uncomment (remove the # and the trailing space) the respective lines for each event in your config file. ChatPointsTTV can listen to the following events:

Twitch

  • Channel Points Rewards
  • Follows
  • Cheers
  • Subscriptions
  • Subscription Gifts
  • Raids

TikTok

  • Follows
  • Gifts
  • Likes
  • LIVE Sharing

Actions

You can set up in the configuration files any action(s) for each of the events above. You can find where they should be placed here.
You may use any of the following actions:

Spawning entities

Command: SPAWN <Entity Name>
Optional arguments: [Amount] [Target Player]

Example action command: SPAWN Creeper 5 Steve

This action will spawn a certain number (by default 1) of the specified entity to the target player, if specified. If the field is omitted, it will apply to all targeted players

Giving items

Command: GIVE <Item Name>
Optional arguments: [Amount] [Target Player]

Example action command: GIVE Diamond 1

This action will give an item. It an amount is not set, players will receive just 1 item. If no specific player is set, items will be given to all targeted players

Freezing players

Command: FREEZE <Time (in seconds)>
Optional arguments: [Target Player]

Example Action command: FREEZE 10 Steve

This action will prevent all player movement, including camera movement and gravity, during the set amount of time.

Applying potion effects

Command: EFFECT <Effect Name / "RANDOM" / "CLEAR"> <Strength>
Optional arguments: [Duration (in seconds)] [Target Player]

Example action command: EFFECT SPEED 2 60

This action will apply a potion effect to all players, or just to a specific one, if a Target Player is set in the command. If RANDOM is set, a random effect will be picked. If CLEAR is set, all potion effects will be cleared If no duration is set, the effect will be applied infinitely, until removed manually (drinking a milk bucket or with another action).

Removing inventory items

Command: DELETE <"ALL" / "RANDOM" / "HAND">
Optional arguments: [Target Player]

Example action command: DELETE HAND Steve

This action removes a single/all items from a player's inventory, if a Target Player is specified. By default, this action will be performed on all targeted players.

Inventory shuffling

Command: SHUFFLE <"ALL" / Target Player>

This action shuffles the position of all items in a player's inventory.

Example action command: SHUFFLE Steve

Running commands

Command: RUN <Player Username / "*" / "CONSOLE"> <Command>

This action will run a command as the server console or as any player on the server. * will target all players (with the Target Permission set).

Example action command: RUN CONSOLE tp @a Steve

Explosions

Command: TNT <Amount>
Optional arguments: [Fuse Time (ticks)] [Target Player]

This action will spawn an exploding TNT that will explode in the specified amount of ticks (if set to 0, it will explode instantly).

Example action command: TNT 3 0 Steve

Miscellaneous

Delays

Command: WAIT <Seconds>

This action will stop the execution of the action for the specified amount of time, before running the next item in the list.

Sounds

Command: SOUND <Sound Name>
Optional arguments: [Target Player]

This action will play a sound. Field <Sound Name> must match a Spigot API Sound Name.

Custom in-game message

Command CUSTOM_MSG <Message>

This action will override the default in-game alert message set in the locales file with the specified message. To display a title splash message with a subtitle, use \n to split your message. This will be ignored and omitted in chat alert messages.
You may use any Color Code to format your message.

Configuration

Inside the configuration files each Action consists of a List, named as the condition or minimal threshold (see individual examples below) needed to toggle the Action. Inside of it you may add as many Commands as you like.

There is an exception for Follow events, which does not need a minimal condition. For Follow Events the Command list must be inside the FOLLOW_EVENTS section. See Follow Event Examples.

Streamer-specific Actions

If using multiple streamer accounts, you may set different Actions depending on the channel where the Event occurred.

To do so, you must enclose all the streamer-specific actions inside a Dictionary named as the streamer, inside the event and threshold (if applies) dictionaries. To add a common Action for other streamers that do not have streamer-specific actions you may use default as the list name.

See examples below.

Examples

You must set your actions in your Twitch configuration file as shown:

Follow Events

For follow events, there is no threshold or condition to be met, and for this reason actions for Follow Events must be set as a list directly inside FOLOW_EVENTS.
You still can set streamer-specific actions, in the same way as it's done for any other event type

Example:

FOLLOW_EVENTS:
    - SPAWN CREEPER 1
    - EFFECT BLINDNESS 1 5

Example with streamer-specific actions:

FOLLOW_EVENTS:
    TestStreamer:
        - GIVE DIAMOND 1
    *:
        - EFFECT BLINDNESS 1 5
        - WAIT 2
        - SPAWN CREEPER 1

Other Events

Example:

CHANNEL_POINTS_EVENTS:
    Something is missing!:
        - SHUFFLE *
        - DELETE RANDOM
    Waterdrop:
        - RUN * /tp ~ ~100 ~
        - GIVE WATER_BUCKET

Example with streamer-specific actions:

GIFT_EVENTS:
    1:
        Steve:
            GIVE Diamond 1 Steve
    5:
        Alex:
            DELETE ALL Alex
    100:
        TNT 10 1

Testing

You may trigger fake events to test your configured actions using the Test command. See Commands for more information.