I took the courtesy to go into WorldEdit to get the exact code.
-
Player - Player 1 (Red) types a chat message containing -name as A substring
-
Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 18))
The trigger works when a player type any message that starts off with "-name "
(Yes there is a space in there)
WordEdit then gets only certain letters from the string that was entered, so only what the player typed is what the name change would be.
Because the player types, "-name " we don't want the new name to contain that part either. We only want certain parts of the entered chat string
"- n a m e "
1 2 3 4 5 6
Those are the characters used in the entered chat string, but we don't want them.
For example
Player 1 types -name Overload119
- n a m e o v e r l o a d 1 1 9 <- entered chat string.
1 2 3 4 5 6
7 8 9 10 11 12 13 14 15 16 <- digits
By taking only the substrings of the string, we only take from 7 to 18, so only the highlighted parts is what the name change will be.
The reason it is 18 is to cap it, I understand that in the example only 16 character we used, but say if you change 18 to 99 then a player can have a ridiculously long name.
If I helped +rep.