MonitoringMinecraft MonitoringMinecraft
A

ActionLib

Плагин PaperSpigot

Библиотека-плагин для серверов Майнкрафт: упрощает реализацию действий на основе данных в других плагинах.

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

ActionLib is used to easily implement JSON based data-driven actions, e.g. setting a players health or saturation, or showing a random inventory.

Better documentation can be found here

Default Actions:
trip: Drops the player's entire inventory onto the ground
teleport_player: Allows teleporting the player
spawn_entity: Spawns the specified entity randomly within a radius
smite: Strikes the player with lightning
show_screen: Shows the player a specified screen (Currently only supports the demo screen)
set_saturation: Sets the player's saturation level
set_player_armor: Sets the player's armor
set_level: Sets the player's xp level
set_health: Sets the player's health
set_gamemode: Sets the player's gamemode
set_food_level: Sets the player's food level
set_fire: Sets the player on fire
send_title: Sends a title to the player
send_message: Sends a message to the player
potion_effect: Allows adding, removing, and clearing the player's potion effects
player_chat: Has the player send the specified message
play_sound: Plays a specific sound to the player
open_inventory: Causes the player to open a random or specified inventory (Different than show_screen)
launch_entity: Allows launching all entities (or just the player) into the air
kick_player: Kicks the player
give_item: Gives the player a specified item
flip_player: Flips the player 180 degrees
drop_item: Drops the item in either the player's main hand or the player's off hand

Adding custom actions:
Custom actions are added by extending the "AbstractAction" class and using the "ActionType" annotation

@ActionType(value = "name_of_action")
public class CustomAction extends AbstractAction {

public CustomAction(JavaPlugin plugin) {
super(plugin);
}

// Optional loadFromJson to load from the action's json object

@Override
public void execute(Player target, String[] args) {
// Execution code is here
}

}


Registering custom actions:
ActionRegistry.registerActionsFromPackage("com.example.package", javaPluginInstance);


Using actions:
ActionObjectManager manager = new ActionObjectManager();

JsonObject jsonObject = JsonParser.parseReader(new FileReader(file)).getAsJsonObject();

ActionObject newAction = new ActionObject(plugin, jsonObject);
manager.addActionObject(newAction);

ActionObject action = manager.getEnabledActionObjectByName(args[1]);

action.execute(target, Arrays.copyOfRange(args, 2, args.length));

Смотри также

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

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

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

SkyBars
SkyBars Java + BE
1053 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
MigosMc
MigosMc Java + BE
1000 онлайн
1.8 — 26.2 версия
🌿 MigosMc.net | Гриферский сервер с войс-чатом | Награды за онлайн ⭐ ВЫЖИВАНИЕ⭐ ОДИНБЛОК⭐ МИНИ-ИГРЫ
SeasonEra
5 онлайн
26.1.2 версия
Выживание • Экономика • Кланы • Приваты • Донат • PVP • Работа
PLIRGAME - ДЕВУШКИ ВОЙС ЧАТ
29 онлайн
1.21.10 — 26.1.1 версия
❤️ Выживание! ❤️ Войс Чат ❤️ Девушки ❤️ /free
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.8. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат