LOOHP / InteractiveChat

Add click and hover events to chat messages!
https://www.spigotmc.org/resources/75870/
GNU General Public License v3.0
161 stars 25 forks source link

[BUG] Illegal characters in chat #2

Closed ZorudaRinku closed 4 years ago

ZorudaRinku commented 4 years ago

When clicking on a players name (with default config) It suggests "/msg player " but you type something and hit send and you get kicked. Backspacing you can see it actually says "/msg player7r7r "

LOOHP commented 4 years ago

Which Minecraft version are you running?

LOOHP commented 4 years ago

Also which plugin is your /msg using?

ZorudaRinku commented 4 years ago

git-paper-224 (1.15.2) https://www.spigotmc.org/resources/chat-manager-1-7-1-15-with-30-features-and-40-commands.52245/

LOOHP commented 4 years ago

I can't seem to recreate the issue, can you send me your config? (despite you said it is the default, it is still worth taking a look.)

ZorudaRinku commented 4 years ago

Sure, I'm assuming at this point its a different plugin causing it like placeholderapi or something because the click command doesn't seem to look off...

Options:
  Updater: true
Messages:
  NoPermission: '&cYou do not have permission to use that command!'
  InvExpired: '&cThis inventory view has expired!'
  ReloadPlugin: '&aInteractive Chat has been reloaded!'
  LimitReached: '&cPlease do now use excessive amount of placeholders in one message!'
Settings:
  FilterUselessColorCodes: true
  CommandsToParse:
  - /emsg.*
  - /msg.*
  - /pm.*
  - /tell.*
  - /r.*
  UniversalCooldown: 0
  MaxPlaceholders: -1
  PlayerNotFound:
    Hover:
      Enable: true
      Text:
      - '&cUnable to parse placeholder..'
    Click:
      Enable: false
      Action: SUGGEST_COMMAND
      Value: ''
    Replace:
      Enable: true
      ReplaceText: '&c{Placeholer}&r'
Chat:
  AllowMention: true
  MentionedSound: ENTITY_EXPERIENCE_ORB_PICKUP
  MentionedTitle: ''
  MentionedTitleDuration: 1.5
  UnknownPlayerMentionSubtitle: '&fSomeone had mentioned you in the chat!'
  KnownPlayerMentionSubtitle: '&3%player_name% &fmentioned you in the chat!'
  MentionHighlight: '&e{MentionedPlayer}'
  MentionHoverText:
  - '&b{Sender} mentioned you!'
ItemDisplay:
  Item:
    Enabled: true
    CaseSensitive: false
    Keyword: '[item]'
    Aliases:
    - (?i)(\[i\])
    Text: '&f[&f{Item} &bx{Amount}&f]'
    InventoryTitle: '%player_name%''s Item'
    Cooldown: 0
    GUIEnabled: true
    Frame:
      Primary: MAGENTA_STAINED_GLASS_PANE
      Secondary: BLACK_STAINED_GLASS_PANE
  Inventory:
    Enabled: true
    CaseSensitive: false
    Keyword: '[inv]'
    Aliases:
    - (?i)(\[inventory\])
    Text: '&f[&b%player_name%''s Inventory&f]'
    InventoryTitle: '%player_name%''s Inventory'
    Cooldown: 0
    HoverMessage:
    - '&bClick to view!'
  EnderChest:
    Enabled: true
    CaseSensitive: false
    Keyword: '[ender]'
    Aliases:
    - (?i)(\[e\])
    Text: '&f[&d%player_name%''s Ender Chest&f]'
    InventoryTitle: '%player_name%''s Ender Chest'
    Cooldown: 0
    HoverMessage:
    - '&bClick to view!'
Player:
  UsePlayerNameInteraction: true
  CaseSensitive: true
  Hover:
    Enable: true
    Text:
    - '&aWorld: %player_world%'
  Click:
    Enable: true
    Action: SUGGEST_COMMAND
    Value: '/msg %player_name% '
CustomPlaceholders:
  '1':
    ParsePlayer: sender
    Text: '[money]'
    Aliases:
    - (?i)(\[m\])
    ParseKeyword: false
    CaseSensitive: true
    Cooldown: 0
    Hover:
      Enable: true
      Text:
      - '&6%player_name%''s Balance: $%vault_eco_balance_commas%'
    Click:
      Enable: true
      Action: SUGGEST_COMMAND
      Value: '/pay %player_name% '
    Replace:
      Enable: true
      ReplaceText: '[%player_name%''s Balance]'
  '2':
    ParsePlayer: viewer
    Text: SunKnights
    Aliases: []
    ParseKeyword: false
    CaseSensitive: false
    Cooldown: 0
    Hover:
      Enable: true
      Text:
      - '&eVisit the author''s server!'
      - '&bClick me!'
    Click:
      Enable: true
      Action: OPEN_URL
      Value: https://sunknights.fun
    Replace:
      Enable: true
      ReplaceText: '&6&lSun&e&lKnights'
  '3':
    ParsePlayer: sender
    Text: '[gametime]'
    Aliases: []
    ParseKeyword: false
    CaseSensitive: true
    Cooldown: 0
    Hover:
      Enable: false
      Text: []
    Click:
      Enable: false
      Action: ''
      Value: ''
    Replace:
      Enable: true
      ReplaceText: '%player_world_time_24%'
  '4':
    ParsePlayer: viewer
    Text: '[Hover]'
    Aliases: []
    ParseKeyword: false
    CaseSensitive: false
    Cooldown: 0
    Hover:
      Enable: true
      Text:
      - '&bHover Text is cool!'
    Click:
      Enable: false
      Action: ''
      Value: ''
    Replace:
      Enable: false
      ReplaceText: ''
  '5':
    ParsePlayer: viewer
    Text: discord
    Aliases: []
    ParseKeyword: false
    CaseSensitive: false
    Cooldown: 0
    Hover:
      Enable: true
      Text:
      - '&eJoin the discord!'
      - '&bClick me!'
    Click:
      Enable: true
      Action: OPEN_URL
      Value: https://discord.gg/9sCRjZx
    Replace:
      Enable: true
      ReplaceText: '&9&nDiscord&f'
LOOHP commented 4 years ago

Do you use any nicknames? Perhaps there are color codes in the player name placeholder?

ZorudaRinku commented 4 years ago

I do. Looks like thats the issue. If someone doesn't have a nickname it works fine. I'm using nicknamer at the moment. I guess I should replace it with %nicknamer_nickname%.

Ok just did but issue still arises. I guess I should go submit a ticket with them?

LOOHP commented 4 years ago

Perhaps you can check one more thing, try removing the placeholder and just use "/msg", see if there are any color code with that.

ZorudaRinku commented 4 years ago

Looks like when I do just /msg it works fine, so I'm guessing the error is in the nicknames plugin

LOOHP commented 4 years ago

Then you can try /papi parse %player_name% and see what it returns aswell, see if there are any color codes.

ZorudaRinku commented 4 years ago

Just returns all white "Zoruda" which is my nickname, not my playername. BUT this could be because nicknamer can replace player names with nicknames. So I'm worried thats the issue BUT ALSO I've disabled that feature and before and after disabling it they both said "Zoruda"

Here is the nicknamer config (first half of it, the rest is useless) # after the value shows what was enabled before it was disabled. Sorry if this is confusing. I'm trying to give you all the info I can haha


replace:
  chat:
    # Replace names in messages sent by players
    player: false #

    # Replaces names in ALL outgoing messages
    out: false #
    in:
      # Replace real names in incoming commands with the player's nickname
      command: false
      # Replace incoming command nicknames with the player's real name
      # (If multiple players use the same nickname, it will default to the first available player's real name)
      commandReverse: false #

      # Replace real names in general (non-command) incoming messages with the player's nickname
      general: false
      # Replace incoming nicknames with the player's real name
      # (If multiple players use the same nickname, it will default to the first available player's real name)
      generalReverse: false #
  scoreboard: false
  scoreboardScore: false
  scoreboardTeam: false
  tabComplete:
    chat: false #
LOOHP commented 4 years ago

But since without a placeholderAPI placeholder or with another placeholder, the color codes are not present, then I suppose the color code is inside the player name placeholder provided by placeholderAPI. Perhaps you can try to use a placeholder that will return the player's actual name even if you have nicknames enabled?