CommandHelper extension
CommandHelper extension
Do you want to add a new tag with CommandHelper? Cancel a message from being sent? Remove a recipient?
You can do with CHLegendchat!
Required dependencies
To use Legendchat API with CommandHelper you MUST have CHLegendchat.
CHLegendchat V0.8.1 (LC V1.1.2) - Download link (Click here)
CommandHelper: 3.3.1
Old files:
CHLegendchat V0.8.0 (LC V1.1.0) - Download link (Click here)
Events
chat_message
Event called when someone say something in the chat (but not the bungeecord channel).
List of readable variables:
Variable | Type | Description |
---|---|---|
message | String | Message being sent |
format | String | Channel format (config.yml) |
baseformat | String | Channel base format (Channel file) |
sender | String | Sender's name |
channel | String | Channel's name |
cancelled | Boolean | Event cancelled |
tags | Array (String) | All tags available |
recipients | Array (String) | All recipients (players names) |
tag_name | String | Get a value from a tag (Ex.: tag_prefix) |
List of modifiable variables:
Variable | Type | Description |
---|---|---|
message | String | Change message |
format | String | Change channel format (config.yml) |
sender | String | Change change sender |
cancelled | Boolean | Change event cancelled |
recipients | Array (String) | Change recipient's list |
tag_name | String | Set a value to a tag (Ex.: tag_prefix) |
List of availables prefilters:
Prefilter | Type |
---|---|
sender | String match |
message | String match |
format | String match |
baseformat | String match |
channel | String match |
cancelled | Boolean match |
private_message
Event called when a private message is sent.
List of readable variables:
Variable | Type | Description |
---|---|---|
message | String | Message being sent |
sender | String | Sender's name |
sender | String | Receiver's name |
cancelled | Boolean | Event cancelled |
List of modifiable variables:
Variable | Type | Description |
---|---|---|
message | String | Change message |
sender | String | Change sender |
receiver | String | Change receiver |
cancelled | Boolean | Change event cancelled |
List of availables prefilters:
Prefilter | Type |
---|---|
sender | String match |
receiver | String match |
message | String match |
cancelled | Boolean match |
bungeecord_chat_message
Event called when a chat message is sent through the bungeecord channel.
The methods inside this event is the same as chat_message, excluding sender.
You can get the Sender's name inside the tag 'sender' or 'plainsender'.
Examples
Examples with the events
Block a message containg something
bind(chat_message, null, null, @event, if(string_position(to_lower(@event[message]),to_lower('something'))>-1) { modify_event(cancelled,true) } )
Block someone from receiving messages
bind(chat_message, null, null, @event, @arr = @event[recipients] if(array_contains_ic(@arr,'SubZero0_')) { for(@i=0,@i<array_size(@arr),@i++) { if(equals_ic(array_get(@arr,@i),'SubZero0_')) { @name = array_get(@arr,@i) break } } array_remove_values(@arr,@name) modify_event(recipients,@arr) } )
Set a value to a tag
/*Observation: the channel format (config.yml) must contains {mytag}*/ bind(chat_message, null, null, @event, if(array_contains(@event[tags],'mytag')) { modify_event(tag_mytag,'&c[MyTag] &r') } )