FILTER
FILTER
Type: Action
Category: Mod related
Permission: N/A
Since Minecraft Version: v1.7.2
Since Version: v0.10.4
Minor: 10
API: 15
Patch: 4
Description
Indicate that this chat message should be filtered and terminate
Example
// Use ifcontains to check for chat-messages and filter ifcontains turns out true.
// Filters the message 'Hello' in the chat.
ifcontains(%CHAT%,"Hello");
filter;
endif;
// Use ifmatches to check for chat-messages and filter if a valid match has been found.
// Filters the playername of yourself, 'Hello' and 'Goodbye' in the chat.
ifmatches(%CHAT%,"(?:%PLAYER%|Hello|Goodbye)");
filter;
endif;
Changelog
- Added em v0.10.4:
- Fixed em v0.14.4: Was not stopping the macro when used in the [onSendChatMessage](/docs/events/onsendchatmessage) event
- Updated em v0.10.12: Can now be used in [onSendChatMessage](/docs/events/onsendchatmessage)