Expressions Provider

添加MiniPlaceholders占位符,用于复杂的数学和文本表达式。

资源图片
# Expressions-Provider Add MiniPlaceholders placeholders for complex mathematical and text expressions. ## Installation - Install MiniPlaceholders - Install this project in the mods or plugins folder, depending on the platform you use ## Placeholders ### Basic Operations - **Addition** | `` - `` == 10 - **Subtraction** | `` - `` == 7 - **Multiplication** | `` - `` == 180 - **Division** | `` - `` == 2 - **Division remainder** `` - `` == 1 - **Negation** | `` - `` == -5 - `` == 5 ### Round - **Round down to integer** | `` - `` == 5 - `` == 2 - **Round to nearest integer** | `` - `` == 5 - `` == 3 - **Round up to integer** | `` - `` == 6 - `` == 3 - **Get the lowest-valued number** | `` - `` == 2 - **Get the highest-valued number** | `` - `` == 500 - **A random number from 0 to 1** | `` | Acts like `` - `` == 0.15 - **A random integer from `min` to `max`** | `` | Acts like `` - `` == 69 - **A random number from `min` to `max` with a step of `step`** | `` - `` == 68.75 ### String Operations - **Concat strings** | `` - `` == "hello_world" - **Create a substring of `s` from `n1` to `n2` character** | `` - `` == "ll" - **Get length of the string** | `` - `` == 5 - **Format a string using [Java String.format()](https://www.javatpoint.com/java-string-format)** | `` | *It may be useful for [user expressions](#User-expressions)* - `` == "4drian3d is not a fruit" - **Displays `r1` if `o1` and `o2` are same. Otherwise, displays `rs`** | `` - `` == "NotEquals" - **Sets `text` placeholders for a player with `uuid`.** | `` - `>` == 4drian3d - **Sets `text` placeholders for a player with `name`.** | `` - `>` == 42 - **Expand to a [User expression](#User-expressions)** | `` ## User expressions You can create your own expression shortcut in expressions.properties using our Expression Provider Language (EPL): `add_and_multiply=":"':''>">` means `` will be evaluated to `arg1 + (arg2 * arg3)`. So, `` evaluates to `'>`, which is `2 + (3 * 4) = 14` ### Example user expressions - `` - Remove `n` first characters from `s` (`hello`, `2` -> `llo`), EPL: `remove_first=":"":"'>">` - `` - Remove `n` last characters from `s` (`hello`, `2` -> `hel`), EPL: `remove_last=":0:"">':''>">` - `` - format a number (`1.234567`, `2` -> `1.23`), EPL: `decimals=':'f'>":"">` - `` - pad an integer with zeros (`12`, `3` -> `012`), EPL: `pad_integer=':'d'>":"">` ## Nesting Expressions can be nested. Try `/miniplaceholders parse me '>">'>">` ## Downloads [![](https://raw.githubusercontent.com/Prospector/badges/master/modrinth-badge-72h-padded.png)](https://modrinth.com/plugin/expressions-expansion) [![](https://www.bisecthosting.com/partners/custom-banners/6fa909d5-ad2b-42c2-a7ec-1c51f8b6384f.webp)](https://www.bisecthosting.com/4drian3d)