add a text replace expression#8587
Open
novystar wants to merge 18 commits intoSkriptLang:dev/featurefrom
Open
Conversation
# Conflicts: # src/main/java/ch/njol/skript/expressions/ExprReplace.java
This comment has been minimized.
This comment has been minimized.
sovdeeth
requested changes
Apr 23, 2026
changed use new registration api, add docs annotations
rewrite tests for new syntax
rewrite tests for new syntaxes
Efnilite
requested changes
Apr 25, 2026
Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
sovdeeth
requested changes
Apr 25, 2026
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Efnilite
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In skript, there is currently only an effect for text replacement, meaning you have to store the value somewhere before doing the replacement which can be inconvenient and takes up more lines.
Solution
This PR adds a replace expression, meaning you can now do in 1 line what used to take 3.
Before:
After:
Syntaxes (same as the effect):
Testing Completed
src/test/skript/tests/syntaxes/expressions/ExprReplace.sk
Supporting Information
The current syntax being the same as the effect may be a little unintuitive.
I also encountered a ParserInstance related Skript API Exception while trying to add null test cases to my unit test. I am assuming its a bug with the test effect since it behaves as normal in effect commands and scripts.
Completes: none
Related: none
AI assistance: none