• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

ChatControl Pro/WIKI/聊天忽略

来自Minecraft插件百科
Qsefthuopq留言 | 贡献2019年1月29日 (二) 03:45的版本 (创建页面,内容为“{{模版:ccpbox}} 聊天忽略器这个名字并不好听,但它可以让玩家屏蔽掉他们不想看到的消息 (如脏话). 比如你想要玩家能否看到…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到导航 跳转到搜索

模板:模版:ccpbox 聊天忽略器这个名字并不好听,但它可以让玩家屏蔽掉他们不想看到的消息 (如脏话). 比如你想要玩家能否看到单词: 'fuck' 和 'asshole'.

1) 创建匹配脏话的规则并将处理器命名为 'swear' 来便于处理.把规则放到rules.txt内.

match fuck
handle as swear

match asshole
handle as swear

2) 在handlers.txt内创建适合的处理器

swear:
  Bypass_With_Permission: "chatcontrol.bypass.swear"    
  Player_Warn_Message: "&cSwearing is prohibited on this server."
  Ignore_Chatdisplay: swears

The interesting part is 'Ignore_Chatdisplay', we'll get to it later.

3) 在settings.yml内启用聊天呼啦圈并能创建名为 'swears'的忽略器作为示例 (示例在下面).

Chat_Ignorer:
  Enabled: true
  Sets:
    swears:
      Ignored_By_Default: false

Chat_Ignorer.Sets.swears: The name of the ignorer. This is simply the name of the filter that players will use in-game. The section name is important, as it is used further in handlers.txt in step #3 or can also be used in rules with 'ignore chatdisplay swears' operator.

Ignored_By_Default: This option determines whether to display or hide all rules that has assigned this ignorer by default. On false, players will see swearing unless they manually hide it using a command.

4) 进入游戏测试, 给予玩家权限 'chatcontrol.commands.ignore' 和 'chatcontrol.ignoreset.swears'.

Player 1 tries to write one of the three words in the game chat. Player 2 has not done anything so far, and since the option 'Ignored_By_Default' is to false (as above), he will see the swear.

Player 2 so executes following command: '/chc ignore swears'. A message appears informing him that the messages from 'swear' ignore set are now hidden.

Player 1 swears again. He will see his own message since he has not done anything, but player 2 won't be able to see the swear (unless he executes the command above again or server restarts).