[1.19.4-1.20.4] HoloLBs >>> Create FANCY Leaderboards | MySQ
1.1Create FANCY HOLO Leaderboards with simple config
ONLY PAPER 1.19.4-1.20.4
Description: Create FANCY HOLO Leaderboards with simple config
Commands:
- Plugin don't have any commands
Features:
- NO DEPENDENCIES !
- MiniMessages Support !
- Contains the simplest API for developers
Instructions and demonstration (EN)
Configuring the plugin
The plugin has only one configuration file:
config.yml
#############################
# HoloLBs #
# Made by GameDoctor #
# 2024 #
#############################
leaderboards:
key1: # It does not affect anything, specify different
enable: false
# Connecting to a MySQL database with data for the leaderboard
database:
# Name of the database
name: "test"
# Database Host
host: "localhost"
# Database User
user: "test"
# Database Password
password: "-"
# Connection arguments. Don't touch it if you don't know how to work with it
arguments: "?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
# The name of the table in the database with numeric data
tableName: "userdata"
# The name of the column with the player's nickname. VARCHAR (String) type
playerValueName: "player"
# The name of the column with numeric data to be sorted by. Recommended type: INT (Integer)
valueName: "level"
# The title of the leaderboard
title: "<bold><rainbow>Leaderboard</rainbow></bold>"
# The format of the beginning of the line
starter: "&c#%num% &a%player%&8"
# The format of the end of the line
value: "&e%value%"
# The name of the empty line
empty: "&cEmpty&8"
# Table size
scale: 1.5
# Line spacing
spacing: 0.30
# The number of rows excluding the header
rows: 5
# Update time in seconds
updateDelay: 10
# Location. yaw and pitch adjust the angle of rotation
location:
world: "world"
x: 0
y: 0
z: 0
yaw: 0
pitch: 0Please note that to work with the plugin NOT through the API, you will need a MySQL database. To create a leaderboard, you need to select a table in your database with two mandatory columns - the player's nickname (VARCHAR - String) and a numeric value (INT - Integer) by which sorting will be performed. If the data type differs from the required one, or if you do not have a MySQL database, then you will have to work with the plugin API.
Working with API
The plugin has the simplest API for creating leaderboards based on your data. Below is an example of CREATING and UPDATING a custom leaderboard:
LinkedHashMap<String, String> data = new LinkedHashMap<>();
data.put("First", "1"); // Filling in the data. The order of data entry is taken into account
data.put("Second", "2");
data.put("Third", "3");
HoloLBsAPI holoLBsAPI = HoloLBs.getHoloLBsAPI();
Leaderboard leaderboard = holoLBsAPI.createLeaderboardHologram(
new Location(Bukkit.getWorld("other"), -14.950, 120.1, 10077.575, -90, 0), // Location
"<bold><rainbow>Leaderboard</rainbow></bold>", // Header
"&c#%num% &b%player%&8", // The beginning of the line
"&e%value%", // Value format
"&cEmpty&8", // Empty value format
5 // Number of lines
);
holoLBsAPI.updateLeaderboard(leaderboard, data); // Updates leaderboardScreenshots
Инструкции и демонстрация (RU)
Настройка плагина
Плагин имеет только один конфигурационный файл:
config.yml
#############################
# HoloLBs #
# Made by GameDoctor #
# 2024 #
#############################
leaderboards:
key1: # Ни на что не влияет, указывайте разные
enable: false
# Подключение к базе данных MySQL с данными для таблицы лидеров
database:
# Название базы данных
name: "test"
# Хост базы данных
host: "localhost"
# Пользователь базы данных
user: "test"
# Пароль базы данных
password: "-"
# Аргументы подключения. Не трогайте, если не знаете, как с этим работать
arguments: "?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false"
# Название таблицы в базе данных с числовыми данными
tableName: "userdata"
# Название столбца с ником игрока. Тип VARCHAR (String)
playerValueName: "player"
# Название столбца с числовыми данными, по которому производится идти сортировка. Рекомендуемый тип: INT (Integer)
valueName: "level"
# Заголовок таблицы лидеров
title: "<bold><rainbow>Таблица лидеров</rainbow></bold>"
# Формат начала строки
starter: "&c#%num% &a%player%&8"
# Формат конца строки
value: "&e%value%"
# Название пустой строки
empty: "&cПусто&8"
# Размер таблицы
scale: 1.5
# Межстрочный интервал
spacing: 0.30
# Количество строк без учёта заголовка
rows: 5
# Время обновления в секундах
updateDelay: 10
# Местоположение. yaw и pitch регулируют угол поворота
location:
world: "world"
x: 0
y: 0
z: 0
yaw: 0
pitch: 0Обратите внимание, что для работы с плагином НЕ через API, Вам потребуется база данных MySQL. Чтобы создать таблицу лидеров, нужно выбрать таблицу в Вашей базе данных с двумя обязательными столбцами - ник игрока (VARCHAR - String) и числовое значение (INT - Integer), по которому будет производиться сортировка. В случае, если тип данных отличается от требуемого, или если у Вас нет базы данных MySQL, то Вам придется работать с API плагина.
Работа с API
Плагин имеет простейшее API для создания таблиц лидеров по своим данным. Ниже представлен пример СОЗДАНИЯ и ОБНОВЛЕНИЯ кастомной таблицы лидеров:
LinkedHashMap<String, String> data = new LinkedHashMap<>();
data.put("Первый", "1"); // Заполнение данных. Учитывается порядок внесения
data.put("Второй", "2");
data.put("Третий", "3");
HoloLBsAPI holoLBsAPI = HoloLBs.getHoloLBsAPI();
Leaderboard leaderboard = holoLBsAPI.createLeaderboardHologram(
new Location(Bukkit.getWorld("other"), -14.950, 120.1, 10077.575, -90, 0), // Локация
"<bold><rainbow>Leaderboard</rainbow></bold>", // Заголовок
"&c#%num% &b%player%&8", // Начало строки
"&e%value%", // Формат значения
"&cEmpty&8", // Формат пустого значения
5 // Количество строк
);
holoLBsAPI.updateLeaderboard(leaderboard, data); // Обновляет таблицу лидеровСкриншоты
Discord: If you need any help with this plugin, you can write to me in Discord: @_gamedoctor_
Note: If you want additional functionality to be added to the plugin, just write about it in the discussion
Installation:
Download, drop it in plugins folder and restart your server
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta