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));
No gallery available for this project.
| Version | Minecraft | Loader | Download |
|---|---|---|---|
|
ActionLib 0.11.0 0.11.0 |
1.13, 1.13.1, 1.13.2, 1.14, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.15, 1.15.1, 1.15.2, 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11
|
paper, spigot
|
Download |