https://github.com/andre601/formatter-expansion
Up-to-date repo at
https://github.com/andre601/formatter-expansion
formatting placeholderapi placeholderexpansion spigot
Last synced: about 1 year ago
JSON representation
Up-to-date repo at
- Host: GitHub
- URL: https://github.com/andre601/formatter-expansion
- Owner: Andre601
- License: mit
- Archived: true
- Created: 2020-05-09T13:20:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-25T20:40:58.000Z (over 1 year ago)
- Last Synced: 2025-03-28T03:24:58.986Z (over 1 year ago)
- Topics: formatting, placeholderapi, placeholderexpansion, spigot
- Language: Java
- Homepage: https://codeberg.org/Andre601/Formatter-Expansion
- Size: 185 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[wiki]: https://wiki.powerplugins.net/wiki/formatter-expansion
[changelog]: https://github.com/Andre601/Formatter-Expansion/blob/master/CHANGELOG.md
# Repository Archived
This repository has been archived. You can find the up-to-date source of it at codeberg:
https://codeberg.org/Andre601/Formatter-Expansion
# Formatter Expansion
> [!IMPORTANT]
> The Formatter expansion uses Paper 1.19.3 and therefore builds against Java 17.
> This makes it incompatible with older Java Distributions. Older Minecraft versions *may* be supported, but it isn't guaranteed.
>
> Please make sure to use **at least** Java 17 or else you may get a `UnsupportedClassVersionError` when it loads.
## Placeholders
The Formatter expansion currently offers the following placeholders:
- [`%formatter_number_format[_[locale]:[pattern]]_%`](./placeholders/number/format.md)
- [`%formatter_number_from:_to:_%`](./placeholders/number/fromto.md)
- [`%formatter_number_round[_[precision]:[rounding_mode]]_%`](./placeholders/number/round.md)
- [`%formatter_number_shorten_%`](./placeholders/number/shorten.md)
- [`%formatter_number_time[_]_%`](./placeholders/number/time.md)
- [`%formatter_text_length_%`](./placeholders/text/length.md)
- [`%formatter_text_lowercase_%`](./placeholders/text/lowercase.md)
- [`%formatter_text_replace_[target]_[replacement]_%`](./placeholders/text/replace.md)
- [`%formatter_text_substring_[start]:[end]_%`](./placeholders/text/substring.md)
- [`%formatter_text_uppercase_%`](./placeholders/text/uppercase.md)
An explanation of the placeholder pages is found in the [placeholders folder](./placeholders/README.md)
### External placeholder support
The expansion allows you to use placeholders from other expansions such as the Player expansion.
To use a placeholder, make sure to use the bracket-format instead of the percent one (i.e. `{player_name}` instead of `%player_name%`).
## Config options
The expansion adds a few options to the config.yml of PlaceholderAPI.
They can be found under `expansions.formatter`.
Option
Description
formatting.pattern
The default DecimalFormat to use for the format placeholder.
Type: String
Default: #,###,###.##
formatting.locale
The country code to use for the decimal format.
You need to replace _ with -
Type: String
Default: en-US
shorten.thousands
The letter used to indicate thousands.
Type: String
Default: K
shorten.millions
The letter used to indicate millions.
Type: String
Default: M
shorten.billions
The letter used to indicate billions.
Type: String
Default: B
shorten.trillions
The letter used to indicate trillions.
Type: String
Default: T
shorten.quadrillions
The letter used to indicate quadrillions.
Type: String
Default: Q
time.condensed
Whether the time returned by the time placeholder should not have any spaces.
Type: Boolean
Default: false
time.days
The text used to indicate days.
Type: String
Default: d
time.hours
The text used to indicate hours.
Type: String
Default: h
time.minutes
The text used to indicate minutes.
Type: String
Default: m
time.seconds
The text used to indicate seconds.
Type: String
Default: s
time.milliseconds
The text used to indicate milliseconds.
Type: String
Default: ms
rounding.mode
The default rounding mode to use if no mode was defined in the rounding placeholder.
Available modes:
updownceilingfloorhalf-uphalf-downhalf-even
Type: String
Default:
half-up
rounding.precision
Default number of decimal points to display when no precision was defined the rounding placeholder.
Type: Number (0 ≤ x)
Default:
0