TextComponent - Replace Text (Effect) — SkBee
Addon: SkBee · Category: Effect · Since: 2.18.0
Syntax
component [regex] replace [first] %strings% with %object% in %~textcomps% [with case sensitivity]Description
Replaces a given string with another string/text component. **NOTE:** - `regex` Defining the regex keyword will have the provided string be parsed as regex. - `first` Defining the first keyword will only replace the first instance. - Any case-sensitivity checks only apply to literal patterns, for regex append `(?i)` to the start If you're new to regex and want to see how it's parsed you can use https://regex101.com/ for debugging.
Examples
component replace "[item]", "[i]" with getItemComponent(player's tool) in async chat message
component regex replace "\[(item|i)]" with getItemComponent(player's tool) in async chat message
component replace first "Mom!" in {_message} with "Dad!" with case sensitivity