Skip to content

NyaStudio/NekoMotd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NekoMotd

A Server Motd plugin adapted for NekoPixel

Config

# MiniMessage format: https://docs.papermc.io/adventure/minimessage/format/

# placeholders:
#  {online}            - Current online players
#  {max}               - Maximum players
#  {version}           - Velocity version number
#  {velocity_version}  - Full Velocity version ("Velocity 3.4.0")
#  {server_count}      - Number of backend servers
#  {time}              - Current time (default format: HH:mm:ss)
#  {time:FORMAT}       - Current time with custom format

motd:
  line1: "<gradient:#ff6b6b:#4ecdc4>Welcome to NekoPixel Network!</gradient>"
  line2: "<gray>Powered by NekoMotd | <gold>Players: <white>{online}/{max} <dark_gray>| <yellow>{time:HH:mm}"

icon:
  enabled: true
  # Mode: "single" or "random"
  mode: "single"
  filename: "server-icon.png"

ping_verification:
  enabled: true
  valid_duration: 120

API

Example:

  @Subscribe
  public void onInit(ProxyInitializeEvent e) throws Exception {
    Optional<PluginContainer> plugin = server.getPluginManager().getPlugin("nekomotd");
    if (plugin.isEmpty()) return;

    Optional<?> instance = plugin.get().getInstance();
    if (instance.isEmpty()) return;

    Object obj = instance.get();
    if (!(obj instanceof Main)) return;

    MotdApi api = ((Main) obj).getMotdApi();

    // custom motd
    api.setMotd("<gradient:#ff6b6b:#4ecdc4>b</gradient>",
               "<gray>a</gray>");

    // custom icon
    BufferedImage image = ImageIO.read(Path.of("plugins/NekoMotd/icon/server-icon.png").toFile());
    api.setIcon(image); // or api.clearIcon() / api.setFavicon(...)

    // restore
    api.clearAll(); // or api.clearMotd(); / api.clearIcon();
  }

About

A Server Motd plugin adapted for NekoPixel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages