MonitoringMinecraft MonitoringMinecraft

Battery Management

Плагин Paper

Плагин для Майнкрафт, уведомляющий о состоянии батареи и экономящий энергию при бездействии игрока.

35 скачиваний 0 подписчиков
Оцените первым

About

Minecraft Paper Plugin to save energy after inactivity and inform about low / high battery charge. This is thought for small local servers that are running on old laptops or other devices with a battery. It (currently) has no permission set on it's command(s), which means everyone is able to see the battery status.

Suggestions

If you have any suggestions, found a bug or have a feature request, please feel free to contact me!
The plugin is currently also only available for 1.20.1 on paper, but write me a DM and I can make it available for your desired version.
My discord username is eneas._.

Commands

  • /battery [ | ]

Requests and returns the current battery percentage, status, or both if no argument is specified.

Usage

The plugin can be configured to check the battery every given amount of minutes, and broadcast a warning in the chat if the battery is below a specified threshold and discharging or above another specified threshold and charging (default low is 10% and high is 90%).
It also has a feature to stop the server after a given duration of inactivity. This works by testing if no players are online and that the last player left and the last console command was executed, before this duration. If enabled, it also creates a marker file at a given path, so that the server start-script can test if the file exist and trigger further actions, like completely shutting down the device.

Configuration

Default plugin config:

battery:
  enabled: true # Disable battery checks if set to false
  warning_thresholds:
    high: 90  # Warn if battery is above this percentage
    low: 10   # Warn if battery is below this percentage
  check_interval: "5m" # How often to check battery level

inactivity:
  enabled: true # Disable auto-shutdown if set to false
  max_duration: "15m"  # Max inactivity time before shutdown
  check_interval: "5m" # How often to check for inactivity
  shutdown_info:
    file: "/tmp/battery_management/shutdown.info" # File indicating a shutdown request

Example scripts to start server and shutdown if plugin stopped server:

Linux
#!/bin/bash

java -Xms2G -Xmx2G -XX:+UseG1GC -jar /Path/to/paper-server.jar --nogui

FILE="/tmp/battery_management/shutdown.info"

if [ -f "$FILE" ]; then
    rm -f "$FILE"
    shutdown now
fi
Windows
@echo off
setlocal

java -Xms2G -Xmx2G -XX:+UseG1GC -jar C:\Path\to\paper-server.jar --nogui

set "file=C:\Windows\Temp\battery_management\shutdown.info"
IF EXIST "%file%" (
    del "%file%"
    shutdown -s -t 0
)

endlocal
Смотри также

Похожие подборки плагины — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

ReallyWorld КОПИЯ ВСЕМ АДМИНКА
56 онлайн
1.16.5 — 1.21.1 версия
ПвП, Гриферство, бесплатный донат Dragon, AIR DROP
EnergyMC
16 онлайн
1.20.5 — 26.2 версия
🔥 Гибрид | ⚔️ Кланы | 🏰 Рейды | 🤺 Дуэли
Minestory
17 онлайн
1.21 — 26.2 версия
Выживание • Экономика • Кланы • Приваты • Ивенты • PVP • Работа
SkyBars
SkyBars Java + BE
2115 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.4. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат