https://github.com/mrxiaom/timeoperate-expansion
Time operating expansion for PlaceholderAPI
https://github.com/mrxiaom/timeoperate-expansion
java minecraft placeholderapi placeholders spigot
Last synced: 15 days ago
JSON representation
Time operating expansion for PlaceholderAPI
- Host: GitHub
- URL: https://github.com/mrxiaom/timeoperate-expansion
- Owner: MrXiaoM
- License: mit
- Created: 2023-02-03T04:04:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-11T12:09:41.000Z (4 months ago)
- Last Synced: 2025-05-06T21:08:35.329Z (15 days ago)
- Topics: java, minecraft, placeholderapi, placeholders, spigot
- Language: Java
- Homepage:
- Size: 78.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TimeOperate-Expansion
Time operating expansion for PlaceholderAPI# Install
* Download jar file from [releases](https://github.com/MrXiaoM/TimeOperate-Expansion/releases).
* Put the jar file to `/plugins/PlaceholderAPI/expansions/`
* Execute command `/papi register ` or `/papi reload` or restart server.# Usage
```
// Arguments: [Optional]%timeoperate_
> I am not a native English speaker. There are maybe some typo errors.
## time
| value | detail | example |
|----------------------------------------------------------------------------------------------------------|------------------------|----------------------------|
| now | now time | `now` |
| timestamp | timestamp (in seconds) | `1675353600` |
| [Formatter](http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html)|value | specific format time | yyyy-MM-dd|2023-02-03 |## display format
Use `unix` for returning timestamp (in seconds).
Or read the [DateTimeFormatter](http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html) Javadoc page about possible formats.
e.g. `yyyy-MM-dd` (2024-08-10), `HH:mm:ss` (11:45:14)## time override
| value | detail | example |
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| +DURATION | plus time, needed number and unit (ignore case),
- `d` means **day(s)**
- `h` means **hour(s)**
- `m` means **minute(s)**
- `s` means **second(s)**
| -DURATION | minus time, needed number and unit (ignore case),
- `d` means **day(s)**
- `h` means **hour(s)**
- `m` means **minute(s)**
- `s` means **second(s)**
| unit=value | set specific time, needed unit and number (case sensitivity),
- `y` or `year` means **year**
- `M` or `month` means **month**
- `d` or `day` means **date**
- `h` or `hour` means **hour**
- `m` or `minute` means **minute**
- `s` or `second` means **second**
| hour:minute:second | set hour, minute and second in a more simple way, type `~` means not modify | `4:0:0`, `6:0` (full `06:00:00`), `20:05` (full `20:05:00`), `11:45:14` |
| w+num | set date to next *num* weeks' Monday. If *num* equals 0, it just set date to the Monday of that week. | `w+1` (`2024-11-15 Friday` -> `2024-11-18 Monday`) |
| w-num | set date to previous *num* weeks' Monday. The same as `w+num` | `w-1` (`2024-11-15 Friday` -> `2024-11-04 Monday`) |
| M+num | just plus *num* months. | `M+1` (`2025-01-11` -> `2025-02-11`) |
| M-num | just minus *num* months. | `M-1` (`2025-01-11` -> `2024-12-11`) |
| y+num | just plus *num* years. | `y+1` (`2025-01-11` -> `2026-01-11`) |
| y-num | just minus *num* years. | `y-1` (`2025-01-11` -> `2024-01-11`) |
Support multi overrides, connect them with `_`.
# Examples
```
// Get timestamp (in second) of tomorrow 6:00
%timeoperate_now_unix_+1d_6:00%
// Get time of tomorrow but minute and second are 0 with custom format
%timeoperate_now_yyyy/MM/dd HH:mm:ss_+1d_~:0:0%
```
# Usage Examples
```
// give player temp permission by LuckPerms, expire in tomorrow 4:00
/lp user %player_name% permission settemp your.perm.here true %timeoperate_now_unix_+1d_4:00%
```