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.20.4: Itemsadder through Luckperms prefix's #2660

Closed CorruptVD closed 2 months ago

CorruptVD commented 2 months ago

Are you using MySQL?

No

Are you using BungeeCord/Velocity?

No

Question

Currently itemsadder through chat works but if I have prefix's setup in luckperms and then set through chat it doesn't apply the textures. for example: image The image above is when I call for the prefix through %luckperms_prefix% it will use the itemsadder placeholder but it won't apply the texture unless done directly through the chat with the actual placeholder from itemsadder.

kangarko commented 2 months ago

Can you please send me your full format with these placeholders?

CorruptVD commented 2 months ago
# !-------------------------------------------------------------------------------------------------!
#                                  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

  # 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: '&8[%rel_factionsuuid_relation_color%%factionsuuid_faction_name%&8]&r %luckperms_prefix% '
    Hover:
    - '&#ffffff{player_prefix+}{player_name} {player_suffix}'
    - '&#ffffffPing&8: &#fffd70{ping}ms'
    - '&#ffffffRank&8: &#fffd70{player_group}'
    - '&#ffffffPosted: &#fffd70{timestamp}'
    - ''
    - '&#fffd70Click to learn more about ranks.'
      # You can also use PlaceholderAPI variables here
      #- '&7First join: &e{player_first_join_date}'
    Open_Url: https://google.com

  # 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: '&f{player_nick}'
    #Message: "{player_name}"
    #Gradient: RED - YELLOW
    Hover: '&7Click to message.'
    Suggest_Command: '/msg {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: '&7: {chat_color}{chat_decoration}{message}'

specifically referring to the %luckperms_prefix% placeholder in chat, it seems to work through tab just not through chat unfortunately

image

if you look at the top left of this image if you see the "Owner" tag, it is working with tab using %luckperms_prefix% placeholder, thank you in advance!

CorruptVD commented 2 months ago

Let me know if you find a fix for this.

kangarko commented 2 months ago

We ended up terminating support for variables inside variables because it 0.5x the performance of the overall plugin, and opened some security holes where a specially crafted message would crash the server.