1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script MirrorUtils 1.0.2

Tons of useful expressions and conditions you might need.

  1. EWS
    Supported Minecraft Versions:
    • 1.8, 1.9, 1.10, 1.11, 1.12, 1.13
    MirrorUtils

    This resource has a bunch of useful expressions that you might need, mostly related to texts and numbers.


    Examples:
    Code (Skript):
    1.  
    2. on chat:
    3.    message regex matches "((http|ftp|https):\/\/)?[[email protected]:%%._\+~##=]{2,256}\.[a-z]{2,6}\b([[email protected]:%%_\+.~##?&//=]*)"
    4.    cancel event
    5.    send "You cannot send URLs in chat!"
    6.  
    Code (Skript):
    1.  
    2. on command:
    3.    argument at 2 of full command = "forbidden"
    4.    send "You cannot use such argument in position 2!"
    5.  
    Code (Skript):
    1.  
    2. on load:
    3.    set {test} to yaml value "message.setmoney" from "config"
    4.  
    5. command /money [<text>] [<text>]:
    6.    trigger:
    7.        set (arg 1 parsed as offlineplayer)'s balance to (arg 2 parsed as number)
    8.        send replacer "<player>" and "<value>" with "%arg 1 parsed as offlineplayer%" and "%arg 2 parsed as number%" in {test}
    9.  
    Expressions:
    String
    Code (Skript):
    1.  
    2. # NEW LINE
    3. # Used to add a new line to tab headers/footers and messages.
    4. (newline|nl|cr)
    5.  
    6. # REGEX REPLACE
    7. # Replaces a regular expression in a string with another string.
    8. regex replace %text% with %text% in %texts%
    9.  
    10. # REGEX SPLIT
    11. # Splits a string using a regular expression.
    12. regex split %texts% at %text%
    13.  
    14. # MATCHER OF STRING
    15. # Gets the regular expression matcher in a string.
    16. match[er] %text% (to|in|of|with) %text%
    17.  
    18. # REGEX GROUPS OF MATCHER
    19. # Gets the regular expression groups from a matcher.
    20. # A matcher is obtained from the expression above.
    21. [regex] group[s] %integer% of [matcher] %object%
    22.  
    23. # SUBTEXT
    24. # Gets the subtext of a string. Exactly like Skript's, but for a single argument
    25. sub(text|string) of %text% (from|char[racter][s]) %integer%
    26.  
    27. # EXACTLY EQUALS
    28. # Checks if a string is equal to another.
    29. # Case sentitive (only reason for it to be here).
    30. %text% exactly equals [to] %text%
    31.  
    32. # ARGUMENT AT
    33. # Gets the nth element of texts separated by spaces.
    34. # Useful for on command events.
    35. argument [at] %integer% of %text%
    36.  
    37. # REPLACER
    38. # Allows you to replace multiple values at once in a string.
    39. # Most useful expression around.
    40. (multi[ple] replace|replacer) [(elements|values)] %texts% with %texts% in %text%
    41.  
    42. # RANDOM STRING
    43. # Generates a random string with the length specified.
    44. random (1¦alphanumeric|2¦alphabetic|3¦numeric|4¦ascii|5¦graph) [(text|string)] [with] (size|length) %integer%
    45.  
    Numbers
    Code (Skript):
    1.  
    2. # SPACED NUMBER
    3. # Returns a string with formatted number.
    4. spaced %numbers%
    5.  
    6. # ORDINAL NUMBER
    7. # Gives you the number with proper formatting (1st, 2nd, 3rd... 22nd, 24th)
    8. ordinal [of] %integer%
    9.  
    10. # SUM PREVIOUS
    11. # Sums all the integers smaller than a number N.
    12. # Useful for shops that increase the price and allow multiple items bought at once.
    13. sum prev[ious] [numbers] of %integer%
    14.  
    15. # ROUND TO
    16. # Rounds a number to N decimal places.
    17. round %number% to %number% [decimal] [places]
    18.  
    19. # TOP ELEMENTS
    20. # Gets the top N elements of a TreeMap.
    21. # Considerably more efficient than sorting directly in Skript.
    22. # Loop your variables and add them to a TreeMap.
    23. (top|first) %integer% (values|elements) of sort[ed] tree[ ]map %object%[ formatted] as %text%
    24.  
    25. # NUMBER TO ROMAN NUMERAL
    26. # Converts a number to a roman numeral.
    27. %number% (to|in) roman [numeral]
    28.  
    29. # NUMBER TO WORDS
    30. # Converts a number into words.
    31. number %number% (to|in) words
    32.  
    33. # FORMATTED NUMBER
    34. # Formats a number using symbols to indicate base 10 exponents (k, M, B).
    35. formatted %number% [round[ed] to %-integer%]
    36.  
    37. # PI
    38. # pi
    39. pi
    40.  
    Time
    Code (Skript):
    1.  
    2. # TIME SINCE
    3. # Returns the time (seconds) since a unix timestamp.
    4. time since %number%
    5.  
    6. # TEXT TO SECONDS
    7. # Parses timespans like 1d10h10s.
    8. # Incredibly useful for temporary bans/mutes...
    9. %text% (to|in) seconds
    10.  
    11. # FORMAT SECONDS
    12. # Uses an util to change seconds into any format you want.
    13. # Check https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/DurationFormatUtils.html.
    14. format %number% (into|as) %text%
    15.  
    16. # CURRENT MILLISECONDS
    17. # Returns the current time, in milliseconds.
    18. [current] m[illi]s[econds]
    19.  
    Location
    Code (Skript):
    1.  
    2. # DIRECTION NAME
    3. # Returns the first letter of the direction of a location. (N, S, E, W)
    4. # Use "with cardinals" to include SW, NW, NE and SE.
    5. direction name of %location% [(1¦with cardinals)]
    6.  
    7. # BLOCKS FROM A TO B
    8. # Gets the blocks between two locations.
    9. blocks from %location% (to|and) %location%
    10.  
    Item
    Code (Skript):
    1.  
    2. # ITEM WITH LORE
    3. # Returns an item with the lore specified.
    4. %item% with lore %text%
    5.  
    6. # HIDE FLAGS
    7. # Hides flags of an item.
    8. %item% with [(item|hidden|hide)][ ]flags %texts%
    9.  
    10. # ITEM OF ENCHANTMENTS
    11. # Exactly like Skript's expression, but works for variables.
    12. %item% of %enchantmenttypes%
    13.  
    14. # GLOWING ITEM
    15. # Returns a glowing item (glows like it's enchanted, but doesn't show any).
    16. glowing %items%
    17.  
    18. # ITEM'S META
    19. # Returns the meta of an item.
    20. meta of %item%
    21. %item%'s meta
    22.  
    Player
    Code (Skript):
    1.  
    2. # DURATION OF POTION
    3. # Returns the duration (in seconds) of that potion in an entity.
    4. duration of [potion] [effect] %potiontype% (on|of) %livingentity%
    5.  
    6. # TIER OF POTION
    7. # Returns the level of the potion applied to an entity.
    8. tier of [potion] [effect] %potiontype% (on|of) %livingentity%
    9.  

    Conditions
    Text
    Code (Skript):
    1.  
    2. # REGEX MATCHES
    3. # Checks if a string matches a regular expression.
    4. %texts% [regex] matches %text%
    5.  
    Number
    Code (Skript):
    1.  
    2. # IMPROVED BETWEEN
    3. # Checks if a number is between two others.
    4. # Allows < and <=.
    5. %number% (1¦\<|2¦\<=) %number% (3¦\<|4¦\<=) %number%
    6.  
    Player
    Code (Skript):
    1.  
    2. # ENTITY HAS POTIONS
    3. # Continues if the entity has those enchants in their respective levels.
    4. %livingentity% has [potion] [effect[s]] %potiontypes% [level[s]] [%-integers%]
    5.  

    There are full descriptions in the file, if you need them.

    EWS (TrademarkTM)​
    Ayham Alali and Uzumaki like this.

Recent Updates

  1. New expressions and fixes.
  2. Fix in RegEx matches condition.

Recent Reviews

  1. Efnilite
    Efnilite
    5/5,
    Version: 1.0.1
    This is a very nice mirror resource, I'd probably use it a lot lol
  2. Padlick
    Padlick
    5/5,
    Version: 1.0.1
    I think that's a must-have for every skript Server! Works just fine as it should, really fast support... It's just nice. Keep up your work c:
  3. Ayham Alali
    Ayham Alali
    5/5,
    Version: 1.0.0
    This is EPIC! Great work mate, this is truly helpful. Keep it up <3
    1. EWS
      Author's Response
      Thanks for you support.
      If you have new ideas for syntaxes, please send me a PM!