Minecrell / ServerListPlus

A flexible Minecraft plugin to customize the appearance of your server in the server list
https://git.io/slp
GNU General Public License v3.0
235 stars 60 forks source link

Add a countdown to the motd #382

Closed Deeptanil closed 2 years ago

Deeptanil commented 2 years ago

I want to add a countdown to a specific event that I'm making. Is there a way to do that? I've tried with placeholder api but no luck!

stephan-gh commented 2 years ago

There is no countdown placeholder in SLP but I would expect the PlaceholderAPI one to work (if it has one).

I've tried with placeholder api but no luck!

Please state more clearly what you tried (e.g. paste configuration) and what happened.

Deeptanil commented 2 years ago

I used this placeholder (from placeholderapi)

%server_countdown_<SimpleDateFormat>_<time>%
e.g. %server_countdown_dd.MM.yyyy_01.01.2020%

My config %server_countdown_dd.MM.yyyy_01.01.2022%

I just put that in my MOTD, but it just came as that text. Aka the placeholder did not work!

stephan-gh commented 2 years ago

As described in https://github.com/Minecrell/ServerListPlus/wiki/Placeholders#placeholderapi, PlaceholderAPI placeholders must be used with {...} instead of %...%. Sorry for the confusion!

In other words, please try: {server_countdown_dd.MM.yyyy_01.01.2022}

Deeptanil commented 2 years ago

Still did not work... Huh... I'll try some other placeholder and check.

Edit: I did that

Personalized:
  Description:
  - |-
    &R         &6&l&oWELCOME&r &e&l&oTO&r &c&lSYCHOSAP&r &6&lNETWORK!
    &R            &6&lJava &e&land &6&lBedrock! &B[&91.9&b-&91.18&b] %server_online%
  - |-
    &R               &a&l&oCROSS-PLATFORM GAMING 
    &R            &6&lJava &E&land &6&lBedrock! &B[&91.9&b-&91.18&b]{server_online}
  Players:
    Hidden: yes

None worked!

Deeptanil commented 2 years ago

Oh is it because of the Personalized section? How do I make it so it does not use that section!? I want it to be in default..

stephan-gh commented 2 years ago

You can delete the Personalized section entirely if you don't want it. It's not required, just there by default as example.

Deeptanil commented 2 years ago

Okay!

Did not work. Tried with bot %…% and {…}

Deeptanil commented 2 years ago

Um it just cleared the config- I might have made a mistake?

Can u make it so it makes a backup or stops working instead of clearing the config!?

Deeptanil commented 2 years ago

Also on an unrelated note, add this to your wiki or page for people who want to center their MOTDs with ease! They also feature your plugin indirectly! https://mctools.org/motd-creator

stephan-gh commented 2 years ago

Um it just cleared the config- I might have made a mistake?

Can u make it so it makes a backup or stops working instead of clearing the config!?

SLP does not touch the configuration unless you use /slp save. And there is usually no need to run that command. Also, in that case a ServerListPlus.bak.yml is created (or something like that).

Please post your full configuration for reference if you cannot make it work.

Deeptanil commented 2 years ago

No, actually it has happened once before as well... When some formatting mastake is made it clears it. What does /slp save do lmao... I didn't know that was a command!

Also thanks you but I figured that bit out..

The placeholders not working though!

stephan-gh commented 2 years ago

No, actually it has happened once before as well... When some formatting mastake is made it clears it.

I'm 92% sure that SLP cannot be responsible for this because it is specifically designed to never do that.

The placeholders not working though!

As I said: Please post your full configuration for reference if you cannot make it work.

Deeptanil commented 2 years ago

I'm 92% sure that SLP cannot be responsible for this because it is specifically designed to never do that. I don't think any other plugin would do that... Happens only when I make a mistake!

As I said: Please post your full configuration for reference if you cannot make it work. Sure!


#      _____                     __    _     _   _____ _
#     |   __|___ ___ _ _ ___ ___|  |  |_|___| |_|  _  | |_ _ ___
#     |__   | -_|  _| | | -_|  _|  |__| |_ -|  _|   __| | | |_ -|
#     |_____|___|_|  \_/|___|_| |_____|_|___|_| |__|  |_|___|___|
# 
# ServerListPlus v3.4.8 - http://git.io/slp

More information is available in the Wiki: http://git.io/slp-wiki

This is the section where you can customize your server status ping!

- Default is the section for the status used when the player name is unknown.

Personalized is used if the client has already joined the server once.

Use %player% as placeholder for the player's name.

Features:

- Description (MotD): A short status message for your server, max. 2 lines.

- Players:

- Hover: The player hover message that is displayed if you hover the player count.

- Slots: Custom player slot formatting, see http://git.io/slp-slots

- Favicon:

- Use multiple server icons or the player's head as favicon, see http://git.io/oMhJlg

- Possible favicon sources: Files, Folders, URLs, Heads, Helms, Encoded

More features are explained in the Wiki: http://git.io/slp-config

Usage:

- Add multiple entries for random messages.

- Save the file with valid UTF-8 encoding for special characters.

- Available placeholders:

- Player name: %player%

- Player count: %online%, %max%, %online@server% %online@world%

- Random online player name: %random_player%

--- !Status Default: Description:

Stats: Enable/disable sending plugin statistics.

PlayerTracking: Enable/disable tracking of player names to their IP-Addresses.

- Persistence can be disabled with the toggle in the Storage section.

Samples: Toggle using multiple player infos for the player hover message.

May prevent the annoying ... and x more ... message for bigger servers

DynamicPlayers is special and aligns the number with the number of

random players used in placeholders.

Unknown: Placeholder replacement if the real value is unknown.

Favicon: Options for the creation / downloading of favicons:

- RecursiveFolderSearch: Also search for favicons in sub directories.

- SkinSource: The URL to get the Minecraft Skins from. (%s -> player name)

- ResizeStrategy: The strategy used to resize too small or too big favicons.

NONE (keep them as is, will probably fail), SCALE (scale them to the correct size)

--- !Plugin Stats: true PlayerTracking: Enabled: true Storage: !JSONStorage Enabled: true SaveDelay: 5m Samples: Multiple: false DynamicPlayers: false Unknown: PlayerName: player PlayerCount: ??? Date: ??? Favicon: Timeout: 10s RecursiveFolderSearch: false ResizeStrategy: SCALE

stephan-gh commented 2 years ago

So what happens? Is the {server_countdown_dd.MM.yyyy_01.01.2022} not replaced at all? Also note that you have 4 different descriptions listed so it will choose one of them randomly.

Deeptanil commented 2 years ago

Screenshot_20211213-215048_PojavLauncher_(Minecraft_Java_Edition_for_Android)

Result

Deeptanil commented 2 years ago

So I have DiscordSRV and so when I type %server_countdown_dd.MM.yyyy_01.01.2022% in chat... It appears as %server_countdown_dd.MM.yyyy_01.01.2022%. And in the Discord chat, Screenshot_20211213-215638_Trebuchet

stephan-gh commented 2 years ago

Are you using the SLP 3.5.0 development builds? It does not work with SLP 3.4.8.

Deeptanil commented 2 years ago

No I'm using 3.4.8 Should I upgrade to the lastest dev build?

Deeptanil commented 2 years ago

Thank you! It works :)