kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

1.19.4: How can i remove 1 space #2617

Closed AminGHG closed 3 months ago

AminGHG commented 3 months ago

Are you using MySQL?

Yes

Are you using BungeeCord/Velocity?

Yes - Velocity

Question

image

here is my format:

# !-------------------------------------------------------------------------------------------------!
#                                  Welcome to formats configuration
# !-------------------------------------------------------------------------------------------------!
#
#   A format renders and customizes a message send to player(s). It can be used across our plugin 
#   in many places, such as in channels, rules, commands etc.
#
#   Remember, you can remove or edit all parts below, and create your own ones! A lot options
#   are optional, that means you do not have to specify them at all.
#
#   Each format consists of parts such as "delete-chat" below. Each part can show different hover
#   events etc. or be hidden if sender/recipient has a certain permission, and more.
#
#   All format options except "Message" are optional. If you don't need those, you can remove it.
#
#   Options for each format part:
#   - Message: A simple string what will be shown in the chat. 
#   - Sender_Permission: What permission must the message sender have for this part to show.
#   - Receiver_Permission: Only show this part to the receivers having this permission.
#   - Sender_Condition: JavaScript condition that must return true for sender (use "player" to get
#                       the Player instance from Spigot) for this part to show.
#   - Receiver_Condition: Similar to Sender_Condition but the script will evaluate against each 
#                         receiver and only show this part to those for which condition is true.
#   - Hover: One line or a list of tooltip to show when hovering over this part with your mouse.
#   - Hover_Item: JavaScript with "player" instance as variable that must return a valid ItemStack
#                 to show when hovering over this part (e.g. "player.getItemInHand()")
#   - Open_Url: A one-line message representing a website to open which clicking on this part. 
#   - Suggest_Command: A one-line message that be suggested as command when clicked on this part.
#   - Run_Command: One command (Minecraft only supports one) that will run upon clicking on part.
#   - Insertion: The text to insert into the chat when this component
#                (and child components) are clicked while pressing the shift key.
#   - (1.16+) Copy_To_Clipboard: The text to copy to your clipboard when this component is clicked.
#   - Inherit: (Limited) A name of another format from another file to import and use.
#   - Inherit_Part: (Limited) A name of another part from this file to import and use.
#   - (1.16+) Gradient: <from> - <to> (such as RED - GOLD or #123456 - #123456) Gradients for.
#   - Image_File: Display the image to the left of this part. - Syntax: Image_File: creeper-image.png
#   - Image_Head: Display the head of the specified player - Syntax: Image_Head: "Herobrine" | Image_Head: "{player}"
#                (Can be a specific player, or you can use the {player} placeholder.
#   - Image_Url: Display an image from the specified url - Syntax: Image_Url: "https://mywebsite.com/images/creeper.png"
#   - Image_Height: Specify the image height when using an image
#                (Default: 8)
#   - Image_Type: Which characters should be used to render the image?
#                (Default: BLOCK || Available: BLOCK, DARK_SHADE, MEDIUM_SHADE, LIGHT_SHADE)
#
#   For help and documentation, visit:
#   https://github.com/kangarko/ChatControl-Red/wiki/formats
#
# !-------------------------------------------------------------------------------------------------!

# -----------------------------------------------------------------------------------------
# The default chat format used by chat formatting or in the "standard" channel.
# -----------------------------------------------------------------------------------------

# If true, each section in Parts will begin on a new line automatically.
# See https://github.com/kangarko/ChatControl-Red/issues/2510
New_Line_Per_Part: false

# The parts of this format.
Parts:

  # Shows the head of the specified player before their messages
  #player-head:
  #  Message: ""
  #  Hover: "{player}"
  #  Image_Head: "{player}"
  #  Image_Height: 10
  #  Image_Type: "LIGHT_SHADE"

  # Show the [X] button only visible to people having permission on 'Receiver_Permission'
  # that enables you to remove chat messages by clicking on them!
  # PS: They are still saved to log and can be viewed with "/chc log".
  # TIP: Give yourself chatcontrol.bypass.spamkick to prevent being kicked when removing mass messages.
  delete-chat:
    Message: '&8[&4X&8] &f'
    Hover: '&cRemove this message from chat for all players.'
    Run_Command: /{label} internal remove {message_uuid}
    Receiver_Permission: chatcontrol.removemessages

  # Show the [Read] prefix if the receiver is only reading this channel.
  read-prefix:
    Message: '&8[&bRead&8] '
    Receiver_Condition: '''{player_channel_mode_{channel}}'' == ''read'''

  # Show the [Discord] prefix if the sender is from Discord (we use our own
  # special variable for this) and add some interactive elements.
  discord-prefix:
    Message: '&8[&9Discord&8] &f'
    Sender_Condition: '{sender_is_discord}'

  # Show the [Outsider] prefix if the sender is not joined in this channel,
  # and is not coming from discord. This happens for example on "/channel send".
  #outsider-prefix: 
  #  Message: "&8[&cOutsider&8] &f"
  #  Sender_Condition: "!{player_in_channel_{channel}} && !{sender_is_discord}"

  # Show the [Spy] prefix only to players who receive this message AND are
  # spying in the given channel, enabling them to stop spying by clicking on prefix.
  spies-prefix:
    Message: '&8[&5Spy&8] &f'
    Receiver_Condition: '{player_is_spying_{channel}}'
    Hover: '&dClick to stop spying {channel} channel.'
    Run_Command: /{label_spy} toggle chat {channel}

  # Finally, pull the regular player prefix from your permissions plugin using Vault.
  # If you encounter issues, you can try to use placeholders from another plugin, such as %luckperms_prefix%.
  # The + at the end of the variable automatically inserts a space if player has prefix.
  # E.g. "admin" turns into "admin ". If there's no prefix, you won't end with a trailing space.
  prefix:
    Message: '{player_prefix+}'

  # Display a typical player name to players with the given permission. change {player_name} 
  # to {player_nick} to show nick instead. We'll revert to show normal name if player has no nick.
  # To display a name in rainbow colors, uncomment "Gradient". This requires MC 1.16+
  player-name:
    Message: ''
    #Message: "{player_name}"
    #Gradient: RED - YELLOW
    Hover: ''
    Suggest_Command: '/tell {player_name} '

  # And finally, show the message the player has typed out, prepending it with player's
  # suffix from your permission plugin. We replace {chat_color} and {chat_decoration} with the 
  # color and decoration set in '/chc color'.
  message:
    Message: '%player%: &f{player_suffix}{message}'
kangarko commented 3 months ago

Please use the proper formatting next time ``` instead of.

Remove the "player-name" section completely.

If that problem still persists, you can debug this where the space is coming from if you change

'{player_prefix+}'

to

'START{player_prefix+}END'

and do the same for %player% so it becomes "START2%player%END2"

Then you will see where the problem is. You can try removing the extra "+" from the message.